# Day 27: Flutter Plugins

> Learn how to use plugins in Flutter and how to create and use them. Implement plugins in your Flutter app.

- URL: https://www.appwriters.dev/30days/flutter/day27
- Series: #30DaysMasterFlutter

---

Flutter plugins are used to access native platform functionalities such as camera, sensors, maps, and more, through a nice Dart interface. This enables developers to create powerful cross-platform apps that can leverage the full capabilities of the underlying operating system and devices.

Plugins are essentially packages that contain platform-specific code and a Dart API that developers can use to interact with that code. Plugins enable developers to build cross-platform apps by providing a way to write platform-specific code that can be easily reused across multiple platforms. This can make development more efficient and less error-prone by abstracting away platform-specific details and providing a consistent API for developers to work with.

> **Project** - Share Quotes
>
> Remember the quotes app we built, now use [share_plus](https://pub.dev/packages/share_plus) plugin to allow users to share quotes to social media
>

By the end of this day, you should have an understanding of what Flutter plugins are and why they are important. You should also be able to use Flutter plugins to access native functionalities of the platform.

## Tips

- Learn about Flutter plugins and how they enable you to access native functionalities.
- Explore different plugins available in the Flutter ecosystem, such as camera, geolocation, and sensor plugins.
- Always read the documentation of the plugin you are using to understand how to use it. Plugin APIs change between major versions; for example, recent versions of share_plus use:

```dart
import 'package:share_plus/share_plus.dart';

await SharePlus.instance.share(
  ShareParams(text: '"Stay hungry, stay foolish." - Steve Jobs'),
);
```

- After adding a plugin, stop the app and run it again (a full restart, not hot reload), because the native code needs to be compiled into the app.

> [more projects](/courses/master-flutter/ch10-plugins)

### Resources

- [Flutter Cookbook on Camera](https://docs.flutter.dev/cookbook/plugins/picture-using-camera)
- [Share Plus](https://pub.dev/packages/share_plus)
- [Image picker](https://pub.dev/packages/image_picker)
