common_utils2
4.0.1, released 7 weeks ago by innocentdiwe.qzz.io
Production-focused Flutter utilities for notifications, storage, connectivity, and media.
What it does
A comprehensive utility package providing pre-configured services for push and local notifications, secure storage, Hive CE, connectivity checking, validation, and media/file pickers. It bundles common everyday extensions and helpers for production apps.
AI-written summary of version 4.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a production Flutter app and want a pre-packaged set of utilities for notifications, storage, and common validations.
- You need an integrated solution for push/local notifications with deep-link handling and per-category mute preferences.
Skip it when
- You only need a single lightweight utility (like url_launcher or crypto) and want to avoid pulling in a large dependency graph.
- Your project does not use Flutter 3.47+ or Dart 3.13+.
Strengths
- Combines many essential production utilities into a single, cohesive package.
- Built-in support for per-category notification mute, cold-start taps, and in-app notification overlays.
- Type-safe Result and AsyncState types for robust error handling.
Weaknesses
- Large dependency footprint due to covering multiple domains (storage, media, notifications, location).
- Strict minimum requirement of Flutter 3.47 and Dart 3.13.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 37
Requires initialisation in main() before runApp and specific platform configurations for Firebase, permissions, and minimum SDK versions (Android minSdk 24, compileSdk 37).
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await StorageService.init();
await SecureStorageService.init(namespace: 'myapp');
await HiveStorageService.init();
runApp(const MyApp());
}Alternatives
Packages that do the same job and could replace common_utils2.
- result_type
A Result type representing success or failure in Dart
50Compare - gtk
GTK utilities for Flutter Linux applications, providing settings and application lifecycle helpers.
76Compare - flutter_flavorizr
A utility to easily create and configure application flavors in Flutter.
86Compare - validators2
String validation and sanitization for Dart.
83Compare
Works with
Packages commonly used together with common_utils2: ones it builds on, ones built on it, and its own family.
- cryptocommon_utils2 depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- json_annotationcommon_utils2 depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- intlcommon_utils2 depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- path_providercommon_utils2 depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- shared_preferencescommon_utils2 depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- package_info_pluscommon_utils2 depends on itFlutter plugin to query app package info like version, build number and installer store.
- equatablecommon_utils2 depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- flutter_secure_storagecommon_utils2 depends on itSecure key-value storage using platform-specific secure mechanisms