In Flutter app development, there are several Modules, Features and Packages that are commonly used due to their functionality, ease of use, and the value they add to app development. Here’s a detailed overview of some of the most popular ones:
Core Flutter Modules and Features
State Management
– Provider: A flexible and easy-to-maintain solution for state management.
– Riverpod: An improvement over `Provider` with a modern approach.
– Bloc & Cubit: Business logic component to separate presentation and business logic. There is also the variation of bloc – rx_bloc https://pub.dev/packages/rx_bloc – that slipts the state in different streams.
– Get – State and Navigation Manager https://pub.dev/packages/get
– redux: Popular for managing state in large applications.
– mobx: A reactive state management approach.
Navigation & Routing
– Navigator: The built-in Flutter navigator for routing.
– go_router: A routing package that simplifies declarative routing.
– auto_route: For more complex routing needs with automatic code generation.
A side sub-feature of navigation and routing is the deep linking inside an app. Package for this is https://pub.dev/packages/app_links. There are several videos from Google Flutter:
HTTP Requests
– http: A package for making HTTP requests and manipulating REST APIs.
– Dio: A more advanced library for HTTP requests with interceptors, global configuration, and more.
– Retrofit: Library for generating the http requests from an interface and annotations on it. It is using dio underneath.
– graphql_flutter: To interact with GraphQL APIs.
UI Components
– Material Components: Standard components from the Material Design library.
– Cupertino Widgets: For iOS-styled widgets.
– You could use some wrapper library of both – that I’m trying to make https://github.com/tomavelev/common_flutter_widgets
– There are also a lot of different widget libraries. I could recommend: https://pub.dev/packages/widget_toolkit
Forms and Input Handling
– flutter_form_builder: Simplifies form creation and validation.
– reactive_forms: For reactive-style forms handling.
– The Widget Toolkit https://pub.dev/packages/widget_toolkit also contain a Text Field Dialog Component – capsulating field validation (client and/or server) in dialog – isloted from the main screen.
Persistence
– Shared Preferences: For simple key-value storage.
– Secure Storage: for Shared Preferences with higher security
– Sqlite: for structured mobile database. There are two packages: sqlite3 or sqflite
– Hive: Lightweight and fast NoSQL database.
– Floor: An SQLite abstraction layer with a neat API.
Packages for Common Functionalities
– intl: Internationalization support – given by the Flutter Team. It uses code generation (flutter gen-l10n)
– url_launcher: To launch URLs in a browser or other applications.
– path and path_provider: Accessing commonly used locations on the filesystem.
Dependency Injection
Besides the provider package, there are also:
– get_it: Simple and effective service locator package.
– injectable: Code generator for dependency injection.
Animations
Animations may be archived with the build-in widgets like:
- Hero – Animating Transition between screens: https://api.flutter.dev/flutter/widgets/Hero-class.html
- Different Container Widgets like PageController or Route Transitions Animations
- Bottom Sheet animations – like the used in https://pub.dev/packages/widget_toolkit
- AnimatedWidget https://api.flutter.dev/flutter/widgets/AnimatedWidget-class.html with different transitions and control over the animation with a ticker https://api.flutter.dev/flutter/widgets/TickerMode-class.html
For more advanced animations you could use:
– flutter_animate: Advanced animation library.
– rive: For complex, interactive animations.
– fl_chart: To create beautiful and customizable charts.
– lottie: To render animations in Lottie format.
– Tree View Packages:
- https://pub.dev/packages/flutter_simple_treeview
- https://pub.dev/packages/flutter_treeview/example
- https://pub.dev/packages/graphview
Key Third-Party Packages
Firebase Integration
– firebase_auth: Authentication services.
– cloud_firestore: NoSQL cloud database.
– firebase_storage: For file storage.
– firebase_analytics: Analytics for tracking user events.
If you plan to target any alternative stores and devices – besides the controlled by Google And Apple you may need the alternative of these services like:
- Amazon Amplify https://docs.amplify.aws/gen1/flutter/start/getting-started/introduction/
- or Huawei https://pub.dev/publishers/developer.huawei.com/packages
Media
– image_picker: To pick images from the gallery or camera.
– video_player: Playing videos from files, internet, etc.
– Recording https://pub.dev/packages/record
– Playing audio https://pub.dev/packages/audioplayers
– The Ffmpeg software also allows offline editing video content – https://programtom.com/dev/2021/04/16/how-to-add-watermark-to-video-flutter/
Maps
– google_maps_flutter: Google Maps integration for Flutter.
– mapbox_gl: Integration with Mapbox Service.
– Or Open Street Map – https://pub.dev/packages/flutter_osm_plugin
Authentication
– flutter_facebook_auth: Facebook authentication.
– google_sign_in: Google Sign-In integration.
Push Notifications
Push Notifications are one of the 9 Social Features – needed by any app that wants close to real-time feedback from the user. https://programtom.com/dev/2020/10/07/social-software-8-features-to-make-a-product-successful/
– Firebase Cloud Messaging (FCM).
– OneSignal.
Payment Processing
The most important plugin is the integration with Google and Apple Pay: https://pub.dev/packages/pay, as it is the provider of the devices and/or platforms and they prioritize them. You may find the need to integrate also Huawei Pay: https://pub.dev/packages/huawei_iap , if you target the chinease market, or just the altetrnative to Google.
Otherwise there are million other payment processors like Stripe, Razorpay, etc More about it here: https://programtom.com/dev/2023/03/16/payment-integrations/.
In-App Purchases
– `in_app_purchase` package for handling IAPs. Many SAAS Builders seem to use RevenueCat Service: https://www.revenuecat.com/docs/
Development and Productivity Tools
Logging
– logger: An advanced logging package.
For finding problems on production
Testing
– mockito: For creating mock objects.
– flutter_test: Built-in Flutter testing library.
– integration_test: For integration testing.
– bloc_test: To test `bloc` logic.
– Golden Tests – https://pub.dev/packages/golden_toolkit – for Pixel Perfect Apps.
Code Quality
– pedantic: Standardization for Dart code style / Deprecated /.
– lint: Customizable linter.
By leveraging these modules, features, and packages, developers can speed up the development process, maintain high code quality, and ensure the app is scalable and maintainable. The choice of tools often depends on the complexity of the app, performance requirements, and personal or team preferences.