flutter_prakash_core 1.0.11
flutter_prakash_core: ^1.0.11 copied to clipboard
Enterprise-grade Flutter core package & hybrid plugin framework with Clean Architecture, BLoC state management, reactive forms, DevTools, and monetization.
flutter_prakash_core_example π±β¨ #
A production-grade, enterprise sample application demonstrating the complete capabilities of flutter_prakash_core and flutter_prakash_ads. Built adhering strictly to Clean Architecture (no domain layer, direct concrete data sources & repositories), SOLID principles, and reactive form management. ποΈβ‘
π What This Example Showcases #
- β‘ BLoC State Management:
BaseUiCubit&UiStatelifecycle (initial,loading,success,failure).BaseFormCubit&Field<T>with declarative chainedValidators.BasePagingCubitfor infinite scrolling lists with pull-to-refresh & optimistic item deletion.FpEventTransformers.debouncefor 300ms real-time search inputs.FpEffectListenerfor single-shot UI side-effects (toasts, navigation).
- π Full Authentication Suite (
features/auth/):- Login: Email & password validation, remember me, and social buttons.
- Register: Full name, email, password strength, match verification, terms consent.
- Forgot Password: Email submission to dispatch a 6-digit recovery OTP code.
- Email Verification: 6-digit
ReactivePinCodeFieldwith a 60s countdown timer & resend. - Reset Password: OTP verification with new password configuration.
- Change Password: In-app security settings flow.
- π° Monetization & AdMob Integration (
flutter_prakash_ads):- Automated
AdManagerinitialization and GDPR/UMP consent management. - Adaptive
BannerAdView. SmartNativeAdView(Small 90px and Medium 350px templates).AdMobShowcasePagedemonstrating Interstitial, Rewarded, and Rewarded Interstitial ads with live ILRD telemetry.
- Automated
- π οΈ DevTools Floating Dock:
- Draggable in-app overlay dock (
DevtoolsFloatingDock) giving instant access to the DevTools inspector from any screen in dev mode. - Network requests,
SharedPreferences, local file storage, and ANSI logs.
- Draggable in-app overlay dock (
- π Theme & Localization:
- Dynamic system/light/dark theme switching (
ThemeCubit). - Multi-language support (
LocaleCubitwith English, Hindi, and Nepali).
- Dynamic system/light/dark theme switching (
- π Zero-Context Overlays & Universal Pages:
- Global toasts (
Toast.success,Toast.error,Toast.warning,Toast.info). - Full-screen loading overlay (
LoadingOverlay.show()/LoadingOverlay.hide()). - Media preview (
FilePreviewPagefor image zoom & PDF viewing). - In-app web browser (
InAppWebViewPagewith progress bar & action controls). - User feedback submission (
FeedbackPagewith reactive validation).
- Global toasts (
- πΊοΈ Type-Safe Navigation:
AutoRoutewith route guards (ExampleAuthGuard).- Splash screen dynamic routing based on session tokens and onboarding state.
π Getting Started #
1. Install Dependencies #
flutter pub get
2. Run Code Generation (if modifying routes, models, or DI) #
dart run build_runner build --delete-conflicting-outputs
3. Launch App (Flavours) #
# Run Development Flavour
flutter run -t lib/main_dev.dart --flavor dev --dart-define-from-file=.env.dev
# Run Production Flavour
flutter run -t lib/main_prod.dart --flavor prod --dart-define-from-file=.env.prod
π Project Architecture #
example/lib/
βββ app.dart # Root app with ThemeCubit, LocaleCubit, AuthCubit, & DevtoolsFloatingDock
βββ bootstrap.dart # Global error logger, EnterpriseBlocObserver, Ads initialization
βββ main.dart # Default entrypoint
βββ main_dev.dart # Dev flavour entrypoint
βββ main_prod.dart # Prod flavour entrypoint
βββ config/ # App-wide static configuration
β βββ constants/app_constants.dart # App versions, timeouts, storage keys
β βββ envs/ (app_env.dart, env_dev.dart, env_prod.dart, envs.dart)
β βββ themes/ (app_colors.dart, app_theme.dart)
β βββ config.dart # Barrel file
βββ core/ # Common utilities & system singletons
β βββ ads/ (ads.dart, my_ad_service.dart, cubit/ads_cubit.dart)
β βββ di/ (injection.dart, register_module.dart)
β βββ l10n/ (l10n.dart)
β βββ router/ (app_router.dart, app_router.gr.dart, guards/auth_guard.dart)
β βββ core.dart # Barrel file
βββ features/
βββ splash/ # App launch, initialization, version check
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ blocs/
β βββ pages/
β βββ widgets/
βββ onboarding/ # Intro slides, initial setup screens
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ blocs/
β βββ pages/
β βββ widgets/
βββ auth/ # Auth: login, register, forgot/reset password, email verification
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ blocs/
β βββ pages/
β βββ widgets/
βββ dashboard/ # Core app experience & main navigation hub
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ blocs/
β βββ pages/
β βββ widgets/
βββ settings/ # User preferences, app info, notification toggles
β βββ data/
β β βββ datasources/
β β βββ models/
β β βββ repositories/
β βββ presentation/
β βββ blocs/
β βββ pages/
β βββ widgets/
βββ common/ # Universal utility screens used across features
βββ data/
β βββ datasources/
β βββ models/
β βββ repositories/
βββ presentation/
βββ blocs/
βββ pages/
β βββ file_preview/
β βββ inapp_webview/
β βββ privacy_policy/
β βββ terms_and_conditions/
β βββ feedback/
βββ widgets/
π§ͺ Quality & Verification #
# Analyze Example Code
flutter analyze
# Analyze Core Engine
cd .. && flutter analyze
# Run Full Test Suite
flutter test
π License & Authors #
Crafted with β€οΈ by Prakash Bahadur Chand. Licensed under the MIT License.