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.
Files changed (237) hide show
  1. package/bin/index.ts +3 -0
  2. package/package.json +46 -0
  3. package/templates/base/.cursor/rules/flutter-project.mdc.hbs +132 -0
  4. package/templates/base/AGENTS.md.hbs +137 -0
  5. package/templates/base/DESIGN.md.hbs +149 -0
  6. package/templates/base/README.md.hbs +19 -0
  7. package/templates/base/SETUP.md.hbs +253 -0
  8. package/templates/base/analysis_options.yaml +88 -0
  9. package/templates/base/assets/.keep +1 -0
  10. package/templates/base/assets/icons/apple.svg +1 -0
  11. package/templates/base/assets/icons/facebook.svg +1 -0
  12. package/templates/base/assets/icons/google.svg +1 -0
  13. package/templates/base/assets/images/.gitkeep +0 -0
  14. package/templates/base/flutter_native_splash.yaml.hbs +8 -0
  15. package/templates/base/lib/main.dart.hbs +43 -0
  16. package/templates/base/lib/src/app.dart.hbs +105 -0
  17. package/templates/base/lib/src/config/app_config.dart.hbs +112 -0
  18. package/templates/base/lib/src/extensions/collection_extension.dart.hbs +55 -0
  19. package/templates/base/lib/src/extensions/context_extension.dart.hbs +167 -0
  20. package/templates/base/lib/src/extensions/date_time_extension.dart.hbs +40 -0
  21. package/templates/base/lib/src/extensions/extensions.dart.hbs +6 -0
  22. package/templates/base/lib/src/extensions/num_extension.dart.hbs +14 -0
  23. package/templates/base/lib/src/extensions/string_extension.dart.hbs +91 -0
  24. package/templates/base/lib/src/extensions/widget_extension.dart.hbs +47 -0
  25. package/templates/base/lib/src/imports/core_imports.dart.hbs +50 -0
  26. package/templates/base/lib/src/imports/imports.dart.hbs +2 -0
  27. package/templates/base/lib/src/imports/packages_imports.dart.hbs +110 -0
  28. package/templates/base/lib/src/routing/(isGetX)@app_bindings.dart.hbs +23 -0
  29. package/templates/base/lib/src/routing/app_router.dart.hbs +252 -0
  30. package/templates/base/lib/src/routing/app_routes.dart.hbs +46 -0
  31. package/templates/base/lib/src/routing/global_navigator.dart.hbs +15 -0
  32. package/templates/base/lib/src/services/auth_service.dart.hbs +78 -0
  33. package/templates/base/lib/src/services/copy_service.dart.hbs +16 -0
  34. package/templates/base/lib/src/services/internet_connection_service.dart.hbs +10 -0
  35. package/templates/base/lib/src/services/services.dart.hbs +45 -0
  36. package/templates/base/lib/src/shared/app_assets.dart.hbs +15 -0
  37. package/templates/base/lib/src/shared/enums/app_status.dart.hbs +40 -0
  38. package/templates/base/lib/src/shared/enums/button_enums.dart.hbs +22 -0
  39. package/templates/base/lib/src/shared/enums/enums.dart.hbs +3 -0
  40. package/templates/base/lib/src/shared/enums/snack_bar_type.dart.hbs +22 -0
  41. package/templates/base/lib/src/shared/helpers/format_number.dart.hbs +18 -0
  42. package/templates/base/lib/src/shared/helpers/imports.dart.hbs +3 -0
  43. package/templates/base/lib/src/shared/helpers/show_app_sheet.dart.hbs +42 -0
  44. package/templates/base/lib/src/shared/helpers/show_dialog.dart.hbs +49 -0
  45. package/templates/base/lib/src/shared/helpers/show_toast.dart.hbs +92 -0
  46. package/templates/base/lib/src/shared/hooks/hooks.dart.hbs +13 -0
  47. package/templates/base/lib/src/shared/hooks/use_copy.dart.hbs +41 -0
  48. package/templates/base/lib/src/shared/hooks/use_timer.dart.hbs +158 -0
  49. package/templates/base/lib/src/shared/shared.dart.hbs +12 -0
  50. package/templates/base/lib/src/shared/widgets/app_button.dart.hbs +144 -0
  51. package/templates/base/lib/src/shared/widgets/app_card.dart.hbs +126 -0
  52. package/templates/base/lib/src/shared/widgets/app_divider.dart.hbs +88 -0
  53. package/templates/base/lib/src/shared/widgets/app_empty_state.dart.hbs +73 -0
  54. package/templates/base/lib/src/shared/widgets/app_error_widget.dart.hbs +69 -0
  55. package/templates/base/lib/src/shared/widgets/app_icon.dart.hbs +25 -0
  56. package/templates/base/lib/src/shared/widgets/app_loading.dart.hbs +54 -0
  57. package/templates/base/lib/src/shared/widgets/app_text_field.dart.hbs +89 -0
  58. package/templates/base/lib/src/shared/widgets/app_top_bar.dart.hbs +105 -0
  59. package/templates/base/lib/src/shared/widgets/common_image.dart.hbs +120 -0
  60. package/templates/base/lib/src/shared/widgets/toast/imports.dart.hbs +4 -0
  61. package/templates/base/lib/src/shared/widgets/toast/raw_toast.dart.hbs +109 -0
  62. package/templates/base/lib/src/shared/widgets/toast/toast.dart.hbs +142 -0
  63. package/templates/base/lib/src/shared/widgets/toast/toast_card.dart.hbs +57 -0
  64. package/templates/base/lib/src/shared/widgets/widgets.dart.hbs +14 -0
  65. package/templates/base/lib/src/shared/wrappers/(isRiverpod,isProvider,isBloc,isGetX,isMobX)@state_wrapper.dart.hbs +51 -0
  66. package/templates/base/lib/src/shared/wrappers/(supportsLocalization)@localization_wrapper.dart.hbs +25 -0
  67. package/templates/base/lib/src/shared/wrappers/(usesScreenutil)@screen_util_wrapper.dart.hbs +27 -0
  68. package/templates/base/lib/src/shared/wrappers/(usesSkeletonizer)@skeleton_wrapper.dart.hbs +81 -0
  69. package/templates/base/lib/src/shared/wrappers/session_listener_wrapper.dart.hbs +258 -0
  70. package/templates/base/lib/src/shared/wrappers/wrappers.dart.hbs +15 -0
  71. package/templates/base/lib/src/theme/app_borders.dart.hbs +70 -0
  72. package/templates/base/lib/src/theme/app_curves.dart.hbs +69 -0
  73. package/templates/base/lib/src/theme/app_durations.dart.hbs +48 -0
  74. package/templates/base/lib/src/theme/app_shadows.dart.hbs +73 -0
  75. package/templates/base/lib/src/theme/app_spacing.dart.hbs +80 -0
  76. package/templates/base/lib/src/theme/color_schemes.dart.hbs +126 -0
  77. package/templates/base/lib/src/theme/text_theme.dart.hbs +167 -0
  78. package/templates/base/lib/src/theme/theme.dart.hbs +431 -0
  79. package/templates/base/lib/src/theme/theme_constants.dart.hbs +20 -0
  80. package/templates/base/lib/src/utils/app_utils.dart.hbs +46 -0
  81. package/templates/base/lib/src/utils/debouncer.dart.hbs +31 -0
  82. package/templates/base/lib/src/utils/error_handler.dart.hbs +14 -0
  83. package/templates/base/lib/src/utils/failure.dart.hbs +30 -0
  84. package/templates/base/lib/src/utils/input_formatters.dart.hbs +27 -0
  85. package/templates/base/lib/src/utils/logger.dart.hbs +37 -0
  86. package/templates/base/lib/src/utils/platform_info.dart.hbs +13 -0
  87. package/templates/base/lib/src/utils/task_runner.dart.hbs +42 -0
  88. package/templates/base/lib/src/utils/typedefs.dart.hbs +6 -0
  89. package/templates/base/lib/src/utils/utils.dart.hbs +9 -0
  90. package/templates/base/pubspec.yaml.hbs +256 -0
  91. package/templates/base/test/widget_test.dart.hbs +56 -0
  92. package/templates/overlays/architecture/clean/architecture.md +6 -0
  93. package/templates/overlays/architecture/clean/lib/src/features/auth/data/models/user_model.dart.hbs +1 -0
  94. package/templates/overlays/architecture/clean/lib/src/features/auth/data/repositories/auth_repository_impl.dart.hbs +1 -0
  95. package/templates/overlays/architecture/clean/lib/src/features/auth/domain/entities/user.dart.hbs +1 -0
  96. package/templates/overlays/architecture/clean/lib/src/features/auth/domain/repositories/auth_repository.dart.hbs +1 -0
  97. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
  98. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
  99. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
  100. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
  101. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
  102. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
  103. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
  104. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
  105. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
  106. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/forgot_password_screen.dart.hbs +1 -0
  107. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/login_screen.dart.hbs +1 -0
  108. package/templates/overlays/architecture/clean/lib/src/features/auth/presentation/screens/signup_screen.dart.hbs +1 -0
  109. package/templates/overlays/architecture/clean/lib/src/features/home/presentation/screens/home_page.dart.hbs +1 -0
  110. package/templates/overlays/architecture/clean/lib/src/features/onboarding/presentation/screens/onboarding_page.dart.hbs +1 -0
  111. package/templates/overlays/architecture/feature-first/architecture.md +5 -0
  112. package/templates/overlays/architecture/feature-first/lib/src/features/auth/data/models/user_model.dart.hbs +1 -0
  113. package/templates/overlays/architecture/feature-first/lib/src/features/auth/data/repositories/auth_repository_impl.dart.hbs +1 -0
  114. package/templates/overlays/architecture/feature-first/lib/src/features/auth/domain/entities/user.dart.hbs +1 -0
  115. package/templates/overlays/architecture/feature-first/lib/src/features/auth/domain/repositories/auth_repository.dart.hbs +1 -0
  116. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
  117. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
  118. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
  119. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
  120. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
  121. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
  122. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
  123. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
  124. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
  125. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/forgot_password_screen.dart.hbs +1 -0
  126. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/login_screen.dart.hbs +1 -0
  127. package/templates/overlays/architecture/feature-first/lib/src/features/auth/presentation/screens/signup_screen.dart.hbs +1 -0
  128. package/templates/overlays/architecture/feature-first/lib/src/features/home/presentation/screens/home_page.dart.hbs +1 -0
  129. package/templates/overlays/architecture/feature-first/lib/src/features/onboarding/presentation/screens/onboarding_page.dart.hbs +1 -0
  130. package/templates/overlays/architecture/layer-first/architecture.md +6 -0
  131. package/templates/overlays/architecture/layer-first/lib/src/data/datasources/local/.gitkeep +0 -0
  132. package/templates/overlays/architecture/layer-first/lib/src/data/datasources/remote/.gitkeep +0 -0
  133. package/templates/overlays/architecture/layer-first/lib/src/data/models/user_model.dart.hbs +1 -0
  134. package/templates/overlays/architecture/layer-first/lib/src/data/repositories/auth_repository_impl.dart.hbs +1 -0
  135. package/templates/overlays/architecture/layer-first/lib/src/domain/entities/user.dart.hbs +1 -0
  136. package/templates/overlays/architecture/layer-first/lib/src/domain/repositories/auth_repository.dart.hbs +1 -0
  137. package/templates/overlays/architecture/layer-first/lib/src/domain/usecases/auth/.gitkeep +0 -0
  138. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isBloc)@auth_bloc.dart.hbs +1 -0
  139. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isBloc)@session_bloc.dart.hbs +1 -0
  140. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isGetX)@auth_controller.dart.hbs +1 -0
  141. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isGetX)@session_controller.dart.hbs +1 -0
  142. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isMobX)@auth_store.dart.hbs +1 -0
  143. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isMobX)@session_store.dart.hbs +1 -0
  144. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isNoneState)@auth_view_model.dart.hbs +1 -0
  145. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isNoneState)@session_manager.dart.hbs +1 -0
  146. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
  147. package/templates/overlays/architecture/layer-first/lib/src/presentation/providers/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
  148. package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/forgot_password_screen.dart.hbs +1 -0
  149. package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/login_screen.dart.hbs +1 -0
  150. package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/auth/signup_screen.dart.hbs +1 -0
  151. package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/home/home_page.dart.hbs +1 -0
  152. package/templates/overlays/architecture/layer-first/lib/src/presentation/screens/onboarding/onboarding_page.dart.hbs +1 -0
  153. package/templates/overlays/architecture/layer-first/lib/src/presentation/widgets/.gitkeep +0 -0
  154. package/templates/overlays/architecture/mvc/architecture.md +5 -0
  155. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isBloc)@auth_bloc.dart.hbs +1 -0
  156. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isBloc)@session_bloc.dart.hbs +1 -0
  157. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isGetX)@auth_controller.dart.hbs +1 -0
  158. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isGetX)@session_controller.dart.hbs +1 -0
  159. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isMobX)@auth_store.dart.hbs +1 -0
  160. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isMobX)@session_store.dart.hbs +1 -0
  161. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isNoneState)@session_manager.dart.hbs +1 -0
  162. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isProvider,isRiverpod)@auth_provider.dart.hbs +1 -0
  163. package/templates/overlays/architecture/mvc/lib/src/controllers/auth/(isProvider,isRiverpod)@session_provider.dart.hbs +1 -0
  164. package/templates/overlays/architecture/mvc/lib/src/models/user_model.dart.hbs +1 -0
  165. package/templates/overlays/architecture/mvc/lib/src/services/auth_repository.dart.hbs +1 -0
  166. package/templates/overlays/architecture/mvc/lib/src/services/auth_repository_impl.dart.hbs +1 -0
  167. package/templates/overlays/architecture/mvc/lib/src/views/auth/forgot_password_screen.dart.hbs +1 -0
  168. package/templates/overlays/architecture/mvc/lib/src/views/auth/login_screen.dart.hbs +1 -0
  169. package/templates/overlays/architecture/mvc/lib/src/views/auth/signup_screen.dart.hbs +1 -0
  170. package/templates/overlays/architecture/mvc/lib/src/views/home/home_page.dart.hbs +1 -0
  171. package/templates/overlays/architecture/mvc/lib/src/views/onboarding/onboarding_page.dart.hbs +1 -0
  172. package/templates/overlays/architecture/mvvm/architecture.md +6 -0
  173. package/templates/overlays/architecture/mvvm/lib/src/data/models/user_model.dart.hbs +1 -0
  174. package/templates/overlays/architecture/mvvm/lib/src/data/repositories/auth_repository.dart.hbs +1 -0
  175. package/templates/overlays/architecture/mvvm/lib/src/data/repositories/auth_repository_impl.dart.hbs +1 -0
  176. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isBloc)@bloc/auth_bloc.dart.hbs +1 -0
  177. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isBloc)@bloc/session_bloc.dart.hbs +1 -0
  178. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isGetX)@controllers/auth_controller.dart.hbs +1 -0
  179. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isGetX)@controllers/session_controller.dart.hbs +1 -0
  180. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isMobX)@stores/auth_store.dart.hbs +1 -0
  181. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isMobX)@stores/session_store.dart.hbs +1 -0
  182. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isNoneState)@view_models/auth_view_model.dart.hbs +1 -0
  183. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isNoneState)@view_models/session_manager.dart.hbs +1 -0
  184. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isProvider,isRiverpod)@providers/auth_provider.dart.hbs +1 -0
  185. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/(isProvider,isRiverpod)@providers/session_provider.dart.hbs +1 -0
  186. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/forgot_password_screen.dart.hbs +1 -0
  187. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/login_screen.dart.hbs +1 -0
  188. package/templates/overlays/architecture/mvvm/lib/src/ui/auth/signup_screen.dart.hbs +1 -0
  189. package/templates/overlays/architecture/mvvm/lib/src/ui/home/home_page.dart.hbs +1 -0
  190. package/templates/overlays/architecture/mvvm/lib/src/ui/onboarding/onboarding_page.dart.hbs +1 -0
  191. package/templates/overlays/backend/appwrite/lib/src/services/(usesAppwriteAuth)@auth_service.dart.hbs +101 -0
  192. package/templates/overlays/backend/custom/lib/src/services/auth_service.dart.hbs +158 -0
  193. package/templates/overlays/backend/firebase/lib/src/services/(usesFirebaseAuth)@auth_service.dart.hbs +96 -0
  194. package/templates/overlays/backend/supabase/lib/src/services/(usesSupabaseAuth)@auth_service.dart.hbs +97 -0
  195. package/templates/overlays/device/app_version_update/lib/src/services/(usesAppVersionUpdate)@version_update_service.dart.hbs +118 -0
  196. package/templates/overlays/device/device_info/lib/src/services/(usesDeviceInfoPlus)@device_info_service.dart.hbs +54 -0
  197. package/templates/overlays/extras/dotenv/.env.hbs +33 -0
  198. package/templates/overlays/extras/flavors/lib/src/flavors.dart.hbs +15 -0
  199. package/templates/overlays/extras/localization/assets/translations/en.json.hbs +47 -0
  200. package/templates/overlays/media/lib/src/services/(usesImagePicker,usesFilePicker)@media_service.dart.hbs +148 -0
  201. package/templates/overlays/networking/cached_image/lib/src/shared/widgets/app_cached_image.dart.hbs +160 -0
  202. package/templates/overlays/networking/dio/lib/src/services/(usesDio)@dio_service.dart.hbs +50 -0
  203. package/templates/overlays/networking/http/lib/src/services/(usesHttp)@http_service.dart.hbs +82 -0
  204. package/templates/overlays/storage/hive/lib/src/services/(usesHive)@hive_service.dart.hbs +59 -0
  205. package/templates/overlays/storage/secure_storage/lib/src/services/(usesSecureStorage)@secure_storage_service.dart.hbs +39 -0
  206. package/templates/overlays/storage/shared_preferences/lib/src/services/(usesSharedPreferences)@storage_service.dart.hbs +53 -0
  207. package/templates/overlays/utilities/geolocator/lib/src/services/(usesGeolocator)@location_service.dart.hbs +78 -0
  208. package/templates/overlays/utilities/path_provider/lib/src/services/(usesPathProvider)@path_service.dart.hbs +30 -0
  209. package/templates/overlays/utilities/permission_handler/lib/src/services/(usesPermissionHandler)@permission_service.dart.hbs +28 -0
  210. package/templates/overlays/utilities/permission_handler/lib/src/shared/hooks/use_permission.dart.hbs +44 -0
  211. package/templates/overlays/utilities/share_plus/lib/src/services/(usesSharePlus)@share_service.dart.hbs +22 -0
  212. package/templates/overlays/utilities/share_plus/lib/src/shared/hooks/use_share.dart.hbs +26 -0
  213. package/templates/overlays/utilities/url_launcher/lib/src/services/(usesUrlLauncher)@url_launcher_service.dart.hbs +37 -0
  214. package/templates/overlays/utilities/url_launcher/lib/src/shared/hooks/use_launch_url.dart.hbs +52 -0
  215. package/templates/partials/features/auth/auth_logic.hbs +611 -0
  216. package/templates/partials/features/auth/auth_repository.hbs +32 -0
  217. package/templates/partials/features/auth/auth_repository_impl.hbs +116 -0
  218. package/templates/partials/features/auth/forgot_password_screen.hbs +368 -0
  219. package/templates/partials/features/auth/login_screen.hbs +540 -0
  220. package/templates/partials/features/auth/session_provider.hbs +437 -0
  221. package/templates/partials/features/auth/signup_screen.hbs +511 -0
  222. package/templates/partials/features/auth/user_model.hbs +23 -0
  223. package/templates/partials/features/home/home_page.hbs +156 -0
  224. package/templates/partials/features/onboarding/onboarding_page.hbs +264 -0
  225. package/templates/partials/llm/add-feature-workflow.hbs +38 -0
  226. package/templates/partials/llm/architecture-rules.hbs +92 -0
  227. package/templates/partials/llm/backend-rules.hbs +30 -0
  228. package/templates/partials/llm/build-runner-note.hbs +15 -0
  229. package/templates/partials/llm/design-quick-ref.hbs +14 -0
  230. package/templates/partials/llm/design-quick-reference.hbs +14 -0
  231. package/templates/partials/llm/navigation-rules.hbs +27 -0
  232. package/templates/partials/llm/networking-rules.hbs +16 -0
  233. package/templates/partials/llm/packages-list.hbs +26 -0
  234. package/templates/partials/llm/services-conventions.hbs +20 -0
  235. package/templates/partials/llm/stack-summary.hbs +22 -0
  236. package/templates/partials/llm/state-management-rules.hbs +40 -0
  237. package/templates/partials/state_label.hbs +1 -0
