An interactive Flutter application showcasing a wide range of Flutter components, layouts, and features with integrated side-by-side source code views.
- Primary Technology: Flutter & Dart
- Architecture: Feature-based organization with a central routing table.
- State Management: Uses a mix of
flutter_riverpodandprovider. - Backend/Services: Heavily integrated with Firebase (Auth, Analytics, Crashlytics, Firestore, etc.), Google Mobile Ads (AdMob), and AI services (OpenAI, Groq).
- Core Functionality: Each example is a "route" that includes both the running widget and its source code. Source files are treated as assets to enable the "Code" view.
- Flutter SDK (Check
.fvmrcif present for preferred version). - Firebase setup (requires
firebase_options.dartand platform-specific config files likegoogle-services.json).
- Install Dependencies:
flutter pub get - Run the App:
flutter run - Build Web Version:
flutter build web - Code Generation:
dart run build_runner build --delete-conflicting-outputs(used forfreezed,json_serializable, etc.)
- Static Analysis:
flutter analyze - Format Code:
dart format . - Auto-fix Lint Issues:
dart fix --apply - Testing:
flutter test
lib/main.dart: Entry point, initializes Firebase and settings.lib/my_main_app.dart: RootMaterialAppwidget.lib/my_app_routes.dart: The "brain" of the app; defines the entire catalog structure and routing table.lib/my_route.dart: A wrapper widget for all examples, providing the backdrop and code-view toggle.lib/routes/: Contains individual example implementations (e.g.,widgets_text_ex.dart).lib/my_app_settings.dart: Manages persistent user preferences (Dark mode, Bookmarks, etc.) usingshared_preferences.res/: Contains application assets (images, lottie animations).packages/: Contains local package modifications or custom widgets (e.g.,widget_with_codeview).
- Side-by-Side Source View: Every new example should be added to
lib/routes/and registered inlib/my_app_routes.dart. The source file MUST be included in theassetssection ofpubspec.yamlto be viewable in the app. - Naming Convention: Route files typically follow the pattern
{category}_{feature}_ex.dart. - Linting: Follows
package:flutter_lintswith some relaxations defined inanalysis_options.yaml(e.g., allowingthisfor clarity). - Firebase: Ensure all Firebase features are initialized conditionally for supported platforms (Mobile/Web).
pubspec.yaml: Manages extensive dependencies and asset declarations.lib/my_app_routes.dart: Centralized location for the catalog's content hierarchy.lib/constants.dart: Global constants and platform detection logic.analysis_options.yaml: Project-specific linting and static analysis rules.