flutter_chen_common
5.15.0, released 5 weeks ago by an unverified publisher
Utility package with networking, logging, theme system, and common UI components.
What it does
Provides a comprehensive collection of tools for Flutter app development including an HTTP client (built on Dio), a robust file/console logging system, customizable theme extensions, unified multi-state layouts, and global toasts.
AI-written summary of version 5.15.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want an all-in-one common utility package for networking, logging, and styling.
- You need built-in debug panels to inspect networking, logs, and storage.
- You require customizable theme structures and global context-free toasts.
Skip it when
- You prefer keeping your utilities modular instead of depending on a single heavy all-in-one package.
- You are building web applications where file-based logging is unsupported.
Strengths
- Includes out-of-the-box enterprise-grade logging and networking with Dio.
- Comes with helpful debug overlays for network and logs inspection.
- Provides a rich set of built-in widgets such as marquees, popups, and smart refresh layouts.
Weaknesses
- High coupling due to combining networking, logging, state layout, and UI components into a single package.
- File logging relies on IO runtime and does not support web.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Initialize global singletons like SpUtil, Log, HttpClient, and ComContext in main() before running the app.
final navigatorKey = GlobalKey<NavigatorState>();
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SpUtil.init();
HttpClient.init(
config: HttpConfig(
baseUrl: 'https://api.example.com',
),
);
ComContext.init(navigatorKey);
runApp(MyApp());
}Alternatives
Packages that do the same job and could replace flutter_chen_common.
Works with
Packages commonly used together with flutter_chen_common: ones it builds on, ones built on it, and its own family.
- shared_preferencesflutter_chen_common depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- dioflutter_chen_common depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- loggerflutter_chen_common depends on itAn extensible logger for printing formatted logs with levels, custom filters, and printers.
- flutter_chen_refreshflutter_chen_common depends on itA Flutter refresh library for pull-down refresh and pull-up load with customizable indicators.