@@ -0,0 +1,78 @@
1
+ import 'package:geolocator/geolocator.dart';
2
+ import '../utils/utils.dart';
3
+
4
+ /// A service to handle device location requests and status checks.
5
+ class LocationService {
6
+ LocationService._();
7
+ static final LocationService instance = LocationService._();
8
+
9
+ /// Check the status of location permission.
10
+ FutureEither<LocationPermission> checkPermission() async {
11
+ return runTask(() => Geolocator.checkPermission());
12
+ }
13
+
14
+ /// Request location permission.
15
+ FutureEither<LocationPermission> requestPermission() async {
16
+ return runTask(() => Geolocator.requestPermission());
17
+ }
18
+
19
+ /// Check if location services are enabled.
20
+ FutureEither<bool> isLocationServiceEnabled() async {
21
+ return runTask(() => Geolocator.isLocationServiceEnabled());
22
+ }
23
+
24
+ /// Open the location settings.
25
+ FutureEither<bool> openLocationSettings() async {
26
+ return runTask(() => Geolocator.openLocationSettings());
27
+ }
28
+
29
+ /// Get the current position.
30
+ FutureEither<Position> getCurrentPosition({
31
+ LocationAccuracy accuracy = LocationAccuracy.high,
32
+ }) async {
33
+ return runTask(() async {
34
+ bool serviceEnabled;
35
+ LocationPermission permission;
36
+
37
+ serviceEnabled = await Geolocator.isLocationServiceEnabled();
38
+ if (!serviceEnabled) {
39
+ throw Exception('Location services are disabled.');
40
+ }
41
+
42
+ permission = await Geolocator.checkPermission();
43
+ if (permission == LocationPermission.denied) {
44
+ permission = await Geolocator.requestPermission();
45
+ if (permission == LocationPermission.denied) {
46
+ throw Exception('Location permissions are denied.');
47
+ }
48
+ }
49
+
50
+ if (permission == LocationPermission.deniedForever) {
51
+ throw Exception(
52
+ 'Location permissions are permanently denied, we cannot request permissions.');
53
+ }
54
+
55
+ return await Geolocator.getCurrentPosition(
56
+ locationSettings: LocationSettings(accuracy: accuracy),
57
+ );
58
+ });
59
+ }
60
+
61
+ /// Get the last known position.
62
+ FutureEither<Position?> getLastKnownPosition() async {
63
+ return runTask(() => Geolocator.getLastKnownPosition());
64
+ }
65
+
66
+ /// Get a stream of position updates.
67
+ Stream<Position> getPositionStream({
68
+ LocationAccuracy accuracy = LocationAccuracy.high,
69
+ int distanceFilter = 0,
70
+ }) {
71
+ return Geolocator.getPositionStream(
72
+ locationSettings: LocationSettings(
73
+ accuracy: accuracy,
74
+ distanceFilter: distanceFilter,
75
+ ),
76
+ );
77
+ }
78
+ }
@@ -0,0 +1,30 @@
1
+ import 'dart:io';
2
+ import 'package:path_provider/path_provider.dart';
3
+ import '../utils/utils.dart';
4
+
5
+ /// A service to easily access platform-specific file system locations.
6
+ class PathService {
7
+ PathService._();
8
+ static final PathService instance = PathService._();
9
+
10
+ /// Get the directory where the application may place data that is user-generated.
11
+ FutureEither<Directory> getDocumentsDirectory() async =>
12
+ runTask(() => getApplicationDocumentsDirectory());
13
+
14
+ /// Get the directory where the application may place application-specific cache files.
15
+ FutureEither<Directory> getTempDirectory() async =>
16
+ runTask(() => getTemporaryDirectory());
17
+
18
+ /// Get the directory where the application may place data that is specific to
19
+ /// the application and not meant to be seen by the user.
20
+ FutureEither<Directory> getAppSupportDirectory() async =>
21
+ runTask(() => getApplicationSupportDirectory());
22
+
23
+ /// Get the directory where current application-specific data may be found.
24
+ FutureEither<Directory> getAppLibraryDirectory() async =>
25
+ runTask(() => getLibraryDirectory());
26
+
27
+ /// Get the path to the external storage directory (Android only).
28
+ FutureEither<Directory?> getExternalStorageDirectoryPath() async =>
29
+ runTask(() => getExternalStorageDirectory());
30
+ }
@@ -0,0 +1,28 @@
1
+ import 'package:permission_handler/permission_handler.dart';
2
+ import '../utils/utils.dart';
3
+
4
+ /// A service to handle device permission requests and status checks.
5
+ class PermissionService {
6
+ PermissionService._();
7
+ static final PermissionService instance = PermissionService._();
8
+
9
+ /// Check the status of a specific permission.
10
+ FutureEither<PermissionStatus> checkStatus(Permission permission) async {
11
+ return runTask(() => permission.status);
12
+ }
13
+
14
+ /// Request a specific permission.
15
+ FutureEither<PermissionStatus> request(Permission permission) async {
16
+ return runTask(() => permission.request());
17
+ }
18
+
19
+ /// Request multiple permissions at once.
20
+ FutureEither<Map<Permission, PermissionStatus>> requestMultiple(List<Permission> permissions) async {
21
+ return runTask(() => permissions.request());
22
+ }
23
+
24
+ /// Open the app settings.
25
+ FutureEither<bool> openSettings() async {
26
+ return runTask(() => openAppSettings());
27
+ }
28
+ }
@@ -0,0 +1,44 @@
1
+ {{#if flags.usesFlutterHooks}}
2
+ import 'package:flutter_hooks/flutter_hooks.dart';
3
+ import 'package:permission_handler/permission_handler.dart';
4
+ import '../../services/permission_service.dart';
5
+
6
+ /// A hook to manage permission lifecycle and status with loading state.
7
+ (PermissionStatus, bool, Future<void> Function()) usePermission(Permission permission) {
8
+ final status = useState<PermissionStatus>(PermissionStatus.denied);
9
+ final isLoading = useState(false);
10
+
11
+ Future<void> check() async {
12
+ isLoading.value = true;
13
+ try {
14
+ final result = await PermissionService.instance.checkStatus(permission);
15
+ result.fold(
16
+ (f) => null,
17
+ (s) => status.value = s,
18
+ );
19
+ } finally {
20
+ isLoading.value = false;
21
+ }
22
+ }
23
+
24
+ Future<void> request() async {
25
+ isLoading.value = true;
26
+ try {
27
+ final result = await PermissionService.instance.request(permission);
28
+ result.fold(
29
+ (f) => null,
30
+ (s) => status.value = s,
31
+ );
32
+ } finally {
33
+ isLoading.value = false;
34
+ }
35
+ }
36
+
37
+ useEffect(() {
38
+ check();
39
+ return null;
40
+ }, [permission]);
41
+
42
+ return (status.value, isLoading.value, request);
43
+ }
44
+ {{/if}}
@@ -0,0 +1,22 @@
1
+ import 'package:share_plus/share_plus.dart';
2
+ import '../utils/utils.dart';
3
+
4
+ /// A service to handle sharing content via the platform's native share dialog.
5
+ class ShareService {
6
+ ShareService._();
7
+ static final ShareService instance = ShareService._();
8
+
9
+ /// Share plain text content.
10
+ FutureEither<ShareResult> shareText(String text, {String? subject}) async {
11
+ return runTask(() => Share.share(text, subject: subject));
12
+ }
13
+
14
+ /// Share files.
15
+ FutureEither<ShareResult> shareFiles(List<String> paths, {String? text, String? subject}) async {
16
+ return runTask(() => Share.shareXFiles(
17
+ paths.map((p) => XFile(p)).toList(),
18
+ text: text,
19
+ subject: subject,
20
+ ));
21
+ }
22
+ }
@@ -0,0 +1,26 @@
1
+ {{#if flags.usesFlutterHooks}}
2
+ import 'package:flutter_hooks/flutter_hooks.dart';
3
+ import '../../utils/utils.dart';
4
+ import '../../services/share_service.dart';
5
+
6
+ /// A hook to simplify sharing logic within widgets with loading state.
7
+ (bool, Future<void> Function(String, {String? subject})) useShare() {
8
+ final isLoading = useState(false);
9
+ final service = ShareService.instance;
10
+
11
+ Future<void> share(String text, {String? subject}) async {
12
+ isLoading.value = true;
13
+ try {
14
+ final result = await service.shareText(text, subject: subject);
15
+ result.fold(
16
+ (failure) => AppLogger.error('Sharing failed: ${failure.message}'),
17
+ (success) => AppLogger.info('Sharing result: ${success.status}'),
18
+ );
19
+ } finally {
20
+ isLoading.value = false;
21
+ }
22
+ }
23
+
24
+ return (isLoading.value, share);
25
+ }
26
+ {{/if}}
@@ -0,0 +1,37 @@
1
+ import 'dart:io';
2
+ import '../imports/imports.dart';
3
+
4
+ /// A service to handle URL launching operations.
5
+ class UrlLauncherService {
6
+ UrlLauncherService._();
7
+ static final UrlLauncherService instance = UrlLauncherService._();
8
+
9
+ /// Launch a URL string.
10
+ FutureEither<void> launch(String url, {LaunchMode? mode}) async {
11
+ return runTask(() async {
12
+ final formattedUrl = _formatUrl(url);
13
+ final uri = Uri.parse(formattedUrl);
14
+
15
+ if (await canLaunchUrl(uri)) {
16
+ await launchUrl(
17
+ uri,
18
+ mode: mode ?? LaunchMode.externalApplication,
19
+ );
20
+ } else {
21
+ throw Exception('Could not launch url: $formattedUrl');
22
+ }
23
+ });
24
+ }
25
+
26
+ String _formatUrl(String url) {
27
+ if (url.isValidUrl && !url.contains('://')) {
28
+ return 'https://$url';
29
+ }
30
+ if (url.isValidPhoneNumber) {
31
+ return Platform.isAndroid
32
+ ? 'whatsapp://send?phone=$url'
33
+ : 'https://wa.me/$url';
34
+ }
35
+ return url;
36
+ }
37
+ }
@@ -0,0 +1,52 @@
1
+ {{#if flags.usesFlutterHooks}}
2
+ import 'dart:io';
3
+ import '../../imports/imports.dart';
4
+
5
+ /// A hook to handle URL launching with state feedback.
6
+ (bool, Future<void> Function(String)) useLaunchUrl({LaunchMode? mode}) {
7
+ final isLoading = useState(false);
8
+
9
+ Future<void> launch(String url) async {
10
+ isLoading.value = true;
11
+ try {
12
+ final formattedUrl = _formatUrl(url);
13
+ final uri = Uri.parse(formattedUrl);
14
+
15
+ if (await canLaunchUrl(uri)) {
16
+ await launchUrl(
17
+ uri,
18
+ mode: mode ?? LaunchMode.externalApplication,
19
+ );
20
+ } else {
21
+ AppLogger.error('Could not launch url: $formattedUrl');
22
+ showGlobalToast(
23
+ message: 'Could not launch url',
24
+ status: 'error',
25
+ );
26
+ }
27
+ } catch (e) {
28
+ AppLogger.error('Error launching URL: $e');
29
+ showGlobalToast(
30
+ message: 'Could not launch url',
31
+ status: 'error',
32
+ );
33
+ } finally {
34
+ isLoading.value = false;
35
+ }
36
+ }
37
+
38
+ return (isLoading.value, launch);
39
+ }
40
+
41
+ String _formatUrl(String url) {
42
+ if (url.isValidUrl && !url.contains('://')) {
43
+ return 'https://$url';
44
+ }
45
+ if (url.isValidPhoneNumber) {
46
+ return Platform.isAndroid
47
+ ? 'whatsapp://send?phone=$url'
48
+ : 'https://wa.me/$url';
49
+ }
50
+ return url;
51
+ }
52
+ {{/if}}