create-flutterinit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.ts +3 -0
- package/package.json +46 -0
- package/templates/base/.cursor/rules/flutter-project.mdc.hbs +132 -0
- package/templates/base/AGENTS.md.hbs +137 -0
- package/templates/base/DESIGN.md.hbs +149 -0
- package/templates/base/README.md.hbs +19 -0
- package/templates/base/SETUP.md.hbs +253 -0
- package/templates/base/analysis_options.yaml +88 -0
- package/templates/base/assets/.keep +1 -0
- package/templates/base/assets/icons/apple.svg +1 -0
- package/templates/base/assets/icons/facebook.svg +1 -0
- package/templates/base/assets/icons/google.svg +1 -0
- package/templates/base/assets/images/.gitkeep +0 -0
- package/templates/base/flutter_native_splash.yaml.hbs +8 -0
- package/templates/base/lib/main.dart.hbs +43 -0
- package/templates/base/lib/src/app.dart.hbs +105 -0
- package/templates/base/lib/src/config/app_config.dart.hbs +112 -0
- package/templates/base/lib/src/extensions/collection_extension.dart.hbs +55 -0
- package/templates/base/lib/src/extensions/context_extension.dart.hbs +167 -0
- package/templates/base/lib/src/extensions/date_time_extension.dart.hbs +40 -0
- package/templates/base/lib/src/extensions/extensions.dart.hbs +6 -0
- package/templates/base/lib/src/extensions/num_extension.dart.hbs +14 -0
- package/templates/base/lib/src/extensions/string_extension.dart.hbs +91 -0
- package/templates/base/lib/src/extensions/widget_extension.dart.hbs +47 -0
- package/templates/base/lib/src/imports/core_imports.dart.hbs +50 -0
- package/templates/base/lib/src/imports/imports.dart.hbs +2 -0
- package/templates/base/lib/src/imports/packages_imports.dart.hbs +110 -0
- package/templates/base/lib/src/routing/(isGetX)@app_bindings.dart.hbs +23 -0
- package/templates/base/lib/src/routing/app_router.dart.hbs +252 -0
- package/templates/base/lib/src/routing/app_routes.dart.hbs +46 -0
- package/templates/base/lib/src/routing/global_navigator.dart.hbs +15 -0
- package/templates/base/lib/src/services/auth_service.dart.hbs +78 -0
- package/templates/base/lib/src/services/copy_service.dart.hbs +16 -0
- package/templates/base/lib/src/services/internet_connection_service.dart.hbs +10 -0
- package/templates/base/lib/src/services/services.dart.hbs +45 -0
- package/templates/base/lib/src/shared/app_assets.dart.hbs +15 -0
- package/templates/base/lib/src/shared/enums/app_status.dart.hbs +40 -0
- package/templates/base/lib/src/shared/enums/button_enums.dart.hbs +22 -0
- package/templates/base/lib/src/shared/enums/enums.dart.hbs +3 -0
- package/templates/base/lib/src/shared/enums/snack_bar_type.dart.hbs +22 -0
- package/templates/base/lib/src/shared/helpers/format_number.dart.hbs +18 -0
- package/templates/base/lib/src/shared/helpers/imports.dart.hbs +3 -0
- package/templates/base/lib/src/shared/helpers/show_app_sheet.dart.hbs +42 -0
- package/templates/base/lib/src/shared/helpers/show_dialog.dart.hbs +49 -0
- package/templates/base/lib/src/shared/helpers/show_toast.dart.hbs +92 -0
- package/templates/base/lib/src/shared/hooks/hooks.dart.hbs +13 -0
- package/templates/base/lib/src/shared/hooks/use_copy.dart.hbs +41 -0
- package/templates/base/lib/src/shared/hooks/use_timer.dart.hbs +158 -0
- package/templates/base/lib/src/shared/shared.dart.hbs +12 -0
- package/templates/base/lib/src/shared/widgets/app_button.dart.hbs +144 -0
- package/templates/base/lib/src/shared/widgets/app_card.dart.hbs +126 -0
- package/templates/base/lib/src/shared/widgets/app_divider.dart.hbs +88 -0
- package/templates/base/lib/src/shared/widgets/app_empty_state.dart.hbs +73 -0
- package/templates/base/lib/src/shared/widgets/app_error_widget.dart.hbs +69 -0
- package/templates/base/lib/src/shared/widgets/app_icon.dart.hbs +25 -0
- package/templates/base/lib/src/shared/widgets/app_loading.dart.hbs +54 -0
- package/templates/base/lib/src/shared/widgets/app_text_field.dart.hbs +89 -0
- package/templates/base/lib/src/shared/widgets/app_top_bar.dart.hbs +105 -0
- package/templates/base/lib/src/shared/widgets/common_image.dart.hbs +120 -0
- package/templates/base/lib/src/shared/widgets/toast/imports.dart.hbs +4 -0
- package/templates/base/lib/src/shared/widgets/toast/raw_toast.dart.hbs +109 -0
- package/templates/base/lib/src/shared/widgets/toast/toast.dart.hbs +142 -0
- package/templates/base/lib/src/shared/widgets/toast/toast_card.dart.hbs +57 -0
- package/templates/base/lib/src/shared/widgets/widgets.dart.hbs +14 -0
- package/templates/base/lib/src/shared/wrappers/(isRiverpod,isProvider,isBloc,isGetX,isMobX)@state_wrapper.dart.hbs +51 -0
- package/templates/base/lib/src/shared/wrappers/(supportsLocalization)@localization_wrapper.dart.hbs +25 -0
- package/templates/base/lib/src/shared/wrappers/(usesScreenutil)@screen_util_wrapper.dart.hbs +27 -0
- package/templates/base/lib/src/shared/wrappers/(usesSkeletonizer)@skeleton_wrapper.dart.hbs +81 -0
- package/templates/base/lib/src/shared/wrappers/session_listener_wrapper.dart.hbs +258 -0
- package/templates/base/lib/src/shared/wrappers/wrappers.dart.hbs +15 -0
- package/templates/base/lib/src/theme/app_borders.dart.hbs +70 -0
- package/templates/base/lib/src/theme/app_curves.dart.hbs +69 -0
- package/templates/base/lib/src/theme/app_durations.dart.hbs +48 -0
- package/templates/base/lib/src/theme/app_shadows.dart.hbs +73 -0
- package/templates/base/lib/src/theme/app_spacing.dart.hbs +80 -0
- package/templates/base/lib/src/theme/color_schemes.dart.hbs +126 -0
- package/templates/base/lib/src/theme/text_theme.dart.hbs +167 -0
- package/templates/base/lib/src/theme/theme.dart.hbs +431 -0
- package/templates/base/lib/src/theme/theme_constants.dart.hbs +20 -0
- package/templates/base/lib/src/utils/app_utils.dart.hbs +46 -0
- package/templates/base/lib/src/utils/debouncer.dart.hbs +31 -0
- package/templates/base/lib/src/utils/error_handler.dart.hbs +14 -0
- package/templates/base/lib/src/utils/failure.dart.hbs +30 -0
- package/templates/base/lib/src/utils/input_formatters.dart.hbs +27 -0
- package/templates/base/lib/src/utils/logger.dart.hbs +37 -0
- package/templates/base/lib/src/utils/platform_info.dart.hbs +13 -0
- package/templates/base/lib/src/utils/task_runner.dart.hbs +42 -0
- package/templates/base/lib/src/utils/typedefs.dart.hbs +6 -0
- package/templates/base/lib/src/utils/utils.dart.hbs +9 -0
- package/templates/base/pubspec.yaml.hbs +256 -0
- package/templates/base/test/widget_test.dart.hbs +56 -0
- package/templates/overlays/architecture/clean/architecture.md +6 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/data/models/user_model.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/data/repositories/auth_repository_impl.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/domain/entities/user.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/domain/repositories/auth_repository.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/forgot_password_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/login_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/signup_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/home/presentation/screens/home_page.dart.hbs +1 -0
- package/templates/overlays/architecture/clean/lib/src/features/onboarding/presentation/screens/onboarding_page.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/architecture.md +5 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/data/models/user_model.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/data/repositories/auth_repository_impl.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/domain/entities/user.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/domain/repositories/auth_repository.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/forgot_password_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/login_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/signup_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/home/presentation/screens/home_page.dart.hbs +1 -0
- package/templates/overlays/architecture/feature-first/lib/src/features/onboarding/presentation/screens/onboarding_page.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/architecture.md +6 -0
- package/templates/overlays/architecture/layer-first/lib/src/data/datasources/local/.gitkeep +0 -0
- package/templates/overlays/architecture/layer-first/lib/src/data/datasources/remote/.gitkeep +0 -0
- package/templates/overlays/architecture/layer-first/lib/src/data/models/user_model.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/data/repositories/auth_repository_impl.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/domain/entities/user.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/domain/repositories/auth_repository.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/domain/usecases/auth/.gitkeep +0 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isNoneState)@auth_view_model.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/forgot_password_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/login_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/signup_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/home/home_page.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/onboarding/onboarding_page.dart.hbs +1 -0
- package/templates/overlays/architecture/layer-first/lib/src/presentation/widgets/.gitkeep +0 -0
- package/templates/overlays/architecture/mvc/architecture.md +5 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isBloc)@auth_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isBloc)@session_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isGetX)@auth_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isGetX)@session_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isMobX)@auth_store.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isMobX)@session_store.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isNoneState)@session_manager.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/models/user_model.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/services/auth_repository.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/services/auth_repository_impl.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/views/auth/forgot_password_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/views/auth/login_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/views/auth/signup_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/views/home/home_page.dart.hbs +1 -0
- package/templates/overlays/architecture/mvc/lib/src/views/onboarding/onboarding_page.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/architecture.md +6 -0
- package/templates/overlays/architecture/mvvm/lib/src/data/models/user_model.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/data/repositories/auth_repository.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/data/repositories/auth_repository_impl.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isBloc)@bloc/auth_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isBloc)@bloc/session_bloc.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isGetX)@controllers/auth_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isGetX)@controllers/session_controller.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isMobX)@stores/auth_store.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isMobX)@stores/session_store.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isNoneState)@view_models/auth_view_model.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isNoneState)@view_models/session_manager.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isProvider,isRiverpod)@providers/auth_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isProvider,isRiverpod)@providers/session_provider.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/forgot_password_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/login_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/auth/signup_screen.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/home/home_page.dart.hbs +1 -0
- package/templates/overlays/architecture/mvvm/lib/src/ui/onboarding/onboarding_page.dart.hbs +1 -0
- package/templates/overlays/backend/appwrite/lib/src/services/(usesAppwriteAuth)@auth_service.dart.hbs +101 -0
- package/templates/overlays/backend/custom/lib/src/services/auth_service.dart.hbs +158 -0
- package/templates/overlays/backend/firebase/lib/src/services/(usesFirebaseAuth)@auth_service.dart.hbs +96 -0
- package/templates/overlays/backend/supabase/lib/src/services/(usesSupabaseAuth)@auth_service.dart.hbs +97 -0
- package/templates/overlays/device/app_version_update/lib/src/services/(usesAppVersionUpdate)@version_update_service.dart.hbs +118 -0
- package/templates/overlays/device/device_info/lib/src/services/(usesDeviceInfoPlus)@device_info_service.dart.hbs +54 -0
- package/templates/overlays/extras/dotenv/.env.hbs +33 -0
- package/templates/overlays/extras/flavors/lib/src/flavors.dart.hbs +15 -0
- package/templates/overlays/extras/localization/assets/translations/en.json.hbs +47 -0
- package/templates/overlays/media/lib/src/services/(usesImagePicker,usesFilePicker)@media_service.dart.hbs +148 -0
- package/templates/overlays/networking/cached_image/lib/src/shared/widgets/app_cached_image.dart.hbs +160 -0
- package/templates/overlays/networking/dio/lib/src/services/(usesDio)@dio_service.dart.hbs +50 -0
- package/templates/overlays/networking/http/lib/src/services/(usesHttp)@http_service.dart.hbs +82 -0
- package/templates/overlays/storage/hive/lib/src/services/(usesHive)@hive_service.dart.hbs +59 -0
- package/templates/overlays/storage/secure_storage/lib/src/services/(usesSecureStorage)@secure_storage_service.dart.hbs +39 -0
- package/templates/overlays/storage/shared_preferences/lib/src/services/(usesSharedPreferences)@storage_service.dart.hbs +53 -0
- package/templates/overlays/utilities/geolocator/lib/src/services/(usesGeolocator)@location_service.dart.hbs +78 -0
- package/templates/overlays/utilities/path_provider/lib/src/services/(usesPathProvider)@path_service.dart.hbs +30 -0
- package/templates/overlays/utilities/permission_handler/lib/src/services/(usesPermissionHandler)@permission_service.dart.hbs +28 -0
- package/templates/overlays/utilities/permission_handler/lib/src/shared/hooks/use_permission.dart.hbs +44 -0
- package/templates/overlays/utilities/share_plus/lib/src/services/(usesSharePlus)@share_service.dart.hbs +22 -0
- package/templates/overlays/utilities/share_plus/lib/src/shared/hooks/use_share.dart.hbs +26 -0
- package/templates/overlays/utilities/url_launcher/lib/src/services/(usesUrlLauncher)@url_launcher_service.dart.hbs +37 -0
- package/templates/overlays/utilities/url_launcher/lib/src/shared/hooks/use_launch_url.dart.hbs +52 -0
- package/templates/partials/features/auth/auth_logic.hbs +611 -0
- package/templates/partials/features/auth/auth_repository.hbs +32 -0
- package/templates/partials/features/auth/auth_repository_impl.hbs +116 -0
- package/templates/partials/features/auth/forgot_password_screen.hbs +368 -0
- package/templates/partials/features/auth/login_screen.hbs +540 -0
- package/templates/partials/features/auth/session_provider.hbs +437 -0
- package/templates/partials/features/auth/signup_screen.hbs +511 -0
- package/templates/partials/features/auth/user_model.hbs +23 -0
- package/templates/partials/features/home/home_page.hbs +156 -0
- package/templates/partials/features/onboarding/onboarding_page.hbs +264 -0
- package/templates/partials/llm/add-feature-workflow.hbs +38 -0
- package/templates/partials/llm/architecture-rules.hbs +92 -0
- package/templates/partials/llm/backend-rules.hbs +30 -0
- package/templates/partials/llm/build-runner-note.hbs +15 -0
- package/templates/partials/llm/design-quick-ref.hbs +14 -0
- package/templates/partials/llm/design-quick-reference.hbs +14 -0
- package/templates/partials/llm/navigation-rules.hbs +27 -0
- package/templates/partials/llm/networking-rules.hbs +16 -0
- package/templates/partials/llm/packages-list.hbs +26 -0
- package/templates/partials/llm/services-conventions.hbs +20 -0
- package/templates/partials/llm/stack-summary.hbs +22 -0
- package/templates/partials/llm/state-management-rules.hbs +40 -0
- package/templates/partials/state_label.hbs +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import '../../../imports/imports.dart';
|
|
2
|
+
|
|
3
|
+
class RawToast extends StatefulWidget {
|
|
4
|
+
final Widget child;
|
|
5
|
+
final Duration animationDuration;
|
|
6
|
+
final Duration snackbarDuration;
|
|
7
|
+
final Curve? animationCurve;
|
|
8
|
+
final bool autoDismiss;
|
|
9
|
+
final ToastPosition toastPosition;
|
|
10
|
+
final double Function() getscaleFactor;
|
|
11
|
+
final double Function() getPosition;
|
|
12
|
+
final void Function() onRemove;
|
|
13
|
+
|
|
14
|
+
const RawToast({
|
|
15
|
+
super.key,
|
|
16
|
+
required this.child,
|
|
17
|
+
required this.animationDuration,
|
|
18
|
+
required this.toastPosition,
|
|
19
|
+
required this.snackbarDuration,
|
|
20
|
+
required this.onRemove,
|
|
21
|
+
this.autoDismiss = true,
|
|
22
|
+
required this.getPosition,
|
|
23
|
+
this.animationCurve,
|
|
24
|
+
required this.getscaleFactor,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
@override
|
|
28
|
+
State<RawToast> createState() => RawToastState();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
class RawToastState extends State<RawToast> {
|
|
32
|
+
final GlobalKey positionedKey = GlobalKey();
|
|
33
|
+
|
|
34
|
+
Widget getChildBasedOnDismiss(Widget child) {
|
|
35
|
+
return Animate(
|
|
36
|
+
onComplete: (controller) {
|
|
37
|
+
if (widget.autoDismiss) {
|
|
38
|
+
widget.onRemove();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
effects: [
|
|
42
|
+
SlideEffect(
|
|
43
|
+
begin: Offset(
|
|
44
|
+
0,
|
|
45
|
+
widget.toastPosition == ToastPosition.bottom ? 2 : -2,
|
|
46
|
+
),
|
|
47
|
+
end: Offset.zero,
|
|
48
|
+
duration: Duration(
|
|
49
|
+
milliseconds: 2 * widget.animationDuration.inMilliseconds,
|
|
50
|
+
),
|
|
51
|
+
curve: widget.animationCurve ?? Curves.elasticOut,
|
|
52
|
+
),
|
|
53
|
+
FadeEffect(
|
|
54
|
+
duration: widget.animationDuration,
|
|
55
|
+
begin: 0,
|
|
56
|
+
end: 1,
|
|
57
|
+
),
|
|
58
|
+
if (widget.autoDismiss)
|
|
59
|
+
SlideEffect(
|
|
60
|
+
delay: widget.snackbarDuration,
|
|
61
|
+
duration: const Duration(milliseconds: 500),
|
|
62
|
+
curve: widget.animationCurve ?? Curves.easeInOut,
|
|
63
|
+
begin: Offset.zero,
|
|
64
|
+
end: Offset(
|
|
65
|
+
0,
|
|
66
|
+
widget.toastPosition == ToastPosition.bottom ? 2 : -2,
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
],
|
|
70
|
+
child: Dismissible(
|
|
71
|
+
key: UniqueKey(),
|
|
72
|
+
direction: DismissDirection.up,
|
|
73
|
+
onDismissed: (direction) {
|
|
74
|
+
widget.onRemove();
|
|
75
|
+
},
|
|
76
|
+
child: widget.child,
|
|
77
|
+
),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@override
|
|
82
|
+
Widget build(BuildContext context) {
|
|
83
|
+
return AnimatedPositioned(
|
|
84
|
+
duration: Duration(
|
|
85
|
+
milliseconds: widget.animationDuration.inMilliseconds,
|
|
86
|
+
),
|
|
87
|
+
key: positionedKey,
|
|
88
|
+
curve: Curves.easeOutBack,
|
|
89
|
+
top: widget.toastPosition == ToastPosition.top
|
|
90
|
+
? widget.getPosition() + 55
|
|
91
|
+
: null,
|
|
92
|
+
bottom: widget.toastPosition == ToastPosition.bottom
|
|
93
|
+
? widget.getPosition() + 60
|
|
94
|
+
: null,
|
|
95
|
+
left: 0,
|
|
96
|
+
right: 0,
|
|
97
|
+
child: Material(
|
|
98
|
+
color: Colors.transparent,
|
|
99
|
+
child: AnimatedScale(
|
|
100
|
+
duration: widget.animationDuration,
|
|
101
|
+
curve: Curves.bounceOut,
|
|
102
|
+
scale: widget.getPosition() == 0 ? 1 : widget.getscaleFactor(),
|
|
103
|
+
child: getChildBasedOnDismiss(widget.child),
|
|
104
|
+
),
|
|
105
|
+
),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import '../../../imports/imports.dart';
|
|
2
|
+
|
|
3
|
+
/// Enum for toast positions.
|
|
4
|
+
enum ToastPosition { top, bottom }
|
|
5
|
+
|
|
6
|
+
/// The gap between stack of cards.
|
|
7
|
+
int gapBetweenCard = 15;
|
|
8
|
+
|
|
9
|
+
/// Calculate position of old cards based on current position.
|
|
10
|
+
double calculatePosition(List<ToastBar> toastBars, ToastBar self) {
|
|
11
|
+
if (toastBars.isNotEmpty && self != toastBars.last) {
|
|
12
|
+
final box =
|
|
13
|
+
self.info.key.currentContext?.findRenderObject() as RenderBox?;
|
|
14
|
+
if (box != null) {
|
|
15
|
+
return gapBetweenCard * (toastBars.length - toastBars.indexOf(self) - 1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// Rescale the old cards based on its position.
|
|
22
|
+
double calculateScaleFactor(List<ToastBar> toastBars, ToastBar current) {
|
|
23
|
+
final int index = toastBars.indexOf(current);
|
|
24
|
+
final int indexValFromLast = toastBars.length - 1 - index;
|
|
25
|
+
final double factor = indexValFromLast / 25;
|
|
26
|
+
final double res = 0.97 - factor;
|
|
27
|
+
return res < 0 ? 0 : res;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
List<ToastBar> _toastBars = [];
|
|
31
|
+
|
|
32
|
+
/// Toast core class.
|
|
33
|
+
class ToastBar {
|
|
34
|
+
/// Duration of toast when autoDismiss is true.
|
|
35
|
+
final Duration toastDuration;
|
|
36
|
+
|
|
37
|
+
/// Position of toast.
|
|
38
|
+
final ToastPosition position;
|
|
39
|
+
|
|
40
|
+
/// Set true to dismiss toast automatically based on toastDuration.
|
|
41
|
+
final bool autoDismiss;
|
|
42
|
+
|
|
43
|
+
/// Pass the widget inside builder context.
|
|
44
|
+
final WidgetBuilder builder;
|
|
45
|
+
|
|
46
|
+
/// Duration of animated transitions.
|
|
47
|
+
final Duration animationDuration;
|
|
48
|
+
|
|
49
|
+
/// Animation Curve.
|
|
50
|
+
final Curve? animationCurve;
|
|
51
|
+
|
|
52
|
+
/// Info on each toast.
|
|
53
|
+
late final SnackBarInfo info;
|
|
54
|
+
|
|
55
|
+
/// Initialise ToastBar with required parameters.
|
|
56
|
+
ToastBar({
|
|
57
|
+
this.toastDuration = const Duration(milliseconds: 5000),
|
|
58
|
+
this.position = ToastPosition.bottom,
|
|
59
|
+
required this.builder,
|
|
60
|
+
this.animationDuration = const Duration(milliseconds: 700),
|
|
61
|
+
this.autoDismiss = false,
|
|
62
|
+
this.animationCurve,
|
|
63
|
+
}) : assert(
|
|
64
|
+
toastDuration.inMilliseconds > animationDuration.inMilliseconds,
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
/// Remove individual toastBars on dismiss.
|
|
68
|
+
void remove() {
|
|
69
|
+
info.entry.remove();
|
|
70
|
+
_toastBars.removeWhere((element) => element == this);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/// Push the toast in current context.
|
|
74
|
+
void show(BuildContext context) {
|
|
75
|
+
final OverlayState overlayState = Navigator.of(context).overlay!;
|
|
76
|
+
info = SnackBarInfo(
|
|
77
|
+
key: GlobalKey<RawToastState>(),
|
|
78
|
+
createdAt: DateTime.now(),
|
|
79
|
+
);
|
|
80
|
+
info.entry = OverlayEntry(
|
|
81
|
+
builder: (_) => RawToast(
|
|
82
|
+
key: info.key,
|
|
83
|
+
animationDuration: animationDuration,
|
|
84
|
+
toastPosition: position,
|
|
85
|
+
animationCurve: animationCurve,
|
|
86
|
+
autoDismiss: autoDismiss,
|
|
87
|
+
getPosition: () => calculatePosition(_toastBars, this),
|
|
88
|
+
getscaleFactor: () => calculateScaleFactor(_toastBars, this),
|
|
89
|
+
snackbarDuration: toastDuration,
|
|
90
|
+
onRemove: remove,
|
|
91
|
+
child: builder.call(context),
|
|
92
|
+
),
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
_toastBars.add(this);
|
|
96
|
+
overlayState.insert(info.entry);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/// Remove all the toasts in the context.
|
|
100
|
+
static void removeAll() {
|
|
101
|
+
for (int i = 0; i < _toastBars.length; i++) {
|
|
102
|
+
_toastBars[i].info.entry.remove();
|
|
103
|
+
}
|
|
104
|
+
_toastBars.removeWhere((element) => true);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// Snackbar info class.
|
|
109
|
+
class SnackBarInfo {
|
|
110
|
+
late final OverlayEntry entry;
|
|
111
|
+
final GlobalKey<RawToastState> key;
|
|
112
|
+
final DateTime createdAt;
|
|
113
|
+
|
|
114
|
+
SnackBarInfo({
|
|
115
|
+
required this.key,
|
|
116
|
+
required this.createdAt,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
@override
|
|
120
|
+
bool operator ==(Object other) {
|
|
121
|
+
if (identical(this, other)) return true;
|
|
122
|
+
|
|
123
|
+
return other is SnackBarInfo &&
|
|
124
|
+
other.entry == entry &&
|
|
125
|
+
other.key == key &&
|
|
126
|
+
other.createdAt == createdAt;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@override
|
|
130
|
+
int get hashCode => entry.hashCode ^ key.hashCode ^ createdAt.hashCode;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// Get all the toastBars which are currently on context.
|
|
134
|
+
extension Cleaner on List<ToastBar> {
|
|
135
|
+
/// Clean function to iterate over toastBars which are in context.
|
|
136
|
+
List<ToastBar> clean() {
|
|
137
|
+
return where(
|
|
138
|
+
(element) => element.info.key.currentState != null,
|
|
139
|
+
).toList();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import '../../../imports/imports.dart';
|
|
2
|
+
|
|
3
|
+
/// ToastCard widget to display decent and rich looking toast.
|
|
4
|
+
class ToastCard extends StatelessWidget {
|
|
5
|
+
final Widget title;
|
|
6
|
+
final Widget? subtitle;
|
|
7
|
+
final Widget? leading;
|
|
8
|
+
final Widget? trailing;
|
|
9
|
+
final Color? color;
|
|
10
|
+
final Color? shadowColor;
|
|
11
|
+
final void Function()? onTap;
|
|
12
|
+
|
|
13
|
+
const ToastCard({
|
|
14
|
+
super.key,
|
|
15
|
+
required this.title,
|
|
16
|
+
this.subtitle,
|
|
17
|
+
this.leading,
|
|
18
|
+
this.color,
|
|
19
|
+
this.shadowColor,
|
|
20
|
+
this.trailing,
|
|
21
|
+
this.onTap,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
@override
|
|
25
|
+
Widget build(BuildContext context) {
|
|
26
|
+
return Container(
|
|
27
|
+
margin: const EdgeInsets.symmetric(horizontal: 20),
|
|
28
|
+
decoration: BoxDecoration(
|
|
29
|
+
color: color ?? context.theme.dialogTheme.backgroundColor,
|
|
30
|
+
borderRadius: BorderRadius.circular(16),
|
|
31
|
+
border: Border.all(
|
|
32
|
+
color: context.theme.colorScheme.outline,
|
|
33
|
+
),
|
|
34
|
+
boxShadow: [
|
|
35
|
+
BoxShadow(
|
|
36
|
+
blurRadius: 10,
|
|
37
|
+
spreadRadius: 0,
|
|
38
|
+
offset: Offset.zero,
|
|
39
|
+
color: shadowColor ?? Colors.black.withValues(alpha: 0.05),
|
|
40
|
+
),
|
|
41
|
+
],
|
|
42
|
+
),
|
|
43
|
+
child: ListTile(
|
|
44
|
+
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
|
|
45
|
+
leading: Padding(
|
|
46
|
+
padding: const EdgeInsets.only(left: 10),
|
|
47
|
+
child: leading,
|
|
48
|
+
),
|
|
49
|
+
trailing: trailing,
|
|
50
|
+
subtitle: subtitle,
|
|
51
|
+
title: title,
|
|
52
|
+
onTap: onTap,
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export 'app_icon.dart';
|
|
2
|
+
export 'app_button.dart';
|
|
3
|
+
export 'app_text_field.dart';
|
|
4
|
+
export 'app_loading.dart';
|
|
5
|
+
export 'app_error_widget.dart';
|
|
6
|
+
export 'app_empty_state.dart';
|
|
7
|
+
export 'app_card.dart';
|
|
8
|
+
export 'app_divider.dart';
|
|
9
|
+
export 'app_top_bar.dart';
|
|
10
|
+
export 'common_image.dart';
|
|
11
|
+
export 'toast/imports.dart';
|
|
12
|
+
{{#if flags.usesCachedNetworkImage}}
|
|
13
|
+
export 'app_cached_image.dart';
|
|
14
|
+
{{/if}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import '../../imports/imports.dart';
|
|
2
|
+
{{#if flags.isBloc}}
|
|
3
|
+
import '../../{{#if (eq architecture "layer-first")}}data/repositories/{{else if (eq architecture "mvc")}}services/{{else if (eq architecture "mvvm")}}data/repositories/{{else}}features/auth/data/repositories/{{/if}}auth_repository_impl.dart';
|
|
4
|
+
import '../../{{#if (eq architecture "layer-first")}}presentation/providers/session_bloc.dart{{else if (eq architecture "mvc")}}controllers/auth/session_bloc.dart{{else if (eq architecture "mvvm")}}ui/auth/bloc/session_bloc.dart{{else}}features/auth/presentation/providers/session_bloc.dart{{/if}}';
|
|
5
|
+
{{else if flags.isProvider}}
|
|
6
|
+
import '../../{{#if (eq architecture "layer-first")}}data/repositories/{{else if (eq architecture "mvc")}}services/{{else if (eq architecture "mvvm")}}data/repositories/{{else}}features/auth/data/repositories/{{/if}}auth_repository_impl.dart';
|
|
7
|
+
import '../../{{#if (eq architecture "layer-first")}}presentation/providers/session_provider.dart{{else if (eq architecture "mvc")}}controllers/auth/session_provider.dart{{else if (eq architecture "mvvm")}}ui/auth/providers/session_provider.dart{{else}}features/auth/presentation/providers/session_provider.dart{{/if}}';
|
|
8
|
+
{{else if flags.isMobX}}
|
|
9
|
+
import '../../{{#if (eq architecture "layer-first")}}data/repositories/{{else if (eq architecture "mvc")}}services/{{else if (eq architecture "mvvm")}}data/repositories/{{else}}features/auth/data/repositories/{{/if}}auth_repository_impl.dart';
|
|
10
|
+
import '../../{{#if (eq architecture "layer-first")}}presentation/providers/session_store.dart{{else if (eq architecture "mvc")}}controllers/auth/session_store.dart{{else if (eq architecture "mvvm")}}ui/auth/stores/session_store.dart{{else}}features/auth/presentation/providers/session_store.dart{{/if}}';
|
|
11
|
+
{{/if}}
|
|
12
|
+
|
|
13
|
+
/// A wrapper to initialize the chosen State Management library.
|
|
14
|
+
class StateWrapper extends StatelessWidget {
|
|
15
|
+
final Widget child;
|
|
16
|
+
|
|
17
|
+
const StateWrapper({
|
|
18
|
+
super.key,
|
|
19
|
+
required this.child,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
@override
|
|
23
|
+
Widget build(BuildContext context) {
|
|
24
|
+
{{#if flags.isRiverpod}}
|
|
25
|
+
return ProviderScope(child: child);
|
|
26
|
+
{{else if flags.isProvider}}
|
|
27
|
+
return MultiProvider(
|
|
28
|
+
providers: [
|
|
29
|
+
ChangeNotifierProvider<SessionProvider>(create: (_) => SessionProvider(repository: AuthRepositoryImpl())),
|
|
30
|
+
],
|
|
31
|
+
child: child,
|
|
32
|
+
);
|
|
33
|
+
{{else if flags.isBloc}}
|
|
34
|
+
return MultiBlocProvider(
|
|
35
|
+
providers: [
|
|
36
|
+
BlocProvider<SessionBloc>(create: (_) => SessionBloc(repository: AuthRepositoryImpl())),
|
|
37
|
+
],
|
|
38
|
+
child: child,
|
|
39
|
+
);
|
|
40
|
+
{{else if flags.isMobX}}
|
|
41
|
+
return MultiProvider(
|
|
42
|
+
providers: [
|
|
43
|
+
Provider<SessionStore>(create: (_) => SessionStore(repository: AuthRepositoryImpl())),
|
|
44
|
+
],
|
|
45
|
+
child: child,
|
|
46
|
+
);
|
|
47
|
+
{{else}}
|
|
48
|
+
return child;
|
|
49
|
+
{{/if}}
|
|
50
|
+
}
|
|
51
|
+
}
|
package/templates/base/lib/src/shared/wrappers/(supportsLocalization)@localization_wrapper.dart.hbs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '../../imports/core_imports.dart';
|
|
2
|
+
|
|
3
|
+
/// A wrapper to initialize [EasyLocalization] with supported locales.
|
|
4
|
+
class LocalizationWrapper extends StatelessWidget {
|
|
5
|
+
final Widget child;
|
|
6
|
+
|
|
7
|
+
const LocalizationWrapper({
|
|
8
|
+
super.key,
|
|
9
|
+
required this.child,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
@override
|
|
13
|
+
Widget build(BuildContext context) {
|
|
14
|
+
return EasyLocalization(
|
|
15
|
+
supportedLocales: const [
|
|
16
|
+
{{#each flags.supportedLocales}}
|
|
17
|
+
Locale('{{this}}'),
|
|
18
|
+
{{/each}}
|
|
19
|
+
],
|
|
20
|
+
path: 'assets/translations',
|
|
21
|
+
fallbackLocale: const Locale('{{flags.fallbackLocale}}'),
|
|
22
|
+
child: child,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import '../../imports/imports.dart';
|
|
2
|
+
|
|
3
|
+
/// A wrapper to initialize [ScreenUtil] with design-specific constraints.
|
|
4
|
+
class ScreenUtilWrapper extends StatelessWidget {
|
|
5
|
+
final Widget child;
|
|
6
|
+
final Size designSize;
|
|
7
|
+
final bool minTextAdapt;
|
|
8
|
+
final bool splitScreenMode;
|
|
9
|
+
|
|
10
|
+
const ScreenUtilWrapper({
|
|
11
|
+
super.key,
|
|
12
|
+
required this.child,
|
|
13
|
+
this.designSize = const Size(360, 690),
|
|
14
|
+
this.minTextAdapt = true,
|
|
15
|
+
this.splitScreenMode = true,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
@override
|
|
19
|
+
Widget build(BuildContext context) {
|
|
20
|
+
return ScreenUtilInit(
|
|
21
|
+
designSize: designSize,
|
|
22
|
+
minTextAdapt: minTextAdapt,
|
|
23
|
+
splitScreenMode: splitScreenMode,
|
|
24
|
+
builder: (context, _) => child,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import '../../imports/imports.dart';
|
|
2
|
+
|
|
3
|
+
/// A wrapper widget that provides skeleton loading effects.
|
|
4
|
+
///
|
|
5
|
+
/// Uses [Skeletonizer] if enabled.
|
|
6
|
+
class SkeletonWrapper extends StatelessWidget {
|
|
7
|
+
final Widget child;
|
|
8
|
+
final bool isLoading;
|
|
9
|
+
final bool enabled;
|
|
10
|
+
|
|
11
|
+
/// Custom skeleton effect (e.g., ShimmerEffect, PulseEffect)
|
|
12
|
+
final ShimmerEffect? effect;
|
|
13
|
+
|
|
14
|
+
/// Whether to animate the transition between skeleton and content
|
|
15
|
+
final bool enableSwitchAnimation;
|
|
16
|
+
|
|
17
|
+
/// Configuration for the switch animation
|
|
18
|
+
final SwitchAnimationConfig? switchAnimationConfig;
|
|
19
|
+
|
|
20
|
+
/// Whether to justify multi-line text bones
|
|
21
|
+
final bool? justifyMultiLineText;
|
|
22
|
+
|
|
23
|
+
/// Whether to ignore all containers and only skeletonize their children
|
|
24
|
+
final bool ignoreContainers;
|
|
25
|
+
|
|
26
|
+
/// If provided, all containers will be painted with this color
|
|
27
|
+
final Color? containersColor;
|
|
28
|
+
|
|
29
|
+
/// The border radius of the text bones
|
|
30
|
+
final TextBoneBorderRadius? textBoneBorderRadius;
|
|
31
|
+
|
|
32
|
+
/// Whether to ignore pointers when loading
|
|
33
|
+
final bool ignorePointers;
|
|
34
|
+
|
|
35
|
+
const SkeletonWrapper({
|
|
36
|
+
super.key,
|
|
37
|
+
required this.child,
|
|
38
|
+
this.isLoading = false,
|
|
39
|
+
this.enabled = true,
|
|
40
|
+
this.effect,
|
|
41
|
+
this.enableSwitchAnimation = false,
|
|
42
|
+
this.switchAnimationConfig,
|
|
43
|
+
this.justifyMultiLineText,
|
|
44
|
+
this.ignoreContainers = false,
|
|
45
|
+
this.containersColor,
|
|
46
|
+
this.textBoneBorderRadius,
|
|
47
|
+
this.ignorePointers = true,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
@override
|
|
51
|
+
Widget build(BuildContext context) {
|
|
52
|
+
if (!enabled) return child;
|
|
53
|
+
|
|
54
|
+
{{#if flags.usesSkeletonizer}}
|
|
55
|
+
return Skeletonizer(
|
|
56
|
+
enabled: isLoading,
|
|
57
|
+
effect: effect,
|
|
58
|
+
enableSwitchAnimation: enableSwitchAnimation,
|
|
59
|
+
switchAnimationConfig: switchAnimationConfig,
|
|
60
|
+
justifyMultiLineText: justifyMultiLineText,
|
|
61
|
+
ignoreContainers: ignoreContainers,
|
|
62
|
+
containersColor: containersColor,
|
|
63
|
+
textBoneBorderRadius: textBoneBorderRadius,
|
|
64
|
+
ignorePointers: ignorePointers,
|
|
65
|
+
child: child,
|
|
66
|
+
);
|
|
67
|
+
{{else}}
|
|
68
|
+
if (isLoading) {
|
|
69
|
+
// Simple fallback for loading state if skeletonizer is not enabled
|
|
70
|
+
return AbsorbPointer(
|
|
71
|
+
absorbing: ignorePointers,
|
|
72
|
+
child: Opacity(
|
|
73
|
+
opacity: 0.5,
|
|
74
|
+
child: child,
|
|
75
|
+
),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
return child;
|
|
79
|
+
{{/if}}
|
|
80
|
+
}
|
|
81
|
+
}
|