├── .env.example ├── .github ├── pull_request_template.md └── workflows │ └── create-code-visualization-diagram.yml ├── .gitignore ├── .metadata ├── .vscode ├── .code-snippets ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── .project ├── .settings │ └── org.eclipse.buildship.core.prefs ├── app │ ├── .classpath │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── flutter_template │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-hdpi │ │ │ └── splash.png │ │ │ ├── drawable-mdpi │ │ │ └── splash.png │ │ │ ├── drawable-v21 │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── drawable-xhdpi │ │ │ └── splash.png │ │ │ ├── drawable-xxhdpi │ │ │ └── splash.png │ │ │ ├── drawable-xxxhdpi │ │ │ └── splash.png │ │ │ ├── drawable │ │ │ ├── background.png │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── files │ ├── countries.json │ └── currencies.json ├── fonts │ ├── Roboto-Black.ttf │ ├── Roboto-BlackItalic.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-BoldItalic.ttf │ ├── Roboto-Italic.ttf │ ├── Roboto-Light.ttf │ ├── Roboto-LightItalic.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-MediumItalic.ttf │ ├── Roboto-Regular.ttf │ ├── Roboto-Thin.ttf │ └── Roboto-ThinItalic.ttf ├── icons │ └── core │ │ └── splash.png └── translations │ ├── app_en.arb │ └── app_es.arb ├── dev_commands.sh ├── diagram.svg ├── flutter_launcher_icons.yaml ├── flutter_native_splash.yaml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ ├── LaunchBackground.imageset │ │ ├── Contents.json │ │ └── background.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── l10n.yaml ├── lib ├── application │ ├── auth │ │ ├── auth_bloc.dart │ │ ├── auth_bloc.freezed.dart │ │ ├── auth_event.dart │ │ └── auth_state.dart │ ├── local_auth │ │ ├── local_auth_bloc.dart │ │ ├── local_auth_bloc.freezed.dart │ │ ├── local_auth_event.dart │ │ └── local_auth_state.dart │ └── settings │ │ ├── settings_bloc.dart │ │ ├── settings_bloc.freezed.dart │ │ ├── settings_event.dart │ │ └── settings_state.dart ├── domain │ ├── auth │ │ ├── auth_failure.dart │ │ ├── auth_failure.freezed.dart │ │ └── i_auth_facade.dart │ └── core │ │ ├── constants │ │ ├── analytics_constants.dart │ │ ├── api_constants.dart │ │ ├── app_constants.dart │ │ ├── constants.dart │ │ ├── storage_constants.dart │ │ └── text_max_lengths.dart │ │ ├── enums.dart │ │ ├── environment │ │ ├── base_config.dart │ │ ├── environment.dart │ │ └── environment_configs.dart │ │ ├── extensions │ │ ├── date_extensions.dart │ │ ├── extensions.dart │ │ ├── numeric_extensions.dart │ │ └── string_extensions.dart │ │ ├── generated │ │ ├── assets.gen.dart │ │ └── fonts.gen.dart │ │ ├── helpers │ │ ├── countries_helper.dart │ │ ├── currencies_helper.dart │ │ ├── decimal_text_input_formatter.dart │ │ ├── secure_storage.dart │ │ ├── utility.dart │ │ └── validators.dart │ │ ├── l10n │ │ ├── app_localizations.dart │ │ ├── app_localizations_en.dart │ │ ├── app_localizations_es.dart │ │ └── untranslated_strings.arb │ │ └── models │ │ ├── country.dart │ │ ├── currency.dart │ │ ├── model_factory.dart │ │ └── user.dart ├── infrastructure │ ├── auth │ │ └── auth_facade.dart │ └── core │ │ ├── dev │ │ └── logging_service.dart │ │ ├── getters.dart │ │ ├── network │ │ ├── firebase │ │ │ ├── firebase_helpers.dart │ │ │ └── firebase_injectable_modules.dart │ │ ├── graphql │ │ │ ├── graphql_mutations.dart │ │ │ ├── graphql_queries.dart │ │ │ └── graphql_service.dart │ │ └── rest-api │ │ │ ├── api_error_interceptors.dart │ │ │ └── api_service.dart │ │ └── system │ │ ├── camera_service.dart │ │ ├── device_info_service.dart │ │ ├── file_picker_service.dart │ │ ├── permissions_service.dart │ │ └── storage_service.dart ├── injection.config.dart ├── injection.dart ├── main.dart └── presentation │ ├── authentication │ └── pages │ │ ├── forgot_password_page.dart │ │ ├── signin_page.dart │ │ └── signup_page.dart │ ├── base │ ├── base_page.dart │ ├── home │ │ └── home_page.dart │ └── profile │ │ └── profile_page.dart │ ├── core │ ├── app_widget.dart │ ├── pages │ │ ├── landing_page.dart │ │ ├── onboarding_page.dart │ │ ├── splash_page.dart │ │ └── update_app_page.dart │ ├── shimmer │ │ ├── custom_shimmer.dart │ │ ├── shimmer_card.dart │ │ ├── shimmer_list.dart │ │ ├── shimmer_list_tile.dart │ │ ├── shimmer_section.dart │ │ ├── shimmer_skeleton_bar.dart │ │ └── shimmer_skeleton_circle.dart │ ├── styles │ │ ├── app_colors.dart │ │ ├── app_text_theme.dart │ │ ├── app_theme.dart │ │ ├── styles.dart │ │ └── text_styles.dart │ └── widgets │ │ ├── buttons │ │ ├── buttons.dart │ │ ├── link_text.dart │ │ ├── rounded_filled_button.dart │ │ └── rounded_outline_button.dart │ │ ├── dialogs │ │ ├── app_dialog.dart │ │ ├── app_toast.dart │ │ ├── dialogs.dart │ │ └── snackbars.dart │ │ ├── inputs │ │ ├── custom_choice_chip.dart │ │ ├── custom_date_picker.dart │ │ ├── custom_dropdown.dart │ │ ├── custom_pin_field.dart │ │ ├── custom_switch_tile.dart │ │ ├── custom_text_field.dart │ │ └── inputs.dart │ │ ├── layout │ │ ├── app_scaffold.dart │ │ ├── custom_app_bar.dart │ │ ├── layout.dart │ │ └── logo_widget.dart │ │ └── utility │ │ ├── dots_indicator.dart │ │ ├── life_cycle_watcher.dart │ │ └── navigation_observer.dart │ ├── onboarding │ ├── onboarding_page.dart │ └── pages │ │ └── welcome_page.dart │ └── routes │ ├── router.dart │ └── router.gr.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html ├── manifest.json └── splash │ ├── img │ ├── dark-1x.png │ ├── dark-2x.png │ ├── dark-3x.png │ ├── light-1x.png │ ├── light-2x.png │ └── light-3x.png │ └── style.css └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── run_loop.cpp ├── run_loop.h ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.env.example: -------------------------------------------------------------------------------- 1 | DEV_API_BASE_URL=localhost:5000 2 | STAGING_API_BASE_URL=http://localhost 3 | PROD_API_BASE_URL=http://localhost 4 | 5 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## What does this PR do? 2 | 3 | 4 | 5 | Fixes # (issue) 6 | 7 | 10 | 11 | **Environment**: Staging(main branch) / Production 12 | 13 | ## Type of change 14 | 15 | 16 | 17 | - [ ] Bug fix (non-breaking change which fixes an issue) 18 | - [ ] New feature (non-breaking change which adds functionality) 19 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 20 | - [ ] This change requires a documentation update 21 | 22 | ## How should this be tested? 23 | 24 | 25 | 26 | - [ ] Test A 27 | - [ ] Test B 28 | 29 | ## Checklist 30 | 31 | 32 | 33 | - My code doesn't follow the style guidelines of this project 34 | - I haven't performed a self-review of my own code and corrected any misspellings 35 | - I haven't commented my code, particularly in hard-to-understand areas 36 | - I haven't checked if my PR needs changes to the documentation 37 | - I haven't checked if my changes generate no new warnings 38 | - I haven't added tests that prove my fix is effective or that my feature works 39 | - I haven't checked if new and existing unit tests pass locally with my changes 40 | -------------------------------------------------------------------------------- /.github/workflows/create-code-visualization-diagram.yml: -------------------------------------------------------------------------------- 1 | name: Create code visualization diagram 2 | on: 3 | workflow_dispatch: {} 4 | push: 5 | branches: 6 | - main 7 | - firebase 8 | jobs: 9 | get_data: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@master 14 | - name: Update diagram 15 | uses: githubocto/repo-visualizer@main 16 | with: 17 | excluded_paths: "ignore,.github,.vscode" 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | *.env 13 | 14 | # IntelliJ related 15 | *.iml 16 | *.ipr 17 | *.iws 18 | .idea/ 19 | 20 | # Visual Studio Code related 21 | .classpath 22 | .project 23 | .settings/ 24 | # .vscode/ 25 | 26 | # Firebase related 27 | **/google-services.json 28 | 29 | # Flutter repo-specific 30 | /bin/cache/ 31 | /bin/internal/bootstrap.bat 32 | /bin/internal/bootstrap.sh 33 | /bin/mingit/ 34 | /dev/benchmarks/mega_gallery/ 35 | /dev/bots/.recipe_deps 36 | /dev/bots/android_tools/ 37 | /dev/devicelab/ABresults*.json 38 | /dev/docs/doc/ 39 | /dev/docs/flutter.docs.zip 40 | /dev/docs/lib/ 41 | /dev/docs/pubspec.yaml 42 | /dev/integration_tests/**/xcuserdata 43 | /dev/integration_tests/**/Pods 44 | /packages/flutter/coverage/ 45 | version 46 | analysis_benchmark.json 47 | 48 | # packages file containing multi-root paths 49 | .packages.generated 50 | 51 | # Flutter/Dart/Pub related 52 | **/doc/api/ 53 | .dart_tool/ 54 | .flutter-plugins 55 | .flutter-plugins-dependencies 56 | **/generated_plugin_registrant.dart 57 | .packages 58 | .pub-cache/ 59 | .pub/ 60 | build/ 61 | flutter_*.png 62 | linked_*.ds 63 | unlinked.ds 64 | unlinked_spec.ds 65 | 66 | # Android related 67 | **/android/**/gradle-wrapper.jar 68 | .gradle/ 69 | **/android/captures/ 70 | **/android/gradlew 71 | **/android/gradlew.bat 72 | **/android/local.properties 73 | **/android/**/GeneratedPluginRegistrant.java 74 | **/android/key.properties 75 | *.jks 76 | 77 | # iOS/XCode related 78 | **/ios/**/*.mode1v3 79 | **/ios/**/*.mode2v3 80 | **/ios/**/*.moved-aside 81 | **/ios/**/*.pbxuser 82 | **/ios/**/*.perspectivev3 83 | **/ios/**/*sync/ 84 | **/ios/**/.sconsign.dblite 85 | **/ios/**/.tags* 86 | **/ios/**/.vagrant/ 87 | **/ios/**/DerivedData/ 88 | **/ios/**/Icon? 89 | **/ios/**/Pods/ 90 | **/ios/**/.symlinks/ 91 | **/ios/**/profile 92 | **/ios/**/xcuserdata 93 | **/ios/.generated/ 94 | **/ios/Flutter/.last_build_id 95 | **/ios/Flutter/App.framework 96 | **/ios/Flutter/Flutter.framework 97 | **/ios/Flutter/Flutter.podspec 98 | **/ios/Flutter/Generated.xcconfig 99 | **/ios/Flutter/ephemeral 100 | **/ios/Flutter/app.flx 101 | **/ios/Flutter/app.zip 102 | **/ios/Flutter/flutter_assets/ 103 | **/ios/Flutter/flutter_export_environment.sh 104 | **/ios/ServiceDefinitions.json 105 | **/ios/Runner/GeneratedPluginRegistrant.* 106 | 107 | # macOS 108 | **/Flutter/ephemeral/ 109 | **/Pods/ 110 | **/macos/Flutter/GeneratedPluginRegistrant.swift 111 | **/macos/Flutter/ephemeral 112 | **/xcuserdata/ 113 | 114 | # Windows 115 | **/windows/flutter/generated_plugin_registrant.cc 116 | **/windows/flutter/generated_plugin_registrant.h 117 | 118 | # Linux 119 | **/linux/flutter/generated_plugin_registrant.cc 120 | **/linux/flutter/generated_plugin_registrant.h 121 | 122 | # Coverage 123 | coverage/ 124 | 125 | # Symbols 126 | app.*.symbols 127 | 128 | # Exceptions to above rules. 129 | !**/ios/**/default.mode1v3 130 | !**/ios/**/default.mode2v3 131 | !**/ios/**/default.pbxuser 132 | !**/ios/**/default.perspectivev3 133 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 134 | !/dev/ci/**/Gemfile.lock -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 17 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 18 | - platform: android 19 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 20 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 21 | - platform: ios 22 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 23 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 24 | - platform: linux 25 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 26 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 27 | - platform: macos 28 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 29 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 30 | - platform: web 31 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 32 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 33 | - platform: windows 34 | create_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 35 | base_revision: 52b3dc25f6471c27b2144594abb11c741cb88f57 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nash.awesome-flutter-snippets", 4 | "felixangelov.bloc", 5 | "dart-code.dart-code", 6 | "dotup.dart-data-class-generator", 7 | "dart-code.flutter", 8 | "gruntfuggly.todo-tree" 9 | ] 10 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/.vscode/launch.json -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "files.exclude": { 4 | "**/.git": true, 5 | "**/.svn": true, 6 | "**/.hg": true, 7 | "**/CVS": true, 8 | "**/.DS_Store": true, 9 | "**/Thumbs.db": true, 10 | "build": true, 11 | ".flutter-plugins": true, 12 | ".flutter-plugins-dependencies": true, 13 | ".metadata": true, 14 | "linux/": true, 15 | "macos/": true, 16 | "windows/": true, 17 | "web/": true, 18 | }, 19 | "[dart]": { 20 | "editor.formatOnSave": true, 21 | "editor.formatOnType": true, 22 | "editor.defaultFormatter": "Dart-Code.dart-code", 23 | "editor.rulers": [ 24 | 80 25 | ], 26 | "editor.selectionHighlight": false, 27 | "editor.suggest.snippetsPreventQuickSuggestions": false, 28 | "editor.suggestSelection": "first", 29 | "editor.tabCompletion": "onlySnippets", 30 | "editor.wordBasedSuggestions": false 31 | }, 32 | "files.autoSave": "afterDelay", 33 | "editor.guides.bracketPairs": true, 34 | "dart.showTodos": true, 35 | "dart.renameFilesWithClasses": "prompt", 36 | "dart.flutterHotReloadOnSave": "allIfDirty", 37 | "dart_data_class_generator.useEquatable": true, 38 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | } -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | linter: 4 | rules: 5 | - sort_pub_dependencies 6 | 7 | analyzer: 8 | plugins: 9 | - dart_code_metrics 10 | exclude: 11 | - "build/**" 12 | - "lib/injection.config.dart" 13 | - "**/*.g.dart" 14 | - "**/*.gen.dart" 15 | - "**/*.gr.dart" 16 | - "**/*.freezed.dart" 17 | errors: 18 | missing_return: error 19 | 20 | dart_code_metrics: 21 | anti-patterns: 22 | - long-method 23 | - long-parameter-list 24 | metrics: 25 | cyclomatic-complexity: 20 26 | maximum-nesting-level: 5 27 | number-of-parameters: 4 28 | source-lines-of-code: 50 29 | technical-debt: 30 | metrics-exclude: 31 | - test/** 32 | rules: 33 | - newline-before-return 34 | - no-boolean-literal-compare 35 | - no-empty-block 36 | - prefer-trailing-comma 37 | - prefer-conditional-expressions 38 | - no-equal-then-else 39 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | 19 | 1624424677406 20 | 21 | 30 22 | 23 | org.eclipse.core.resources.regexFilterMatcher 24 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=C\:/Program Files/OpenJDK/jdk-11.0.8.10-hotspot 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | 25 | 1624424677410 26 | 27 | 30 28 | 29 | org.eclipse.core.resources.regexFilterMatcher 30 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply plugin: 'com.google.gms.google-services' 27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 28 | 29 | android { 30 | compileSdkVersion 33 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | lintOptions { 46 | disable 'InvalidPackage' 47 | checkReleaseBuilds false 48 | } 49 | 50 | defaultConfig { 51 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 52 | applicationId "com.example.flutter_template" 53 | minSdkVersion 24 54 | targetSdkVersion 31 55 | versionCode flutterVersionCode.toInteger() 56 | versionName flutterVersionName 57 | multiDexEnabled true 58 | } 59 | 60 | buildTypes { 61 | release { 62 | // TODO: Add your own signing config for the release build. 63 | // Signing with the debug keys for now, so `flutter run --release` works. 64 | signingConfig signingConfigs.debug 65 | } 66 | } 67 | } 68 | 69 | flutter { 70 | source '../..' 71 | } 72 | 73 | dependencies { 74 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 75 | implementation platform('com.google.firebase:firebase-bom:31.1.0') 76 | implementation 'com.google.firebase:firebase-analytics' 77 | } 78 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/flutter_template/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_template 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 16 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | classpath 'com.google.gms:google-services:4.3.13' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /assets/fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /assets/fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /assets/icons/core/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/assets/icons/core/splash.png -------------------------------------------------------------------------------- /assets/translations/app_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "@____VALIDATION_MESSAGES____": {}, 3 | "thisFieldIsRequired": "This field is required", 4 | "pleaseEnterAnEmailAddress": "Please enter an email address", 5 | "pleaseEnterAValidEmailAddress": "Please enter a valid email address", 6 | "thisFieldCannotExceed100characters": "This field cannot exceed 100 characters", 7 | "pleaseEnterAPhoneNumber": "Please enter a phone number", 8 | "pleaseEnterAValidPhoneNumber": "Please enter a valid phone number", 9 | "pleaseEnterAPassword": "Please enter a password", 10 | "passwordTooShort": "Password too short. Please enter a password of atleast 6 length", 11 | "dontForgetYourName": "Don’t forget your name!", 12 | "invalidName": "Invalid Name. Only alphabets allowed.", 13 | "pleaseEnterAnAmount": "Please enter an amount", 14 | "pleaseEnterValidAmount": "Please enter a valid amount", 15 | "pleaseEnterValidDecimal": "Please enter a valid decimal value", 16 | "maximumAmountCannotExceed": "Maximum amount cannot exceed 100,000", 17 | "validIntegerValue": "Please enter a valid integer value", 18 | "validTaxRate": "Please enter a valid rate", 19 | "rateShouldBeInRange": "The rate should be in range 0-100", 20 | "enterAValidPostalCode": "Please enter a valid postal code", 21 | "@____END_VALIDATION_MESSAGES____": {} 22 | } -------------------------------------------------------------------------------- /assets/translations/app_es.arb: -------------------------------------------------------------------------------- 1 | { 2 | "@____VALIDATION_MESSAGES____": {}, 3 | "thisFieldIsRequired": "Este espacio es requerido", 4 | "pleaseEnterAnEmailAddress": "Por favor, ingresa tu correo electrónico", 5 | "pleaseEnterAValidEmailAddress": "Por favor, ingresa un correo electrónico valido", 6 | "thisFieldCannotExceed100characters": "Este espacio no puede exceder los 100 carácteres", 7 | "pleaseEnterAPhoneNumber": "Por favor, ingresa tu número de teléfono", 8 | "pleaseEnterAValidPhoneNumber": "Por favor, ingresa un número de teléfono valido", 9 | "pleaseEnterAPassword": "Por favor, ingresa una contraseña", 10 | "passwordTooShort": "Contraseña muy corta. Por favor, ingresa una contraseña con al menos 6 carácteres", 11 | "dontForgetYourName": "¡No te olvides de tu nombre!", 12 | "invalidName": "Nombre invalido. Solo se permiten letras.", 13 | "pleaseEnterAnAmount": "Por favor, ingresa un monto", 14 | "pleaseEnterValidAmount": "Por favor, ingresa un monto valido", 15 | "pleaseEnterValidDecimal": "Introduce un número decimal valido", 16 | "maximumAmountCannotExceed": "El monto máximo no puede ser mayor a 100,000", 17 | "validIntegerValue": "Introduce un valor entero valido", 18 | "validTaxRate": "Por favor, ingresa una tarifa valida", 19 | "rateShouldBeInRange": "La tarifa debe estar en un rango de 0-100", 20 | "enterAValidPostalCode": "Introduce un código postal valido", 21 | "@____END_VALIDATION_MESSAGES____": {} 22 | } -------------------------------------------------------------------------------- /dev_commands.sh: -------------------------------------------------------------------------------- 1 | # Format all the files 2 | dart format . 3 | # Fix dart language warnings which can be automatically fixed 4 | dart fix --apply 5 | # Run if the build runner command fails 6 | flutter packages pub get 7 | # Updates the launcher icons 8 | flutter pub run flutter_launcher_icons 9 | # Generates freezed files, assets paths 10 | flutter pub run build_runner build --delete-conflicting-outputs 11 | # Run to change the app package name 12 | flutter pub run change_app_package_name:main com.new.package.name 13 | # Generates the splash screen from 14 | flutter pub run flutter_native_splash:create -------------------------------------------------------------------------------- /flutter_launcher_icons.yaml: -------------------------------------------------------------------------------- 1 | flutter_icons: 2 | android: true 3 | ios: true 4 | image_path: "assets/icons/core/logo.png" 5 | web: 6 | generate: true 7 | windows: 8 | generate: true 9 | macos: 10 | generate: true -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_template 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | UIStatusBarHidden 45 | 46 | 47 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /l10n.yaml: -------------------------------------------------------------------------------- 1 | arb-dir: assets/translations 2 | 3 | template-arb-file: app_en.arb 4 | 5 | output-localization-file: app_localizations.dart 6 | 7 | output-class: AppLocalizations 8 | 9 | nullable-getter: false 10 | 11 | synthetic-package: false 12 | 13 | output-dir: lib/domain/core/l10n 14 | 15 | untranslated-messages-file: lib/domain/core/l10n/untranslated_strings.arb -------------------------------------------------------------------------------- /lib/application/auth/auth_event.dart: -------------------------------------------------------------------------------- 1 | part of 'auth_bloc.dart'; 2 | 3 | @freezed 4 | class AuthEvent with _$AuthEvent { 5 | const factory AuthEvent.registerWithEmailAndPassword({ 6 | required String email, 7 | required String password, 8 | }) = _RegisterWithEmailAndPassword; 9 | 10 | const factory AuthEvent.signInWithEmailAndPassword({ 11 | required String email, 12 | required String password, 13 | }) = _SignInWithEmailAndPassword; 14 | 15 | const factory AuthEvent.signOut() = SignOut; 16 | 17 | const factory AuthEvent.checkAuthState() = CheckAuthState; 18 | 19 | const factory AuthEvent.sendEmailConfirmation({required String email}) = 20 | _SendEmailConfirmation; 21 | 22 | const factory AuthEvent.deleteAcccount() = _DeleteAccount; 23 | const factory AuthEvent.updateEmailAddress(String updatedEmail) = 24 | _UpdateEmailAddress; 25 | const factory AuthEvent.updateConnectivityStatus(ConnectivityResult status) = 26 | _UpdateConnectivityStatus; 27 | const factory AuthEvent.checkConnectivityStatus() = _CheckConnectivityStatus; 28 | } 29 | -------------------------------------------------------------------------------- /lib/application/auth/auth_state.dart: -------------------------------------------------------------------------------- 1 | part of 'auth_bloc.dart'; 2 | 3 | @freezed 4 | class AuthState with _$AuthState { 5 | const factory AuthState({ 6 | required bool isLoading, 7 | required bool isUserSignedin, 8 | required Option> authFailureOrSuccessOption, 9 | required Option> 10 | deleteAccountFailureOrSuccessOption, 11 | required Option> emailSendFailureOrSuccessOption, 12 | required Option> 13 | updateEmailFailureOrSuccessOption, 14 | required bool isNetworkAvailable, 15 | }) = _AuthState; 16 | 17 | factory AuthState.initial() => AuthState( 18 | isLoading: false, 19 | isUserSignedin: false, 20 | deleteAccountFailureOrSuccessOption: none(), 21 | emailSendFailureOrSuccessOption: none(), 22 | authFailureOrSuccessOption: none(), 23 | updateEmailFailureOrSuccessOption: none(), 24 | isNetworkAvailable: true, 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /lib/application/local_auth/local_auth_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc/bloc.dart'; 2 | import 'package:freezed_annotation/freezed_annotation.dart'; 3 | 4 | part 'local_auth_event.dart'; 5 | part 'local_auth_state.dart'; 6 | part 'local_auth_bloc.freezed.dart'; 7 | 8 | class LocalAuthBloc extends Bloc { 9 | LocalAuthBloc() : super(_Initial()) { 10 | on((event, emit) { 11 | // TODO: implement event handler 12 | }); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/application/local_auth/local_auth_event.dart: -------------------------------------------------------------------------------- 1 | part of 'local_auth_bloc.dart'; 2 | 3 | @freezed 4 | class LocalAuthEvent with _$LocalAuthEvent { 5 | const factory LocalAuthEvent.started() = _Started; 6 | } -------------------------------------------------------------------------------- /lib/application/local_auth/local_auth_state.dart: -------------------------------------------------------------------------------- 1 | part of 'local_auth_bloc.dart'; 2 | 3 | @freezed 4 | class LocalAuthState with _$LocalAuthState { 5 | const factory LocalAuthState.initial() = _Initial; 6 | } 7 | -------------------------------------------------------------------------------- /lib/application/settings/settings_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:freezed_annotation/freezed_annotation.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | 6 | part 'settings_bloc.freezed.dart'; 7 | part 'settings_event.dart'; 8 | part 'settings_state.dart'; 9 | 10 | @injectable 11 | class SettingsBloc extends Bloc { 12 | SettingsBloc() : super(SettingsState.initial()); 13 | } 14 | -------------------------------------------------------------------------------- /lib/application/settings/settings_event.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | @freezed 4 | class SettingsEvent with _$SettingsEvent { 5 | const factory SettingsEvent.changeAppThemeMode(ThemeMode themeMode) = 6 | _ChangeAppTheme; 7 | } 8 | -------------------------------------------------------------------------------- /lib/application/settings/settings_state.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | @freezed 4 | class SettingsState with _$SettingsState { 5 | const factory SettingsState({ 6 | required ThemeMode appThemeMode, 7 | required int fontSize, 8 | }) = _SettingsState; 9 | factory SettingsState.initial() => const SettingsState( 10 | appThemeMode: ThemeMode.system, 11 | fontSize: 12, 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /lib/domain/auth/auth_failure.dart: -------------------------------------------------------------------------------- 1 | import 'package:freezed_annotation/freezed_annotation.dart'; 2 | 3 | part 'auth_failure.freezed.dart'; 4 | 5 | @freezed 6 | class AuthFailure with _$AuthFailure { 7 | const factory AuthFailure.cancelledByUser() = CancelledByUser; 8 | const factory AuthFailure.serverError(String error) = ServerError; 9 | const factory AuthFailure.emailAlreadyInUse() = EmailAlreadyInUse; 10 | const factory AuthFailure.userNotFound() = UserNotFound; 11 | const factory AuthFailure.requiresRecentLogin(String message) = 12 | RequiredRecentLogin; 13 | const factory AuthFailure.deleteAccountFailure() = DeleteAccountFailure; 14 | const factory AuthFailure.invalidEmailAndPasswordCombination() = 15 | InvalidEmailAndPasswordCombination; 16 | } 17 | -------------------------------------------------------------------------------- /lib/domain/auth/i_auth_facade.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_template/domain/auth/auth_failure.dart'; 3 | 4 | abstract class IAuthFacade { 5 | Future> registerWithEmailAndPassword({ 6 | required String emailAddress, 7 | required String password, 8 | }); 9 | Future> signInWithEmailAndPassword({ 10 | required String emailAddress, 11 | required String password, 12 | }); 13 | Future signOut(); 14 | Future checkAuthState(); 15 | 16 | Future> deleteAccount(); 17 | Future> updateEmailAddress({ 18 | required String updatedEmail, 19 | }); 20 | 21 | Future> resetPassword({ 22 | required String emailAddress, 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /lib/domain/core/constants/analytics_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 2 | 3 | class AnalyticsConstants { 4 | static String token = dotenv.env['MIXPANEL_API_KEY']!; 5 | static const String appDownloaded = "app_downloaded"; 6 | static const String registrationFinished = "registration_finished"; 7 | } 8 | -------------------------------------------------------------------------------- /lib/domain/core/constants/api_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 2 | 3 | class ApiConstants { 4 | static String baseUrl = dotenv.env['API_BASE_URL']!; 5 | static String assetBaseUrl = dotenv.env['ASSET_BASE_URL']!; 6 | } 7 | -------------------------------------------------------------------------------- /lib/domain/core/constants/app_constants.dart: -------------------------------------------------------------------------------- 1 | class AppConstants { 2 | static const String appName = "App-Name-Here"; 3 | static const String playStoreLink = ""; 4 | static const String mailTo = "skilite007@gmail.com"; 5 | static const String mailSubject = "This is the subject"; 6 | static const String mailBody = "This is the mail body"; 7 | static const String inviteText = 8 | "Hey! Download $appName I'm using it and It's a fast, simple and secure app. Get it at $playStoreLink"; 9 | 10 | //Social Media Links 11 | static const String websiteUrl = ""; 12 | static const String githubUrl = ""; 13 | static const String instagramUrl = ""; 14 | static const String twitterUrl = ""; 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/core/constants/constants.dart: -------------------------------------------------------------------------------- 1 | export 'analytics_constants.dart'; 2 | export 'api_constants.dart'; 3 | export 'app_constants.dart'; 4 | export 'storage_constants.dart'; 5 | export 'text_max_lengths.dart'; 6 | -------------------------------------------------------------------------------- /lib/domain/core/constants/storage_constants.dart: -------------------------------------------------------------------------------- 1 | class StorageConstants { 2 | static const String themeMode = 'themeMode'; 3 | static const String userToken = 'userToken'; 4 | static const String lockEnabled = 'lockEnabled'; 5 | } 6 | -------------------------------------------------------------------------------- /lib/domain/core/constants/text_max_lengths.dart: -------------------------------------------------------------------------------- 1 | class TextMaxLengths { 2 | static const int basic = 25; 3 | static const int name = 50; 4 | static const int email = 40; 5 | static const int address = 30; 6 | static const int postalCode = 20; 7 | static const int businessNumber = 34; 8 | static const int notes = 250; 9 | } 10 | -------------------------------------------------------------------------------- /lib/domain/core/enums.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/domain/core/environment/base_config.dart: -------------------------------------------------------------------------------- 1 | abstract class BaseConfig { 2 | String get apiHost; 3 | bool get useHttpsScheme; 4 | bool get trackEvents; 5 | bool get reportErrors; 6 | } 7 | -------------------------------------------------------------------------------- /lib/domain/core/environment/environment.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_template/domain/core/environment/base_config.dart'; 2 | import 'package:flutter_template/domain/core/environment/environment_configs.dart'; 3 | 4 | class Environment { 5 | factory Environment() { 6 | return _singleton; 7 | } 8 | 9 | Environment._internal(); 10 | static final Environment _singleton = Environment._internal(); 11 | 12 | static const String dev = 'dev'; 13 | static const String staging = 'staging'; 14 | static const String prod = 'prod'; 15 | 16 | late BaseConfig config; 17 | 18 | void initConfig(String environment) { 19 | config = _getConfig(environment); 20 | } 21 | 22 | BaseConfig _getConfig(String environment) { 23 | switch (environment) { 24 | case Environment.prod: 25 | return ProdConfig(); 26 | case Environment.staging: 27 | return StagingConfig(); 28 | default: 29 | return DevConfig(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/domain/core/environment/environment_configs.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 2 | import 'package:flutter_template/domain/core/environment/base_config.dart'; 3 | 4 | class DevConfig implements BaseConfig { 5 | @override 6 | String get apiHost => dotenv.get("DEV_API_BASE_URL"); 7 | @override 8 | bool get reportErrors => false; 9 | @override 10 | bool get trackEvents => false; 11 | @override 12 | bool get useHttpsScheme => false; 13 | } 14 | 15 | class StagingConfig implements BaseConfig { 16 | @override 17 | String get apiHost => dotenv.get("STAGING_API_BASE_URL"); 18 | @override 19 | bool get reportErrors => true; 20 | @override 21 | bool get trackEvents => false; 22 | @override 23 | bool get useHttpsScheme => true; 24 | } 25 | 26 | class ProdConfig implements BaseConfig { 27 | @override 28 | String get apiHost => dotenv.get("PROD_API_BASE_URL"); 29 | @override 30 | bool get reportErrors => true; 31 | @override 32 | bool get trackEvents => true; 33 | @override 34 | bool get useHttpsScheme => true; 35 | } 36 | -------------------------------------------------------------------------------- /lib/domain/core/extensions/date_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_template/domain/core/extensions/numeric_extensions.dart'; 2 | 3 | extension DateX on DateTime { 4 | String toDateTimeString({ 5 | bool isDDMMYYYY = false, 6 | }) { 7 | final String month = this.month < 10 ? "0${this.month}" : "${this.month}"; 8 | final String day = this.day < 10 ? "0${this.day}" : "${this.day}"; 9 | if (isDDMMYYYY) return "$day-$month-$year"; 10 | 11 | return "$year-$month-$day"; 12 | } 13 | 14 | String toHumanReadableString() { 15 | return "$day ${month.monthNumberToMonth(short: true)} $year"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/domain/core/extensions/extensions.dart: -------------------------------------------------------------------------------- 1 | export 'date_extensions.dart'; 2 | export 'numeric_extensions.dart'; 3 | export 'string_extensions.dart'; 4 | -------------------------------------------------------------------------------- /lib/domain/core/extensions/numeric_extensions.dart: -------------------------------------------------------------------------------- 1 | extension Money on num { 2 | String toMoneyString() { 3 | final String moneyString = formatNumber().replaceAll("-", ""); 4 | 5 | return "€$moneyString"; 6 | } 7 | 8 | String toPercentage() { 9 | return "${(this * 100).toStringAsFixed(0)}%"; 10 | } 11 | 12 | String formatNumber() { 13 | bool isNegative = false; 14 | if (this < 0) { 15 | isNegative = true; 16 | } 17 | final fixedString = toStringAsFixed(2).replaceAll("-", "").split("."); 18 | final String decimalPart = fixedString[1]; 19 | final String wholePart = fixedString[0]; 20 | String formattedNumber = ""; 21 | for (int i = 0; i < wholePart.length; i++) { 22 | final int indexFromBack = wholePart.length - i - 1; 23 | if (i % 3 == 0 && i != 0) { 24 | formattedNumber = ",$formattedNumber"; 25 | } 26 | formattedNumber = wholePart[indexFromBack] + formattedNumber; 27 | } 28 | 29 | return "${isNegative ? "-" : ""}$formattedNumber.$decimalPart"; 30 | } 31 | } 32 | 33 | extension IntX on int { 34 | String monthNumberToMonth({bool short = false}) { 35 | String month; 36 | switch (this) { 37 | case 1: 38 | month = "January"; 39 | break; 40 | case 2: 41 | month = "February"; 42 | break; 43 | case 3: 44 | month = "March"; 45 | break; 46 | case 4: 47 | month = "April"; 48 | break; 49 | case 5: 50 | month = "May"; 51 | break; 52 | case 6: 53 | month = "June"; 54 | break; 55 | case 7: 56 | month = "July"; 57 | break; 58 | case 8: 59 | month = "August"; 60 | break; 61 | case 9: 62 | month = "September"; 63 | break; 64 | case 10: 65 | month = "October"; 66 | break; 67 | case 11: 68 | month = "November"; 69 | break; 70 | case 12: 71 | month = "December"; 72 | break; 73 | default: 74 | throw (Exception("Invalid month number")); 75 | } 76 | return short ? month.substring(0, 3) : month; 77 | } 78 | 79 | int monthNumberToDays({ 80 | required int year, 81 | }) { 82 | List days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 83 | if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) { 84 | days[1] = 29; 85 | } 86 | if (this > 12 || this < 1) { 87 | throw Exception("Invalid month number"); 88 | } 89 | return days[this - 1]; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /lib/domain/core/extensions/string_extensions.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:flutter_template/domain/core/extensions/numeric_extensions.dart'; 4 | 5 | 6 | extension StringX on String { 7 | String formatCategory() { 8 | final String formattedCategory = 9 | "${this[0].toUpperCase()}${substring(1)}".replaceAll("_", " "); 10 | 11 | return formattedCategory; 12 | } 13 | 14 | String toFormattedName() { 15 | final String formattedName = 16 | "${this[0].toUpperCase()}${substring(1).toLowerCase()}"; 17 | 18 | return formattedName; 19 | } 20 | 21 | String nameInitials() { 22 | final List nameComponents = trim().split(" "); 23 | 24 | return nameComponents.length == 1 25 | ? nameComponents[0][0] 26 | : nameComponents[0][0] + nameComponents[1][0]; 27 | } 28 | 29 | String mask({String maskingCharacter = "•"}) { 30 | final String maskedString = 31 | "${maskingCharacter * 6} ${substring(length - 4)}"; 32 | 33 | return maskedString; 34 | } 35 | } 36 | 37 | extension StringDateExtensions on String { 38 | String toHumanDateTime() { 39 | try { 40 | final DateTime dateTime = DateTime.parse(this); 41 | 42 | return "${dateTime.day} ${dateTime.month.monthNumberToMonth(short: true)} ${dateTime.year}"; 43 | } catch (e) { 44 | log(e.toString()); 45 | final String reversedDateTime = reverseDateFormat(); 46 | final DateTime dateTime = DateTime.parse(reversedDateTime); 47 | 48 | return "${dateTime.day} ${dateTime.month.monthNumberToMonth(short: true)} ${dateTime.year}"; 49 | } 50 | } 51 | 52 | DateTime toDateTime() { 53 | if (isEmpty) return DateTime.now(); 54 | try { 55 | final DateTime dateTime = DateTime.parse(this); 56 | 57 | return dateTime; 58 | } catch (e) { 59 | log(e.toString()); 60 | final String reversedDateTime = reverseDateFormat(); 61 | final DateTime dateTime = DateTime.parse(reversedDateTime); 62 | 63 | return dateTime; 64 | } 65 | } 66 | 67 | String reverseDateFormat() { 68 | final String reversedDateTime = split("-").reversed.toList().join("-"); 69 | 70 | return reversedDateTime; 71 | } 72 | } 73 | 74 | extension StringCasingExtensions on String { 75 | //TODO: Add methods for kebab, pascal, snake cases 76 | String toCapitalized() { 77 | return length > 0 78 | ? '${this[0].toUpperCase()}${substring(1).toLowerCase()}' 79 | : ''; 80 | } 81 | 82 | String toSentenceCase() => toCapitalized(); 83 | 84 | String toTitleCase() { 85 | return replaceAll(RegExp(' +'), ' ') 86 | .split(' ') 87 | .map((str) => str.toCapitalized()) 88 | .join(' '); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /lib/domain/core/generated/assets.gen.dart: -------------------------------------------------------------------------------- 1 | /// GENERATED CODE - DO NOT MODIFY BY HAND 2 | /// ***************************************************** 3 | /// FlutterGen 4 | /// ***************************************************** 5 | 6 | // coverage:ignore-file 7 | // ignore_for_file: type=lint 8 | // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal 9 | 10 | import 'package:flutter/widgets.dart'; 11 | 12 | class $AssetsFilesGen { 13 | const $AssetsFilesGen(); 14 | 15 | /// File path: assets/files/countries.json 16 | String get countries => 'assets/files/countries.json'; 17 | 18 | /// File path: assets/files/currencies.json 19 | String get currencies => 'assets/files/currencies.json'; 20 | 21 | /// List of all assets 22 | List get values => [countries, currencies]; 23 | } 24 | 25 | class Assets { 26 | Assets._(); 27 | 28 | static const $AssetsFilesGen files = $AssetsFilesGen(); 29 | } 30 | 31 | class AssetGenImage { 32 | const AssetGenImage(this._assetName); 33 | 34 | final String _assetName; 35 | 36 | Image image({ 37 | Key? key, 38 | AssetBundle? bundle, 39 | ImageFrameBuilder? frameBuilder, 40 | ImageErrorWidgetBuilder? errorBuilder, 41 | String? semanticLabel, 42 | bool excludeFromSemantics = false, 43 | double? scale, 44 | double? width, 45 | double? height, 46 | Color? color, 47 | Animation? opacity, 48 | BlendMode? colorBlendMode, 49 | BoxFit? fit, 50 | AlignmentGeometry alignment = Alignment.center, 51 | ImageRepeat repeat = ImageRepeat.noRepeat, 52 | Rect? centerSlice, 53 | bool matchTextDirection = false, 54 | bool gaplessPlayback = false, 55 | bool isAntiAlias = false, 56 | String? package, 57 | FilterQuality filterQuality = FilterQuality.low, 58 | int? cacheWidth, 59 | int? cacheHeight, 60 | }) { 61 | return Image.asset( 62 | _assetName, 63 | key: key, 64 | bundle: bundle, 65 | frameBuilder: frameBuilder, 66 | errorBuilder: errorBuilder, 67 | semanticLabel: semanticLabel, 68 | excludeFromSemantics: excludeFromSemantics, 69 | scale: scale, 70 | width: width, 71 | height: height, 72 | color: color, 73 | opacity: opacity, 74 | colorBlendMode: colorBlendMode, 75 | fit: fit, 76 | alignment: alignment, 77 | repeat: repeat, 78 | centerSlice: centerSlice, 79 | matchTextDirection: matchTextDirection, 80 | gaplessPlayback: gaplessPlayback, 81 | isAntiAlias: isAntiAlias, 82 | package: package, 83 | filterQuality: filterQuality, 84 | cacheWidth: cacheWidth, 85 | cacheHeight: cacheHeight, 86 | ); 87 | } 88 | 89 | ImageProvider provider() => AssetImage(_assetName); 90 | 91 | String get path => _assetName; 92 | 93 | String get keyName => _assetName; 94 | } 95 | -------------------------------------------------------------------------------- /lib/domain/core/generated/fonts.gen.dart: -------------------------------------------------------------------------------- 1 | /// GENERATED CODE - DO NOT MODIFY BY HAND 2 | /// ***************************************************** 3 | /// FlutterGen 4 | /// ***************************************************** 5 | 6 | // coverage:ignore-file 7 | // ignore_for_file: type=lint 8 | // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal 9 | 10 | class FontFamily { 11 | FontFamily._(); 12 | 13 | /// Font family: Roboto 14 | static const String roboto = 'Roboto'; 15 | } 16 | -------------------------------------------------------------------------------- /lib/domain/core/helpers/countries_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:flutter_template/domain/core/generated/assets.gen.dart'; 5 | import 'package:flutter_template/domain/core/models/country.dart'; 6 | 7 | class CountriesHelper { 8 | static late List _countries; 9 | 10 | static List get countries => _countries; 11 | 12 | static Future loadCountriesFromFile() async { 13 | final fileString = await rootBundle.loadString(Assets.files.countries); 14 | final List countriesMapList = json.decode(fileString); 15 | 16 | _countries = countriesMapList 17 | .map((countryMap) => Country.fromMap(countryMap)) 18 | .toList(); 19 | } 20 | 21 | static Country getCountryFromCode(String countryCode) { 22 | return _countries.firstWhere( 23 | (country) => country.code == countryCode, 24 | orElse: () => getCountryFromName(countryCode), 25 | ); 26 | } 27 | 28 | static Country getCountryFromName(String countryName) { 29 | return _countries.firstWhere( 30 | (country) => country.name == countryName, 31 | ); 32 | } 33 | 34 | static Country? tryGetCountryFromCode(String countryCode) { 35 | final int indexOfCountry = _countries.indexWhere( 36 | (country) => country.code.toLowerCase() == countryCode.toLowerCase(), 37 | ); 38 | if (indexOfCountry == -1) return null; 39 | 40 | return _countries[indexOfCountry]; 41 | } 42 | 43 | static Country? tryGetCountryFromName(String countryName) { 44 | final int indexOfCountry = _countries.indexWhere( 45 | (country) => country.name.toLowerCase() == countryName.toLowerCase(), 46 | ); 47 | if (indexOfCountry == -1) return null; 48 | 49 | return _countries[indexOfCountry]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/domain/core/helpers/currencies_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/services.dart'; 4 | import 'package:flutter_template/domain/core/generated/assets.gen.dart'; 5 | import 'package:flutter_template/domain/core/models/currency.dart'; 6 | 7 | class CurrenciesHelper { 8 | static late List _currencies; 9 | 10 | static List get currencies => _currencies; 11 | 12 | static Future loadCurrenciesFromFile() async { 13 | final fileString = await rootBundle.loadString(Assets.files.currencies); 14 | final List currenciesMapList = json.decode(fileString); 15 | 16 | _currencies = currenciesMapList 17 | .map((currencyMap) => Currency.fromMap(currencyMap)) 18 | .toList(); 19 | } 20 | 21 | static Currency getCurrencyFromCode(String currencyCode) { 22 | return _currencies.firstWhere( 23 | (currency) => currency.code == currencyCode, 24 | ); 25 | } 26 | 27 | static String getCurrencySymbolFromCode(String currencyCode) { 28 | return _currencies 29 | .firstWhere( 30 | (currency) => currency.code == currencyCode, 31 | ) 32 | .symbol; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/domain/core/helpers/decimal_text_input_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | class DecimalTextInputFormatter extends TextInputFormatter { 6 | DecimalTextInputFormatter({this.decimalRange}) 7 | : assert(decimalRange == null || decimalRange > 0); 8 | 9 | final int? decimalRange; 10 | 11 | @override 12 | TextEditingValue formatEditUpdate( 13 | TextEditingValue oldValue, // unused. 14 | TextEditingValue newValue, 15 | ) { 16 | TextSelection newSelection = newValue.selection; 17 | String truncated = newValue.text; 18 | 19 | if (decimalRange != null) { 20 | String value = newValue.text; 21 | 22 | if (value.contains(".") && 23 | value.substring(value.indexOf(".") + 1).length > decimalRange!) { 24 | truncated = oldValue.text; 25 | newSelection = oldValue.selection; 26 | } else if (value == ".") { 27 | truncated = "0."; 28 | 29 | newSelection = newValue.selection.copyWith( 30 | baseOffset: math.min(truncated.length, truncated.length + 1), 31 | extentOffset: math.min(truncated.length, truncated.length + 1), 32 | ); 33 | } 34 | 35 | return TextEditingValue( 36 | text: truncated, 37 | selection: newSelection, 38 | composing: TextRange.empty, 39 | ); 40 | } 41 | 42 | return newValue; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/domain/core/helpers/secure_storage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 2 | 3 | class Storage { 4 | static final Storage _instance = Storage._internal(); 5 | 6 | factory Storage() => _instance; 7 | 8 | Storage._internal(); 9 | 10 | FlutterSecureStorage secureStorage = const FlutterSecureStorage(); 11 | String token = ''; 12 | } 13 | -------------------------------------------------------------------------------- /lib/domain/core/helpers/utility.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:flutter_template/domain/core/constants/constants.dart'; 4 | import 'package:url_launcher/url_launcher_string.dart'; 5 | 6 | class Utility { 7 | static launchURL(String url) async { 8 | if (await canLaunchUrlString(url)) { 9 | log("Launching url: $url"); 10 | await launchUrlString(url); 11 | } else { 12 | log('Could not launch $url'); 13 | } 14 | } 15 | 16 | static Future sendSupportEmail() async { 17 | final Uri params = Uri( 18 | scheme: 'mailto', 19 | path: AppConstants.mailTo, 20 | query: 21 | 'subject=${AppConstants.mailSubject}&body=${AppConstants.mailBody}', 22 | ); 23 | 24 | final String url = params.toString(); 25 | launchURL(url); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/domain/core/l10n/app_localizations_en.dart: -------------------------------------------------------------------------------- 1 | import 'app_localizations.dart'; 2 | 3 | /// The translations for English (`en`). 4 | class AppLocalizationsEn extends AppLocalizations { 5 | AppLocalizationsEn([String locale = 'en']) : super(locale); 6 | 7 | @override 8 | String get thisFieldIsRequired => 'This field is required'; 9 | 10 | @override 11 | String get pleaseEnterAnEmailAddress => 'Please enter an email address'; 12 | 13 | @override 14 | String get pleaseEnterAValidEmailAddress => 'Please enter a valid email address'; 15 | 16 | @override 17 | String get thisFieldCannotExceed100characters => 'This field cannot exceed 100 characters'; 18 | 19 | @override 20 | String get pleaseEnterAPhoneNumber => 'Please enter a phone number'; 21 | 22 | @override 23 | String get pleaseEnterAValidPhoneNumber => 'Please enter a valid phone number'; 24 | 25 | @override 26 | String get pleaseEnterAPassword => 'Please enter a password'; 27 | 28 | @override 29 | String get passwordTooShort => 'Password too short. Please enter a password of atleast 6 length'; 30 | 31 | @override 32 | String get dontForgetYourName => 'Don’t forget your name!'; 33 | 34 | @override 35 | String get invalidName => 'Invalid Name. Only alphabets allowed.'; 36 | 37 | @override 38 | String get pleaseEnterAnAmount => 'Please enter an amount'; 39 | 40 | @override 41 | String get pleaseEnterValidAmount => 'Please enter a valid amount'; 42 | 43 | @override 44 | String get pleaseEnterValidDecimal => 'Please enter a valid decimal value'; 45 | 46 | @override 47 | String get maximumAmountCannotExceed => 'Maximum amount cannot exceed 100,000'; 48 | 49 | @override 50 | String get validIntegerValue => 'Please enter a valid integer value'; 51 | 52 | @override 53 | String get validTaxRate => 'Please enter a valid rate'; 54 | 55 | @override 56 | String get rateShouldBeInRange => 'The rate should be in range 0-100'; 57 | 58 | @override 59 | String get enterAValidPostalCode => 'Please enter a valid postal code'; 60 | } 61 | -------------------------------------------------------------------------------- /lib/domain/core/l10n/app_localizations_es.dart: -------------------------------------------------------------------------------- 1 | import 'app_localizations.dart'; 2 | 3 | /// The translations for Spanish Castilian (`es`). 4 | class AppLocalizationsEs extends AppLocalizations { 5 | AppLocalizationsEs([String locale = 'es']) : super(locale); 6 | 7 | @override 8 | String get thisFieldIsRequired => 'Este espacio es requerido'; 9 | 10 | @override 11 | String get pleaseEnterAnEmailAddress => 'Por favor, ingresa tu correo electrónico'; 12 | 13 | @override 14 | String get pleaseEnterAValidEmailAddress => 'Por favor, ingresa un correo electrónico valido'; 15 | 16 | @override 17 | String get thisFieldCannotExceed100characters => 'Este espacio no puede exceder los 100 carácteres'; 18 | 19 | @override 20 | String get pleaseEnterAPhoneNumber => 'Por favor, ingresa tu número de teléfono'; 21 | 22 | @override 23 | String get pleaseEnterAValidPhoneNumber => 'Por favor, ingresa un número de teléfono valido'; 24 | 25 | @override 26 | String get pleaseEnterAPassword => 'Por favor, ingresa una contraseña'; 27 | 28 | @override 29 | String get passwordTooShort => 'Contraseña muy corta. Por favor, ingresa una contraseña con al menos 6 carácteres'; 30 | 31 | @override 32 | String get dontForgetYourName => '¡No te olvides de tu nombre!'; 33 | 34 | @override 35 | String get invalidName => 'Nombre invalido. Solo se permiten letras.'; 36 | 37 | @override 38 | String get pleaseEnterAnAmount => 'Por favor, ingresa un monto'; 39 | 40 | @override 41 | String get pleaseEnterValidAmount => 'Por favor, ingresa un monto valido'; 42 | 43 | @override 44 | String get pleaseEnterValidDecimal => 'Introduce un número decimal valido'; 45 | 46 | @override 47 | String get maximumAmountCannotExceed => 'El monto máximo no puede ser mayor a 100,000'; 48 | 49 | @override 50 | String get validIntegerValue => 'Introduce un valor entero valido'; 51 | 52 | @override 53 | String get validTaxRate => 'Por favor, ingresa una tarifa valida'; 54 | 55 | @override 56 | String get rateShouldBeInRange => 'La tarifa debe estar en un rango de 0-100'; 57 | 58 | @override 59 | String get enterAValidPostalCode => 'Introduce un código postal valido'; 60 | } 61 | -------------------------------------------------------------------------------- /lib/domain/core/l10n/untranslated_strings.arb: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /lib/domain/core/models/country.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:equatable/equatable.dart'; 4 | 5 | class Country extends Equatable { 6 | final String name; 7 | final String dialCode; 8 | final String code; 9 | const Country({ 10 | required this.name, 11 | required this.dialCode, 12 | required this.code, 13 | }); 14 | 15 | Country copyWith({ 16 | String? name, 17 | String? dialCode, 18 | String? code, 19 | }) { 20 | return Country( 21 | name: name ?? this.name, 22 | dialCode: dialCode ?? this.dialCode, 23 | code: code ?? this.code, 24 | ); 25 | } 26 | 27 | Map toMap() { 28 | return { 29 | 'name': name, 30 | 'dialCode': dialCode, 31 | 'code': code, 32 | }; 33 | } 34 | 35 | factory Country.fromMap(Map map) { 36 | return Country( 37 | name: map['name'] ?? '', 38 | dialCode: map['dial_code'] ?? '', 39 | code: map['code'] ?? '', 40 | ); 41 | } 42 | 43 | String toJson() => json.encode(toMap()); 44 | 45 | factory Country.fromJson(String source) => 46 | Country.fromMap(json.decode(source)); 47 | 48 | @override 49 | String toString() => 'Country(name: $name, dialCode: $dialCode, code: $code)'; 50 | 51 | @override 52 | List get props => [name, dialCode, code]; 53 | } 54 | -------------------------------------------------------------------------------- /lib/domain/core/models/currency.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:equatable/equatable.dart'; 4 | 5 | class Currency extends Equatable { 6 | final String code; 7 | final String name; 8 | final String symbol; 9 | const Currency({ 10 | required this.code, 11 | required this.name, 12 | required this.symbol, 13 | }); 14 | 15 | Currency copyWith({ 16 | String? code, 17 | String? name, 18 | String? symbol, 19 | }) { 20 | return Currency( 21 | code: code ?? this.code, 22 | name: name ?? this.name, 23 | symbol: symbol ?? this.symbol, 24 | ); 25 | } 26 | 27 | Map toMap() { 28 | return { 29 | 'code': code, 30 | 'name': name, 31 | 'symbol': symbol, 32 | }; 33 | } 34 | 35 | factory Currency.fromMap(Map map) { 36 | return Currency( 37 | code: map['code'] ?? '', 38 | name: map['name'] ?? '', 39 | symbol: map['symbol'] ?? '', 40 | ); 41 | } 42 | 43 | String toJson() => json.encode(toMap()); 44 | 45 | factory Currency.fromJson(String source) => 46 | Currency.fromMap(json.decode(source)); 47 | 48 | @override 49 | String toString() => 'Currency(code: $code, name: $name, symbol: $symbol)'; 50 | 51 | @override 52 | List get props => [code, name, symbol]; 53 | } 54 | -------------------------------------------------------------------------------- /lib/domain/core/models/model_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:faker/faker.dart'; 2 | import 'package:uuid/uuid.dart'; 3 | 4 | abstract class ModelFactory { 5 | Faker get faker => Faker(); 6 | 7 | String createFakeUuid() { 8 | return const Uuid().v4(); 9 | } 10 | 11 | T generateFake(); 12 | 13 | List generateFakeList({ 14 | required int length, 15 | }) { 16 | return List.generate(length, (index) => generateFake()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/domain/core/models/user.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:equatable/equatable.dart'; 4 | import 'package:flutter_template/domain/core/models/model_factory.dart'; 5 | 6 | class User extends Equatable { 7 | final String firstName; 8 | final String lastName; 9 | final DateTime dob; 10 | const User({ 11 | required this.firstName, 12 | required this.lastName, 13 | required this.dob, 14 | }); 15 | 16 | static User fake() => UserFactory().generateFake(); 17 | static List fakeList({required int length}) => 18 | UserFactory().generateFakeList(length: length); 19 | 20 | User copyWith({ 21 | String? firstName, 22 | String? lastName, 23 | DateTime? dob, 24 | }) { 25 | return User( 26 | firstName: firstName ?? this.firstName, 27 | lastName: lastName ?? this.lastName, 28 | dob: dob ?? this.dob, 29 | ); 30 | } 31 | 32 | Map toMap() { 33 | final result = {}; 34 | 35 | result.addAll({'firstName': firstName}); 36 | result.addAll({'lastName': lastName}); 37 | result.addAll({'dob': dob.millisecondsSinceEpoch}); 38 | 39 | return result; 40 | } 41 | 42 | factory User.fromMap(Map map) { 43 | return User( 44 | firstName: map['firstName'] ?? '', 45 | lastName: map['lastName'] ?? '', 46 | dob: DateTime.fromMillisecondsSinceEpoch(map['dob']), 47 | ); 48 | } 49 | 50 | String toJson() => json.encode(toMap()); 51 | 52 | factory User.fromJson(String source) => User.fromMap(json.decode(source)); 53 | 54 | @override 55 | String toString() => 56 | 'User(firstName: $firstName, lastName: $lastName, dob: $dob)'; 57 | 58 | @override 59 | List get props => [firstName, lastName, dob]; 60 | } 61 | 62 | class UserFactory extends ModelFactory { 63 | @override 64 | User generateFake() { 65 | return User( 66 | firstName: faker.person.firstName(), 67 | lastName: faker.person.lastName(), 68 | dob: faker.date.dateTime(), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/infrastructure/core/dev/logging_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:logger/logger.dart'; 2 | 3 | class LoggingService { 4 | static Logger logger = Logger( 5 | filter: null, // Use the default LogFilter (-> only log in debug mode) 6 | printer: PrettyPrinter( 7 | methodCount: 2, // number of method calls to be displayed 8 | errorMethodCount: 8, // number of method calls if stacktrace is provided 9 | lineLength: 120, // width of the output 10 | colors: true, // Colorful log messages 11 | printEmojis: true, // Print an emoji for each log message 12 | printTime: false, // Should each log print contain a timestamp 13 | ), // Use the PrettyPrinter to format and print log 14 | output: null, // Use the default LogOutput (-> send everything to console) 15 | level: null, 16 | ); 17 | static void verbose(dynamic message) => logger.v(message); 18 | 19 | static void debug(dynamic message) => logger.d(message); 20 | 21 | static void info(dynamic message) => logger.i(message); 22 | 23 | static void warning(dynamic message) => logger.w(message); 24 | 25 | static void error(dynamic message) => logger.e(message); 26 | } 27 | -------------------------------------------------------------------------------- /lib/infrastructure/core/getters.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | 3 | // ignore: avoid_classes_with_only_static_members 4 | class Getters { 5 | static String currentUserUid() { 6 | return FirebaseAuth.instance.currentUser == null 7 | ? "" 8 | : FirebaseAuth.instance.currentUser!.uid; 9 | } 10 | 11 | static String currentUserEmail() { 12 | return FirebaseAuth.instance.currentUser!.email!; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/firebase/firebase_helpers.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | 3 | extension FirestoreX on FirebaseFirestore { 4 | CollectionReference get dataCollection => collection('data'); 5 | CollectionReference get purchasesCollection => collection('purchases'); 6 | } 7 | 8 | extension CollectionReferenceX on CollectionReference { 9 | DocumentReference get featuresDocument => doc('Features'); 10 | } 11 | 12 | extension DocumentReferenceX on DocumentReference { 13 | CollectionReference get factorsCollection => collection('factors'); 14 | CollectionReference get valuesCollection => collection('values'); 15 | } 16 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/firebase/firebase_injectable_modules.dart: -------------------------------------------------------------------------------- 1 | import 'package:cloud_firestore/cloud_firestore.dart'; 2 | import 'package:cloud_functions/cloud_functions.dart'; 3 | import 'package:firebase_auth/firebase_auth.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | 6 | @module 7 | abstract class FirebaseInjectableModule { 8 | @lazySingleton 9 | FirebaseAuth get firebaseAuth => FirebaseAuth.instance; 10 | @lazySingleton 11 | FirebaseFirestore get firestore => FirebaseFirestore.instance; 12 | 13 | @lazySingleton 14 | FirebaseFunctions get firebaseFunctions => FirebaseFunctions.instance; 15 | } 16 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/graphql/graphql_mutations.dart: -------------------------------------------------------------------------------- 1 | class GraphQLMutations { 2 | static const String deleteUser = ''''''; 3 | } 4 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/graphql/graphql_queries.dart: -------------------------------------------------------------------------------- 1 | class GraphQLQueries { 2 | static const String homePage = ''''''; 3 | } 4 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/graphql/graphql_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 3 | import 'package:graphql_flutter/graphql_flutter.dart'; 4 | 5 | class GraphQLService { 6 | late GraphQLClient _client; 7 | 8 | GraphQLService() { 9 | final HttpLink httpLink = HttpLink( 10 | dotenv.env["GRAPHQL_BASE_URL"]!, 11 | ); 12 | 13 | final AuthLink authLink = AuthLink( 14 | getToken: () async { 15 | // final String userToken = SharedPreferencesService.userToken; 16 | return "Bearer "; 17 | }, 18 | ); 19 | 20 | final Link link = authLink.concat(httpLink); 21 | _client = GraphQLClient( 22 | link: link, 23 | cache: GraphQLCache(store: HiveStore()), 24 | ); 25 | } 26 | 27 | Future performQuery( 28 | String query, { 29 | Map? variables, 30 | }) async { 31 | QueryOptions options; 32 | options = QueryOptions( 33 | document: gql(query), 34 | fetchPolicy: FetchPolicy.cacheAndNetwork, 35 | cacheRereadPolicy: CacheRereadPolicy.mergeOptimistic, 36 | variables: variables ?? {}, 37 | ); 38 | 39 | final result = await _client.query(options); 40 | debugPrint(result.toString()); 41 | 42 | return result; 43 | } 44 | 45 | Future performMutation( 46 | String query, { 47 | Map? variables, 48 | }) async { 49 | MutationOptions options = 50 | MutationOptions(document: gql(query), variables: variables ?? {}); 51 | 52 | final result = await _client.mutate(options); 53 | debugPrint(result.toString()); 54 | 55 | return result; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/rest-api/api_error_interceptors.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | 3 | class AppInterceptors extends Interceptor { 4 | @override 5 | void onError(DioError err, ErrorInterceptorHandler handler) { 6 | switch (err.type) { 7 | case DioErrorType.connectTimeout: 8 | case DioErrorType.sendTimeout: 9 | case DioErrorType.receiveTimeout: 10 | throw DeadlineExceededException(err.requestOptions); 11 | case DioErrorType.response: 12 | switch (err.response?.statusCode) { 13 | case 400: 14 | throw BadRequestException(err.requestOptions); 15 | case 401: 16 | throw UnauthorizedException(err.requestOptions); 17 | case 404: 18 | throw NotFoundException(err.requestOptions); 19 | case 409: 20 | throw ConflictException(err.requestOptions); 21 | case 500: 22 | 23 | throw InternalServerErrorException(err.requestOptions); 24 | } 25 | break; 26 | case DioErrorType.cancel: 27 | break; 28 | case DioErrorType.other: 29 | throw NoInternetConnectionException(err.requestOptions); 30 | } 31 | 32 | return handler.next(err); 33 | } 34 | } 35 | 36 | class BadRequestException extends DioError { 37 | BadRequestException(RequestOptions r) : super(requestOptions: r); 38 | 39 | @override 40 | String toString() { 41 | return 'Invalid request'; 42 | } 43 | } 44 | 45 | class InternalServerErrorException extends DioError { 46 | InternalServerErrorException(RequestOptions r) : super(requestOptions: r); 47 | 48 | @override 49 | String toString() { 50 | return 'Unknown error occurred, please try again later.'; 51 | } 52 | } 53 | 54 | class ConflictException extends DioError { 55 | ConflictException(RequestOptions r) : super(requestOptions: r); 56 | 57 | @override 58 | String toString() { 59 | return 'Conflict occurred'; 60 | } 61 | } 62 | 63 | class UnauthorizedException extends DioError { 64 | UnauthorizedException(RequestOptions r) : super(requestOptions: r); 65 | 66 | @override 67 | String toString() { 68 | return 'Access denied'; 69 | } 70 | } 71 | 72 | class NotFoundException extends DioError { 73 | NotFoundException(RequestOptions r) : super(requestOptions: r); 74 | 75 | @override 76 | String toString() { 77 | return 'The requested information could not be found'; 78 | } 79 | } 80 | 81 | class NoInternetConnectionException extends DioError { 82 | NoInternetConnectionException(RequestOptions r) : super(requestOptions: r); 83 | 84 | @override 85 | String toString() { 86 | return 'No internet connection detected, please try again.'; 87 | } 88 | } 89 | 90 | class DeadlineExceededException extends DioError { 91 | DeadlineExceededException(RequestOptions r) : super(requestOptions: r); 92 | 93 | @override 94 | String toString() { 95 | return 'The connection has timed out, please try again.'; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /lib/infrastructure/core/network/rest-api/api_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:dio/dio.dart'; 2 | import 'package:flutter_template/domain/core/constants/api_constants.dart'; 3 | import 'package:flutter_template/infrastructure/core/network/rest-api/api_error_interceptors.dart'; 4 | 5 | class ApiServiceV2 { 6 | static final BaseOptions options = BaseOptions( 7 | baseUrl: ApiConstants.baseUrl, 8 | connectTimeout: 5000, //5s 9 | receiveTimeout: 15000, //15s 10 | contentType: Headers.jsonContentType, 11 | ); 12 | 13 | Dio dioUnauthorizedClient = Dio(options) 14 | ..interceptors.addAll([ 15 | LogInterceptor(), 16 | AppInterceptors(), 17 | ]); 18 | 19 | Dio dioAuthorizedClient = Dio(options) 20 | ..interceptors.addAll([ 21 | LogInterceptor(), 22 | AppInterceptors(), 23 | ]); 24 | 25 | final interceptor = InterceptorsWrapper( 26 | onRequest: (options, handler) { 27 | // Do something before request is sent 28 | const String userToken = "SharedPreferencesService.userToken"; 29 | options.headers.addAll({ 30 | "Authorization": "Bearer $userToken", 31 | }); 32 | 33 | return handler.next(options); //continue 34 | // If you want to resolve the request with some custom data, 35 | // you can resolve a `Response` object eg: `handler.resolve(response)`. 36 | // If you want to reject the request with a error message, 37 | // you can reject a `DioError` object eg: `handler.reject(dioError)` 38 | }, 39 | onResponse: (response, handler) { 40 | // Do something with response data 41 | return handler.next(response); // continue 42 | // If you want to reject the request with a error message, 43 | // you can reject a `DioError` object eg: `handler.reject(dioError)` 44 | }, 45 | onError: (DioError e, handler) { 46 | // Do something with response error 47 | return handler.next(e); //continue 48 | // If you want to resolve the request with some custom data, 49 | // you can resolve a `Response` object eg: `handler.resolve(response)`. 50 | }, 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /lib/infrastructure/core/system/camera_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:image_picker/image_picker.dart'; 2 | 3 | class CameraService { 4 | static Future captureImage() async { 5 | final ImagePicker picker = ImagePicker(); 6 | final XFile? photo = await picker.pickImage(source: ImageSource.camera); 7 | 8 | return photo?.path; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /lib/infrastructure/core/system/device_info_service.dart: -------------------------------------------------------------------------------- 1 | class DeviceInfoService {} 2 | -------------------------------------------------------------------------------- /lib/infrastructure/core/system/file_picker_service.dart: -------------------------------------------------------------------------------- 1 | import 'package:file_picker/file_picker.dart'; 2 | 3 | class FilePickerService { 4 | static Future pickPdfFile() async { 5 | final FilePickerResult? result = await FilePicker.platform.pickFiles( 6 | type: FileType.custom, 7 | allowedExtensions: ['pdf'], 8 | ); 9 | 10 | return result?.files.single.path; 11 | } 12 | 13 | static Future pickImageFromGallery() async { 14 | final FilePickerResult? result = await FilePicker.platform.pickFiles( 15 | type: FileType.image, 16 | ); 17 | 18 | return result?.files.single.path; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/infrastructure/core/system/permissions_service.dart: -------------------------------------------------------------------------------- 1 | class PermissionsService {} 2 | -------------------------------------------------------------------------------- /lib/infrastructure/core/system/storage_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:flutter_template/domain/core/constants/storage_constants.dart'; 4 | import 'package:shared_preferences/shared_preferences.dart'; 5 | 6 | class StorageService { 7 | static SharedPreferences? _service; 8 | static late String _userToken; 9 | static late String _userId; 10 | static late String _userNickName; 11 | static Future init() async { 12 | _service = await SharedPreferences.getInstance(); 13 | _userToken = _service!.getString(StorageConstants.userToken) ?? ""; 14 | if (_userToken.isNotEmpty) { 15 | try { 16 | // Map userTokenJWT = Jwt.parseJwt(_userToken); 17 | // _userId = userTokenJWT["user_id"]; 18 | } catch (e) { 19 | log(e.toString()); 20 | _userToken = ""; 21 | _userId = ""; 22 | _userNickName = ""; 23 | } 24 | log("Shared preferences service initialized successfully"); 25 | log("User Token: $_userToken"); 26 | log("User Id: $_userId"); 27 | } else { 28 | _userToken = ""; 29 | _userId = ""; 30 | _userNickName = ""; 31 | } 32 | } 33 | 34 | static Future clear() async { 35 | await _service!.clear(); 36 | } 37 | 38 | static Future refreshToken(String newToken) async { 39 | _userToken = newToken; 40 | await _service!.setString(StorageConstants.userToken, _userToken); 41 | // Map userTokenJWT = Jwt.parseJwt(_userToken); 42 | // _userId = userTokenJWT["user_id"]; 43 | // _userNickName = userTokenJWT["nick_name"] ?? ""; 44 | // log("Refreshed token: $newToken"); 45 | } 46 | 47 | static SharedPreferences get instance => _service!; 48 | static String get userToken => _userToken; 49 | static String get userId => _userId; 50 | static String get userName => _userNickName; 51 | static String get fcmToken => _service!.getString("fcm_token") ?? ""; 52 | } 53 | -------------------------------------------------------------------------------- /lib/injection.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | // ignore_for_file: no_leading_underscores_for_library_prefixes 8 | import 'package:cloud_firestore/cloud_firestore.dart' as _i4; 9 | import 'package:cloud_functions/cloud_functions.dart' as _i5; 10 | import 'package:firebase_auth/firebase_auth.dart' as _i3; 11 | import 'package:flutter_template/application/auth/auth_bloc.dart' as _i9; 12 | import 'package:flutter_template/application/settings/settings_bloc.dart' 13 | as _i8; 14 | import 'package:flutter_template/domain/auth/i_auth_facade.dart' as _i6; 15 | import 'package:flutter_template/infrastructure/auth/auth_facade.dart' as _i7; 16 | import 'package:flutter_template/infrastructure/core/network/firebase/firebase_injectable_modules.dart' 17 | as _i10; 18 | import 'package:get_it/get_it.dart' as _i1; 19 | import 'package:injectable/injectable.dart' as _i2; 20 | 21 | /// ignore_for_file: unnecessary_lambdas 22 | /// ignore_for_file: lines_longer_than_80_chars 23 | extension GetItInjectableX on _i1.GetIt { 24 | /// initializes the registration of main-scope dependencies inside of [GetIt] 25 | _i1.GetIt init({ 26 | String? environment, 27 | _i2.EnvironmentFilter? environmentFilter, 28 | }) { 29 | final gh = _i2.GetItHelper( 30 | this, 31 | environment, 32 | environmentFilter, 33 | ); 34 | final firebaseInjectableModule = _$FirebaseInjectableModule(); 35 | gh.lazySingleton<_i3.FirebaseAuth>( 36 | () => firebaseInjectableModule.firebaseAuth); 37 | gh.lazySingleton<_i4.FirebaseFirestore>( 38 | () => firebaseInjectableModule.firestore); 39 | gh.lazySingleton<_i5.FirebaseFunctions>( 40 | () => firebaseInjectableModule.firebaseFunctions); 41 | gh.lazySingleton<_i6.IAuthFacade>(() => _i7.AuthFacade( 42 | gh<_i3.FirebaseAuth>(), 43 | gh<_i4.FirebaseFirestore>(), 44 | )); 45 | gh.factory<_i8.SettingsBloc>(() => _i8.SettingsBloc()); 46 | gh.factory<_i9.AuthBloc>(() => _i9.AuthBloc(gh<_i6.IAuthFacade>())); 47 | return this; 48 | } 49 | } 50 | 51 | class _$FirebaseInjectableModule extends _i10.FirebaseInjectableModule {} 52 | -------------------------------------------------------------------------------- /lib/injection.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_template/injection.config.dart'; 2 | import 'package:get_it/get_it.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | final GetIt getIt = GetIt.instance; 6 | @injectableInit 7 | void configureInjection(String env) { 8 | getIt.init(environment: env); 9 | } 10 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:firebase_core/firebase_core.dart'; 4 | import 'package:firebase_crashlytics/firebase_crashlytics.dart'; 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 8 | import 'package:flutter_template/injection.dart'; 9 | // import 'package:flutter_template/domain/core/environment/environment.dart'; 10 | import 'package:flutter_template/presentation/core/app_widget.dart'; 11 | import 'package:injectable/injectable.dart'; 12 | // import 'package:injectable/injectable.dart'; 13 | 14 | Future main() async { 15 | runZonedGuarded>( 16 | () async { 17 | WidgetsFlutterBinding.ensureInitialized(); 18 | await Firebase.initializeApp(); 19 | await _initializeCrashlytics(); 20 | await dotenv.load(fileName: ".env"); 21 | configureInjection(Environment.prod); 22 | // const String environment = String.fromEnvironment( 23 | // 'ENVIRONMENT', 24 | // defaultValue: Environment.dev, 25 | // ); 26 | // Environment().initConfig(environment); 27 | runApp(AppWidget()); 28 | }, 29 | (error, stack) => FirebaseCrashlytics.instance.recordError(error, stack), 30 | ); 31 | } 32 | 33 | Future _initializeCrashlytics() async { 34 | if (!kIsWeb) { 35 | await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); 36 | } 37 | FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; 38 | } 39 | -------------------------------------------------------------------------------- /lib/presentation/base/base_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/widgets/layout/app_scaffold.dart'; 3 | 4 | class BasePage extends StatelessWidget { 5 | const BasePage({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return AppScaffold( 10 | body: Container(), 11 | ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/presentation/base/home/home_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/lib/presentation/base/home/home_page.dart -------------------------------------------------------------------------------- /lib/presentation/base/profile/profile_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/lib/presentation/base/profile/profile_page.dart -------------------------------------------------------------------------------- /lib/presentation/core/app_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_template/application/auth/auth_bloc.dart'; 4 | import 'package:flutter_template/application/settings/settings_bloc.dart'; 5 | import 'package:flutter_template/domain/core/constants/app_constants.dart'; 6 | import 'package:flutter_template/domain/core/l10n/app_localizations.dart'; 7 | import 'package:flutter_template/injection.dart'; 8 | import 'package:flutter_template/presentation/core/styles/app_theme.dart'; 9 | import 'package:flutter_template/presentation/core/widgets/utility/life_cycle_watcher.dart'; 10 | import 'package:flutter_template/presentation/routes/router.gr.dart'; 11 | 12 | class AppWidget extends StatelessWidget { 13 | AppWidget({Key? key}) : super(key: key); 14 | final _appRouter = AppRouter(); 15 | @override 16 | Widget build(BuildContext context) { 17 | return MultiBlocProvider( 18 | providers: [ 19 | BlocProvider( 20 | create: (context) { 21 | return getIt(); 22 | // ..add(const AuthEvent.checkAuthState()); 23 | }, 24 | ), 25 | BlocProvider( 26 | create: (context) { 27 | return getIt(); 28 | }, 29 | ), 30 | ], 31 | child: LifecycleWatcher( 32 | child: BlocBuilder( 33 | builder: (context, state) { 34 | return MaterialApp.router( 35 | routerDelegate: _appRouter.delegate(), 36 | routeInformationParser: _appRouter.defaultRouteParser(), 37 | title: AppConstants.appName, 38 | debugShowCheckedModeBanner: false, 39 | themeMode: state.appThemeMode, 40 | theme: AppTheme.light, 41 | darkTheme: AppTheme.dark, 42 | supportedLocales: AppLocalizations.supportedLocales, 43 | localizationsDelegates: AppLocalizations.localizationsDelegates, 44 | localeResolutionCallback: (locale, supportedLocales) { 45 | for (final supportedLocale in supportedLocales) { 46 | if (supportedLocale.languageCode == locale!.languageCode && 47 | supportedLocale.countryCode == locale.countryCode) { 48 | return supportedLocale; 49 | } 50 | } 51 | 52 | return supportedLocales.first; 53 | }, 54 | ); 55 | }, 56 | ), 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /lib/presentation/core/pages/landing_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_template/presentation/core/widgets/buttons/rounded_filled_button.dart'; 4 | import 'package:flutter_template/presentation/core/widgets/layout/app_scaffold.dart'; 5 | import 'package:flutter_template/presentation/core/widgets/layout/logo_widget.dart'; 6 | import 'package:flutter_template/presentation/routes/router.gr.dart'; 7 | 8 | class LandingPage extends StatelessWidget { 9 | const LandingPage({Key? key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return AppScaffold( 14 | body: Padding( 15 | padding: const EdgeInsets.symmetric(horizontal: 15), 16 | child: Column( 17 | children: [ 18 | const SizedBox(height: 30), 19 | const AppLogo(size: 30), 20 | const Spacer(), 21 | RoundedFilledButton( 22 | text: "Sign up", 23 | onTap: () { 24 | AutoRouter.of(context).push(const SignupRoute()); 25 | }, 26 | ), 27 | const SizedBox(height: 24.0), 28 | Row( 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | children: [ 31 | const Text( 32 | "Already have an account?", 33 | ), 34 | const SizedBox(width: 5.0), 35 | GestureDetector( 36 | onTap: () { 37 | AutoRouter.of(context).push(const SigninRoute()); 38 | }, 39 | child: const Text( 40 | "Sign in", 41 | ), 42 | ), 43 | ], 44 | ), 45 | const SizedBox(height: 60.0), 46 | ], 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/presentation/core/pages/splash_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:flutter_template/application/auth/auth_bloc.dart'; 5 | import 'package:flutter_template/presentation/core/widgets/layout/app_scaffold.dart'; 6 | import 'package:flutter_template/presentation/routes/router.gr.dart'; 7 | 8 | class SplashPage extends StatelessWidget { 9 | const SplashPage({Key? key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return BlocConsumer( 14 | listener: (context, state) { 15 | if (state.isUserSignedin) { 16 | if (!state.isLoading) { 17 | Future.delayed(const Duration(milliseconds: 1000), () { 18 | AutoRouter.of(context).replace(const BaseRoute()); 19 | }); 20 | } 21 | } else { 22 | Future.delayed(const Duration(milliseconds: 1000), () { 23 | AutoRouter.of(context).replace(const OnboardingRoute()); 24 | }); 25 | } 26 | }, 27 | builder: (context, state) { 28 | return AppScaffold( 29 | appBar: AppBar( 30 | title: const Text(""), 31 | ), 32 | body: Container(), 33 | ); 34 | }, 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/presentation/core/pages/update_app_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_template/domain/core/helpers/utility.dart'; 4 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 5 | import 'package:flutter_template/presentation/routes/router.gr.dart'; 6 | 7 | class UpdateAppPage extends StatefulWidget { 8 | const UpdateAppPage({Key? key}) : super(key: key); 9 | 10 | @override 11 | UpdateAppPageState createState() => UpdateAppPageState(); 12 | } 13 | 14 | class UpdateAppPageState extends State 15 | with WidgetsBindingObserver { 16 | @override 17 | void initState() { 18 | super.initState(); 19 | WidgetsBinding.instance.addObserver(this); 20 | } 21 | 22 | @override 23 | void dispose() { 24 | WidgetsBinding.instance.removeObserver(this); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | void didChangeAppLifecycleState(AppLifecycleState state) { 30 | if (state == AppLifecycleState.resumed) { 31 | AutoRouter.of(context).replace(const SplashRoute()); 32 | } 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | backgroundColor: AppColors.white, 39 | body: Container( 40 | margin: const EdgeInsets.symmetric(horizontal: 36), 41 | child: Column( 42 | mainAxisAlignment: MainAxisAlignment.center, 43 | children: [ 44 | Image.asset("assets/images/corgee_square_icon.png"), 45 | const Text( 46 | "New Update is available", 47 | textAlign: TextAlign.center, 48 | ), 49 | const SizedBox(height: 20), 50 | const Text( 51 | "The current version of app is no longer supported. We apologize for any inconvenience we may have caused you", 52 | style: TextStyle( 53 | fontSize: 14, 54 | color: AppColors.lightGrey, 55 | ), 56 | textAlign: TextAlign.center, 57 | ), 58 | const SizedBox(height: 30), 59 | Container( 60 | // width: fullWidth(context), 61 | margin: const EdgeInsets.symmetric(vertical: 35), 62 | child: TextButton( 63 | onPressed: () { 64 | Utility.launchURL( 65 | "https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox", 66 | ); 67 | }, 68 | child: const Text('Update now'), 69 | ), 70 | ), 71 | ], 72 | ), 73 | ), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/custom_shimmer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | import 'package:shimmer/shimmer.dart'; 4 | 5 | class CustomShimmer extends StatelessWidget { 6 | const CustomShimmer({ 7 | Key? key, 8 | required this.child, 9 | this.baseColor, 10 | this.highlightColor, 11 | }) : super(key: key); 12 | final Widget child; 13 | final Color? baseColor; 14 | final Color? highlightColor; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Shimmer.fromColors( 19 | baseColor: baseColor ?? AppColors.extraLightGrey, 20 | highlightColor: highlightColor ?? Colors.white60, 21 | child: child, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/shimmer/custom_shimmer.dart'; 3 | import 'package:flutter_template/presentation/core/shimmer/shimmer_skeleton_bar.dart'; 4 | 5 | class ShimmerCard extends StatelessWidget { 6 | const ShimmerCard({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Card( 11 | margin: const EdgeInsets.all(20), 12 | child: Padding( 13 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), 14 | child: CustomShimmer( 15 | child: Column( 16 | crossAxisAlignment: CrossAxisAlignment.start, 17 | children: [ 18 | const ShimmerSkeletonBar(), 19 | const ShimmerSkeletonBar(width: 300), 20 | const SizedBox(height: 20), 21 | Row( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | children: const [ 24 | ShimmerSkeletonBar(width: 80), 25 | ShimmerSkeletonBar(width: 40), 26 | ], 27 | ), 28 | ], 29 | ), 30 | ), 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/shimmer/shimmer_list_tile.dart'; 3 | 4 | class ShimmerList extends StatelessWidget { 5 | const ShimmerList({ 6 | Key? key, 7 | this.margin, 8 | this.noOfTiles, 9 | }) : super(key: key); 10 | final EdgeInsets? margin; 11 | final int? noOfTiles; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Card( 16 | margin: 17 | margin ?? const EdgeInsets.symmetric(horizontal: 20, vertical: 20), 18 | child: ListView.builder( 19 | itemCount: noOfTiles ?? 10, 20 | physics: const NeverScrollableScrollPhysics(), 21 | shrinkWrap: true, 22 | padding: const EdgeInsets.symmetric(vertical: 10), 23 | itemBuilder: (BuildContext context, int index) { 24 | return const ShimmerListTile(); 25 | }, 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_list_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/shimmer/custom_shimmer.dart'; 3 | import 'package:flutter_template/presentation/core/shimmer/shimmer_skeleton_bar.dart'; 4 | import 'package:flutter_template/presentation/core/shimmer/shimmer_skeleton_circle.dart'; 5 | 6 | class ShimmerListTile extends StatelessWidget { 7 | const ShimmerListTile({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return ListTile( 12 | contentPadding: const EdgeInsets.symmetric( 13 | horizontal: 20, 14 | vertical: 8, 15 | ), 16 | minLeadingWidth: 0, 17 | title: CustomShimmer( 18 | child: Row( 19 | children: [ 20 | const ShimmerSkeletonCircle(radius: 50), 21 | const SizedBox(width: 14), 22 | Expanded( 23 | child: Column( 24 | mainAxisSize: MainAxisSize.min, 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | children: const [ 27 | ShimmerSkeletonBar(width: 150), 28 | SizedBox(height: 5), 29 | ShimmerSkeletonBar(width: 80), 30 | ], 31 | ), 32 | ), 33 | const SizedBox(width: 10), 34 | Column( 35 | mainAxisSize: MainAxisSize.min, 36 | crossAxisAlignment: CrossAxisAlignment.end, 37 | children: const [ 38 | ShimmerSkeletonBar(width: 50), 39 | SizedBox(height: 5), 40 | ShimmerSkeletonBar(), 41 | ], 42 | ), 43 | ], 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_section.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/shimmer/custom_shimmer.dart'; 3 | import 'package:flutter_template/presentation/core/shimmer/shimmer_card.dart'; 4 | import 'package:flutter_template/presentation/core/shimmer/shimmer_skeleton_bar.dart'; 5 | 6 | class ShimmerSection extends StatelessWidget { 7 | const ShimmerSection({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Column( 12 | crossAxisAlignment: CrossAxisAlignment.start, 13 | children: [ 14 | CustomShimmer( 15 | child: Padding( 16 | padding: const EdgeInsets.symmetric(horizontal: 20), 17 | child: Row( 18 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 19 | children: const [ 20 | ShimmerSkeletonBar(width: 80), 21 | ShimmerSkeletonBar(width: 40), 22 | ], 23 | ), 24 | ), 25 | ), 26 | const ShimmerCard(), 27 | ], 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_skeleton_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | 4 | class ShimmerSkeletonBar extends StatelessWidget { 5 | const ShimmerSkeletonBar({ 6 | Key? key, 7 | this.width, 8 | this.height, 9 | }) : super(key: key); 10 | final double? width; 11 | final double? height; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | height: height ?? 18, 17 | width: width ?? 40, 18 | margin: const EdgeInsets.symmetric(vertical: 5), 19 | decoration: BoxDecoration( 20 | color: AppColors.lightGrey, 21 | borderRadius: BorderRadius.circular(20), 22 | ), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/presentation/core/shimmer/shimmer_skeleton_circle.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | 4 | class ShimmerSkeletonCircle extends StatelessWidget { 5 | const ShimmerSkeletonCircle({ 6 | Key? key, 7 | this.radius, 8 | }) : super(key: key); 9 | final double? radius; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Container( 14 | height: radius ?? 30, 15 | width: radius ?? 30, 16 | decoration: const BoxDecoration( 17 | color: AppColors.lightGrey, 18 | shape: BoxShape.circle, 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/presentation/core/styles/app_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// Colors used in the application 4 | class AppColors { 5 | AppColors._(); 6 | static const Color primary = Color(0xFF000000); 7 | static const Color secondary = Color(0xffDEE9FF); 8 | static const Color white = Color(0xFFFFFFFF); 9 | static const Color black = Color(0xFFFFFFFF); 10 | static const Color scaffoldColor = Color(0xFFF8F8F8); 11 | static const Color textFieldBorder = Color(0xFFE7ECF3); 12 | static const Color lightGrey = Color(0xffAAB8C2); 13 | static const Color extraLightGrey = Color(0xffE1E8ED); 14 | static const Color red = Color(0xffE54F4F); 15 | static const Color mildBlue = Color(0xff5979C9); 16 | static const Color green = Color(0xff00C689); 17 | } 18 | -------------------------------------------------------------------------------- /lib/presentation/core/styles/app_text_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppTextTheme { 4 | static TextTheme get light => ThemeData.light().textTheme.copyWith( 5 | headline1: const TextStyle(fontSize: 20), 6 | headline2: const TextStyle(fontSize: 26), 7 | headline3: const TextStyle(fontSize: 24), 8 | headline4: const TextStyle(fontSize: 22), 9 | headline5: const TextStyle(fontSize: 20), 10 | headline6: const TextStyle(fontSize: 18), 11 | subtitle1: const TextStyle(fontSize: 16), 12 | subtitle2: const TextStyle(fontSize: 14), 13 | bodyText1: const TextStyle(), 14 | bodyText2: const TextStyle(), 15 | caption: const TextStyle(), 16 | button: const TextStyle(fontSize: 14), 17 | overline: const TextStyle(), 18 | ); 19 | static TextTheme get dark => ThemeData.dark().textTheme.copyWith( 20 | headline1: const TextStyle(fontSize: 20), 21 | headline2: const TextStyle(fontSize: 26), 22 | headline3: const TextStyle(fontSize: 24), 23 | headline4: const TextStyle(fontSize: 22), 24 | headline5: const TextStyle(fontSize: 20), 25 | headline6: const TextStyle(fontSize: 18), 26 | subtitle1: const TextStyle(fontSize: 16), 27 | subtitle2: const TextStyle(fontSize: 14), 28 | bodyText1: const TextStyle(), 29 | bodyText2: const TextStyle(), 30 | caption: const TextStyle(), 31 | button: const TextStyle(fontSize: 14), 32 | overline: const TextStyle(), 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/core/styles/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | import 'package:flutter_template/presentation/core/styles/app_text_theme.dart'; 4 | 5 | class AppTheme { 6 | static ThemeData get dark => ThemeData.dark().copyWith( 7 | textTheme: AppTextTheme.dark, 8 | ); 9 | // ignore: long-method 10 | static ThemeData get light => ThemeData.light().copyWith( 11 | primaryColor: const Color(0xFF2A59C3), 12 | brightness: Brightness.dark, 13 | scaffoldBackgroundColor: Colors.white, 14 | primaryTextTheme: AppTextTheme.light, 15 | primaryIconTheme: const IconThemeData(), 16 | appBarTheme: const AppBarTheme(), 17 | materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, 18 | visualDensity: VisualDensity.adaptivePlatformDensity, 19 | inputDecorationTheme: InputDecorationTheme( 20 | border: OutlineInputBorder( 21 | borderRadius: BorderRadius.circular(10), 22 | ), 23 | ), 24 | textButtonTheme: TextButtonThemeData( 25 | style: TextButton.styleFrom( 26 | textStyle: const TextStyle( 27 | color: AppColors.white, 28 | fontSize: 20, 29 | fontWeight: FontWeight.w700, 30 | ), 31 | shape: RoundedRectangleBorder( 32 | borderRadius: BorderRadius.circular(100), 33 | ), 34 | ), 35 | ), 36 | dialogTheme: DialogTheme( 37 | shape: 38 | RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), 39 | ), 40 | // colorScheme: ColorScheme(background: Colors.white), 41 | ); 42 | static TextStyle linkStyle = dark.textTheme.bodyMedium!.copyWith( 43 | shadows: const [ 44 | Shadow( 45 | offset: Offset(0, -3), 46 | ), 47 | ], 48 | color: Colors.transparent, 49 | decoration: TextDecoration.underline, 50 | decorationColor: AppColors.secondary, 51 | decorationThickness: 2, 52 | ); 53 | } 54 | 55 | const kGradientColors = [ 56 | Color(0xFF5575F7), 57 | Color(0xFF5786F9), 58 | Color(0xFF5CA9FC), 59 | Color(0xFF5EB7FE), 60 | Color(0xFF60C2FF), 61 | ]; 62 | 63 | const kGradientBackgroundDecoration = BoxDecoration( 64 | gradient: LinearGradient( 65 | begin: Alignment.bottomLeft, 66 | end: Alignment.topRight, 67 | colors: kGradientColors, 68 | ), 69 | ); 70 | 71 | List kBoxShadow = [ 72 | const BoxShadow(blurRadius: 6, color: Colors.grey, spreadRadius: 6.0), 73 | ]; 74 | -------------------------------------------------------------------------------- /lib/presentation/core/styles/styles.dart: -------------------------------------------------------------------------------- 1 | export 'app_colors.dart'; 2 | export 'app_text_theme.dart'; 3 | export 'app_theme.dart'; 4 | export 'text_styles.dart'; 5 | -------------------------------------------------------------------------------- /lib/presentation/core/styles/text_styles.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TextStyles { 4 | const TextStyles._(); 5 | 6 | static const double _scale = 1.0; 7 | 8 | static TextStyle get headline1 => const TextStyle(fontSize: 20 * _scale); 9 | static TextStyle get headline2 => const TextStyle(fontSize: 26 * _scale); 10 | static TextStyle get headline3 => const TextStyle(fontSize: 24 * _scale); 11 | static TextStyle get headline4 => const TextStyle(fontSize: 22 * _scale); 12 | static TextStyle get headline5 => const TextStyle(fontSize: 20 * _scale); 13 | static TextStyle get headline6 => const TextStyle(fontSize: 18 * _scale); 14 | static TextStyle get subtitle1 => const TextStyle(fontSize: 16 * _scale); 15 | static TextStyle get subtitle2 => const TextStyle(fontSize: 14 * _scale); 16 | static TextStyle get bodyText1 => const TextStyle(); 17 | static TextStyle get bodyText2 => const TextStyle(); 18 | static TextStyle get caption => const TextStyle(); 19 | static TextStyle get button => const TextStyle(fontSize: 14 * _scale); 20 | static TextStyle get overline => const TextStyle(); 21 | } 22 | 23 | extension TextStyleWeightExtension on TextStyle { 24 | TextStyle get thin => copyWith(fontWeight: FontWeight.w100); 25 | TextStyle get light => copyWith(fontWeight: FontWeight.w300); 26 | TextStyle get regular => copyWith(fontWeight: FontWeight.w400); 27 | TextStyle get medium => copyWith(fontWeight: FontWeight.w500); 28 | TextStyle get bold => copyWith(fontWeight: FontWeight.w700); 29 | TextStyle get black => copyWith(fontWeight: FontWeight.w900); 30 | } 31 | 32 | extension TextStyleHelpers on TextStyle { 33 | TextStyle get italic => copyWith(fontStyle: FontStyle.italic); 34 | TextStyle get underline => copyWith(decoration: TextDecoration.underline); 35 | TextStyle letterSpace(double value) => copyWith(letterSpacing: value); 36 | TextStyle height(double value) => copyWith(height: value); 37 | } 38 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/buttons/buttons.dart: -------------------------------------------------------------------------------- 1 | export 'link_text.dart'; 2 | export 'rounded_filled_button.dart'; 3 | export 'rounded_outline_button.dart'; 4 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/buttons/link_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_theme.dart'; 3 | 4 | class LinkText extends StatelessWidget { 5 | const LinkText({ 6 | Key? key, 7 | required this.text, 8 | required this.onTap, 9 | this.hasUnderline = false, 10 | }) : super(key: key); 11 | final String text; 12 | final bool hasUnderline; 13 | final VoidCallback onTap; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | onTap: onTap, 19 | child: Text( 20 | text, 21 | style: hasUnderline ? AppTheme.linkStyle : null, 22 | ), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/buttons/rounded_filled_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | 4 | class RoundedFilledButton extends StatelessWidget { 5 | const RoundedFilledButton({ 6 | Key? key, 7 | required this.text, 8 | required this.onTap, 9 | this.width, 10 | this.disable = false, 11 | this.arrow = false, 12 | }) : super(key: key); 13 | final String? text; 14 | final VoidCallback onTap; 15 | final double? width; 16 | final bool disable; 17 | final bool arrow; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return TextButton( 22 | onPressed: disable ? null : onTap, 23 | style: TextButton.styleFrom( 24 | foregroundColor: AppColors.white, 25 | backgroundColor: AppColors.primary, 26 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(100)), 27 | ), 28 | child: Padding( 29 | padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), 30 | child: Row( 31 | mainAxisAlignment: MainAxisAlignment.center, 32 | children: [ 33 | Text( 34 | text!, 35 | style: const TextStyle(fontSize: 14), 36 | ), 37 | if (arrow) ...[ 38 | const SizedBox(width: 2), 39 | const Icon( 40 | Icons.arrow_forward, 41 | size: 13, 42 | ), 43 | ], 44 | ], 45 | ), 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/buttons/rounded_outline_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | 4 | class RoundedOutlineButton extends StatelessWidget { 5 | const RoundedOutlineButton({ 6 | Key? key, 7 | required this.text, 8 | required this.onTap, 9 | this.width, 10 | this.icon, 11 | this.arrow = false, 12 | }) : super(key: key); 13 | final String? text; 14 | final VoidCallback onTap; 15 | final double? width; 16 | final IconData? icon; 17 | final bool arrow; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return OutlinedButton( 22 | onPressed: onTap, 23 | style: OutlinedButton.styleFrom( 24 | backgroundColor: AppColors.scaffoldColor, 25 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(100)), 26 | shadowColor: AppColors.primary.withAlpha(60), 27 | elevation: 6, 28 | side: const BorderSide( 29 | width: 2, 30 | color: AppColors.secondary, 31 | ), 32 | padding: const EdgeInsets.symmetric(horizontal: 20), 33 | minimumSize: const Size(100, 50), 34 | ), 35 | child: Row( 36 | mainAxisSize: MainAxisSize.min, 37 | mainAxisAlignment: MainAxisAlignment.center, 38 | children: [ 39 | if (icon != null) ...[ 40 | Container( 41 | height: 25, 42 | width: 25, 43 | alignment: Alignment.center, 44 | decoration: const BoxDecoration( 45 | shape: BoxShape.circle, 46 | color: AppColors.secondary, 47 | ), 48 | child: Icon( 49 | icon, 50 | size: 15, 51 | color: AppColors.white, 52 | ), 53 | ), 54 | const SizedBox(width: 10), 55 | ], 56 | Text( 57 | text!, 58 | style: const TextStyle( 59 | color: AppColors.secondary, 60 | fontWeight: FontWeight.w600, 61 | ), 62 | ), 63 | if (arrow) ...[ 64 | const SizedBox(width: 2), 65 | const Icon( 66 | Icons.arrow_forward, 67 | size: 13, 68 | ), 69 | ], 70 | ], 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/dialogs/app_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:quickalert/quickalert.dart'; 3 | 4 | /// Shows a dialog. 5 | /// Use in priority cases where it's necessary for the user to see 6 | /// the result as user will need to take action to move forward. 7 | class AppDialog { 8 | static Future showInfo( 9 | BuildContext context, 10 | String infoMessage, 11 | ) async { 12 | QuickAlert.show( 13 | context: context, 14 | type: QuickAlertType.info, 15 | text: infoMessage, 16 | ); 17 | } 18 | 19 | static Future showSuccess( 20 | BuildContext context, 21 | String successMessage, 22 | ) async { 23 | QuickAlert.show( 24 | context: context, 25 | type: QuickAlertType.success, 26 | text: successMessage, 27 | ); 28 | } 29 | 30 | static Future showError( 31 | BuildContext context, 32 | String successMessage, 33 | ) async { 34 | QuickAlert.show( 35 | context: context, 36 | type: QuickAlertType.error, 37 | text: successMessage, 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/dialogs/app_toast.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:m_toast/m_toast.dart'; 3 | 4 | /// Class to show toast message. 5 | /// Use toasts for messages with not much priority results as they will disappear after an interval. 6 | class AppToast { 7 | static final ShowMToast _toast = ShowMToast(); 8 | 9 | static void showInfo( 10 | BuildContext context, 11 | String message, 12 | ) { 13 | _toast.errorToast( 14 | context, 15 | message: message, 16 | alignment: Alignment.bottomCenter, 17 | ); 18 | } 19 | 20 | static void showSuccess( 21 | BuildContext context, 22 | String message, 23 | ) { 24 | _toast.successToast( 25 | context, 26 | message: message, 27 | alignment: Alignment.bottomCenter, 28 | ); 29 | } 30 | 31 | static void showError( 32 | BuildContext context, 33 | String message, 34 | ) { 35 | _toast.errorToast( 36 | context, 37 | message: message, 38 | alignment: Alignment.bottomCenter, 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/dialogs/dialogs.dart: -------------------------------------------------------------------------------- 1 | export 'app_dialog.dart'; 2 | export 'app_toast.dart'; 3 | export 'snackbars.dart'; 4 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/dialogs/snackbars.dart: -------------------------------------------------------------------------------- 1 | import 'package:fluttertoast/fluttertoast.dart'; 2 | 3 | class Snackbar { 4 | static showInfo(String message) { 5 | Fluttertoast.showToast(msg: message); 6 | } 7 | 8 | static showSuccess(String message) { 9 | Fluttertoast.showToast(msg: message); 10 | } 11 | 12 | static showError(String message) { 13 | Fluttertoast.showToast(msg: message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/inputs/custom_choice_chip.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | 4 | class CustomChoiceChip extends StatelessWidget { 5 | const CustomChoiceChip({ 6 | Key? key, 7 | required this.label, 8 | this.icon, 9 | this.onSelected, 10 | required this.selected, 11 | }) : super(key: key); 12 | final String label; 13 | final Widget? icon; 14 | final bool selected; 15 | final void Function(bool)? onSelected; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return ChoiceChip( 20 | avatar: icon, 21 | label: Text( 22 | label, 23 | style: Theme.of(context).textTheme.bodyText2!.copyWith( 24 | color: selected ? AppColors.black : AppColors.white, 25 | fontWeight: FontWeight.w400, 26 | ), 27 | ), 28 | selected: selected, 29 | elevation: selected ? 10 : 0, 30 | selectedShadowColor: AppColors.lightGrey.withOpacity(0.3), 31 | onSelected: onSelected, 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/inputs/custom_date_picker.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_template/domain/core/helpers/validators.dart'; 5 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 6 | import 'package:flutter_template/presentation/core/widgets/buttons/rounded_filled_button.dart'; 7 | import 'package:flutter_template/presentation/core/widgets/inputs/custom_text_field.dart'; 8 | import 'package:intl/intl.dart'; 9 | 10 | class CustomDatePicker extends StatefulWidget { 11 | const CustomDatePicker({ 12 | Key? key, 13 | required this.dateController, 14 | this.labelText, 15 | this.hintText, 16 | this.initialDate, 17 | }) : super(key: key); 18 | final TextEditingController dateController; 19 | final String? labelText; 20 | final String? hintText; 21 | final DateTime? initialDate; 22 | 23 | @override 24 | State createState() => _CustomDatePickerState(); 25 | } 26 | 27 | class _CustomDatePickerState extends State { 28 | final DateFormat dateFormat = DateFormat('dd-MM-yyyy'); 29 | //'dd-MM-yyyy' 30 | DateTime selectedDate = DateTime.now(); 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | return CustomTextField( 35 | // autofillHints: const [AutofillHints.birthday], 36 | labelText: widget.labelText, 37 | decoration: InputDecoration( 38 | suffixIcon: const Icon( 39 | Icons.calendar_today_rounded, 40 | color: AppColors.mildBlue, 41 | ), 42 | hintText: widget.hintText ?? "Select date", 43 | ), 44 | readOnly: true, 45 | onTap: () async { 46 | await _selectDate(context); 47 | }, 48 | controller: widget.dateController, 49 | validator: Validators.fieldRequired, 50 | ); 51 | } 52 | 53 | Future _selectDate(BuildContext context) async { 54 | showModalBottomSheet( 55 | context: context, 56 | builder: (context) { 57 | return SafeArea( 58 | child: SizedBox( 59 | height: 350, 60 | child: Column( 61 | mainAxisSize: MainAxisSize.min, 62 | children: [ 63 | Expanded( 64 | child: CupertinoDatePicker( 65 | maximumYear: 2023, 66 | minimumYear: 1900, 67 | mode: CupertinoDatePickerMode.date, 68 | onDateTimeChanged: (value) { 69 | selectedDate = value; 70 | }, 71 | initialDateTime: widget.initialDate, 72 | ), 73 | ), 74 | Padding( 75 | padding: 76 | const EdgeInsets.symmetric(horizontal: 20, vertical: 5), 77 | child: RoundedFilledButton( 78 | text: "Done", 79 | onTap: () { 80 | setState(() { 81 | widget.dateController.text = 82 | dateFormat.format(selectedDate).toString(); 83 | }); 84 | AutoRouter.of(context).pop(); 85 | }, 86 | ), 87 | ), 88 | ], 89 | ), 90 | ), 91 | ); 92 | }, 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/inputs/custom_pin_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 3 | import 'package:pin_code_text_field/pin_code_text_field.dart'; 4 | 5 | class CustomPinField extends StatelessWidget { 6 | const CustomPinField({ 7 | Key? key, 8 | required this.controller, 9 | required this.onTextChanged, 10 | this.onDone, 11 | this.length = 4, 12 | this.labelText, 13 | this.autofocus = false, 14 | }) : super(key: key); 15 | final TextEditingController controller; 16 | final Function(String) onTextChanged; 17 | final Function(String)? onDone; 18 | final int length; 19 | final bool autofocus; 20 | final String? labelText; 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return Column( 25 | children: [ 26 | if (labelText != null) ...[ 27 | Text( 28 | labelText!, 29 | style: Theme.of(context).textTheme.bodyText2, 30 | ), 31 | const SizedBox(height: 10), 32 | ], 33 | PinCodeTextField( 34 | autofocus: autofocus, 35 | controller: controller, 36 | highlightColor: Colors.blue, 37 | defaultBorderColor: Colors.grey.shade400, 38 | hasTextBorderColor: Colors.grey.shade600, 39 | maxLength: length, 40 | onTextChanged: onTextChanged, 41 | onDone: onDone, 42 | pinBoxWidth: 50, 43 | pinBoxHeight: 50, 44 | pinBoxRadius: 10.0, 45 | pinBoxBorderWidth: 1.0, 46 | wrapAlignment: WrapAlignment.spaceAround, 47 | pinTextStyle: const TextStyle( 48 | fontSize: 20.0, 49 | color: AppColors.green, 50 | ), 51 | pinTextAnimatedSwitcherTransition: 52 | ProvidedPinBoxTextAnimation.scalingTransition, 53 | pinTextAnimatedSwitcherDuration: const Duration(milliseconds: 300), 54 | highlightAnimation: true, 55 | highlightAnimationBeginColor: Colors.black, 56 | highlightAnimationEndColor: Colors.white12, 57 | ), 58 | ], 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/inputs/custom_switch_tile.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_template/presentation/core/styles/app_colors.dart'; 5 | 6 | class CustomSwitchTile extends StatelessWidget { 7 | const CustomSwitchTile({ 8 | Key? key, 9 | required this.text, 10 | required this.value, 11 | this.onChanged, 12 | }) : super(key: key); 13 | final String text; 14 | final bool value; 15 | final void Function(bool)? onChanged; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return ListTile( 20 | title: Text(text), 21 | trailing: CupertinoSwitch( 22 | activeColor: AppColors.secondary, 23 | value: value, 24 | onChanged: onChanged, 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/inputs/inputs.dart: -------------------------------------------------------------------------------- 1 | export 'custom_choice_chip.dart'; 2 | export 'custom_date_picker.dart'; 3 | export 'custom_dropdown.dart'; 4 | export 'custom_pin_field.dart'; 5 | export 'custom_switch_tile.dart'; 6 | export 'custom_text_field.dart'; 7 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/layout/app_scaffold.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/gestures.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppScaffold extends StatelessWidget { 5 | final bool extendBody; 6 | 7 | final bool extendBodyBehindAppBar; 8 | 9 | final PreferredSizeWidget? appBar; 10 | 11 | final Widget? body; 12 | 13 | final Widget? floatingActionButton; 14 | 15 | final FloatingActionButtonLocation? floatingActionButtonLocation; 16 | 17 | final FloatingActionButtonAnimator? floatingActionButtonAnimator; 18 | 19 | final List? persistentFooterButtons; 20 | 21 | final Widget? drawer; 22 | 23 | final DrawerCallback? onDrawerChanged; 24 | 25 | final Widget? endDrawer; 26 | 27 | final DrawerCallback? onEndDrawerChanged; 28 | 29 | final Color? drawerScrimColor; 30 | 31 | final Color? backgroundColor; 32 | 33 | final Widget? bottomNavigationBar; 34 | 35 | final Widget? bottomSheet; 36 | 37 | final bool? resizeToAvoidBottomInset; 38 | 39 | final bool primary; 40 | 41 | final DragStartBehavior drawerDragStartBehavior; 42 | 43 | final double? drawerEdgeDragWidth; 44 | 45 | final bool drawerEnableOpenDragGesture; 46 | 47 | final bool endDrawerEnableOpenDragGesture; 48 | 49 | final String? restorationId; 50 | 51 | const AppScaffold({ 52 | Key? key, 53 | this.appBar, 54 | this.body, 55 | this.floatingActionButton, 56 | this.floatingActionButtonLocation, 57 | this.floatingActionButtonAnimator, 58 | this.persistentFooterButtons, 59 | this.drawer, 60 | this.onDrawerChanged, 61 | this.endDrawer, 62 | this.onEndDrawerChanged, 63 | this.bottomNavigationBar, 64 | this.bottomSheet, 65 | this.backgroundColor, 66 | this.resizeToAvoidBottomInset, 67 | this.primary = true, 68 | this.drawerDragStartBehavior = DragStartBehavior.start, 69 | this.extendBody = false, 70 | this.extendBodyBehindAppBar = false, 71 | this.drawerScrimColor, 72 | this.drawerEdgeDragWidth, 73 | this.drawerEnableOpenDragGesture = true, 74 | this.endDrawerEnableOpenDragGesture = true, 75 | this.restorationId, 76 | }) : super(key: key); 77 | 78 | @override 79 | Widget build(BuildContext context) { 80 | return SafeArea( 81 | child: Scaffold( 82 | appBar: appBar, 83 | backgroundColor: backgroundColor ?? Colors.white, 84 | body: body, 85 | ), 86 | ); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/layout/custom_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class CustomAppBar extends StatelessWidget with PreferredSizeWidget { 5 | const CustomAppBar({ 6 | Key? key, 7 | required this.title, 8 | }) : super(key: key); 9 | final String title; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return AppBar( 14 | title: Text(title), 15 | automaticallyImplyLeading: false, 16 | backgroundColor: Colors.black, 17 | leading: IconButton( 18 | onPressed: () { 19 | AutoRouter.of(context).pop(); 20 | }, 21 | icon: const Icon( 22 | Icons.keyboard_arrow_left, 23 | size: 40, 24 | color: Colors.white, 25 | ), 26 | ), 27 | ); 28 | } 29 | 30 | @override 31 | Size get preferredSize => const Size.fromHeight(60); 32 | } 33 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/layout/layout.dart: -------------------------------------------------------------------------------- 1 | export 'app_scaffold.dart'; 2 | export 'custom_app_bar.dart'; 3 | export 'logo_widget.dart'; 4 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/layout/logo_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppLogo extends StatelessWidget { 4 | final double? size; 5 | const AppLogo({Key? key, this.size}) : super(key: key); 6 | @override 7 | Widget build(BuildContext context) { 8 | return FlutterLogo( 9 | size: size, 10 | ); 11 | } 12 | } 13 | 14 | class AppLogoFull extends StatelessWidget { 15 | final double? width; 16 | final double? height; 17 | const AppLogoFull({ 18 | Key? key, 19 | required this.width, 20 | required this.height, 21 | }) : super(key: key); 22 | @override 23 | Widget build(BuildContext context) { 24 | return const FlutterLogo(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/utility/dots_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DotsIndicator extends AnimatedWidget { 4 | const DotsIndicator({ 5 | Key? key, 6 | required this.controller, 7 | required this.itemCount, 8 | required this.onPageSelected, 9 | this.color = const Color(0xFF3D405B), 10 | }) : super(key: key, listenable: controller); 11 | 12 | final PageController controller; 13 | final int itemCount; 14 | final ValueChanged onPageSelected; 15 | final Color color; 16 | static const double _kDotSize = 8.0; 17 | static const double _kDotSpacing = 15.0; 18 | 19 | Widget _buildDot(int index) { 20 | return SizedBox( 21 | width: _kDotSpacing, 22 | child: Center( 23 | child: Material( 24 | color: (controller.page ?? controller.initialPage) == index 25 | ? color 26 | : Colors.grey, 27 | type: MaterialType.circle, 28 | child: SizedBox( 29 | width: _kDotSize, 30 | height: _kDotSize, 31 | child: InkWell( 32 | onTap: () => onPageSelected(index), 33 | ), 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return Container( 43 | padding: const EdgeInsets.all(15), 44 | child: Row( 45 | mainAxisAlignment: MainAxisAlignment.center, 46 | children: List.generate(itemCount, _buildDot), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/utility/life_cycle_watcher.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class LifecycleWatcher extends StatefulWidget { 4 | final Widget child; 5 | 6 | const LifecycleWatcher({Key? key, required this.child}) : super(key: key); 7 | @override 8 | LifecycleWatcherState createState() => LifecycleWatcherState(); 9 | } 10 | 11 | class LifecycleWatcherState extends State 12 | with WidgetsBindingObserver { 13 | AppLifecycleState? _lastLifecycleState; 14 | 15 | @override 16 | void initState() { 17 | super.initState(); 18 | WidgetsBinding.instance.addObserver(this); 19 | } 20 | 21 | @override 22 | void dispose() { 23 | WidgetsBinding.instance.removeObserver(this); 24 | super.dispose(); 25 | } 26 | 27 | @override 28 | void didChangeAppLifecycleState(AppLifecycleState state) { 29 | setState(() { 30 | _lastLifecycleState = state; 31 | }); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | switch (_lastLifecycleState) { 37 | case AppLifecycleState.detached: 38 | case AppLifecycleState.inactive: 39 | case AppLifecycleState.paused: 40 | //TODO: perform functions for exiting/pausing the app like changing user status to offline 41 | break; 42 | 43 | case AppLifecycleState.resumed: 44 | //TODO: perform functions like changing user status to online 45 | default: 46 | } 47 | debugPrint('App Life Cycle state ===> $_lastLifecycleState.'); 48 | 49 | return widget.child; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/presentation/core/widgets/utility/navigation_observer.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/auto_route.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class NavigationObserver extends AutoRouterObserver { 5 | @override 6 | void didPush(Route route, Route? previousRoute) { 7 | // debugPrint('New route pushed: ${route.settings.name}'); 8 | // log('New route pushed: ${route.settings.name}'); 9 | } 10 | 11 | // only override to observer tab routes 12 | @override 13 | void didInitTabRoute(TabPageRoute route, TabPageRoute? previousRoute) { 14 | debugPrint('Tab route visited: ${route.name}'); 15 | } 16 | 17 | @override 18 | void didChangeTabRoute(TabPageRoute route, TabPageRoute previousRoute) { 19 | debugPrint('Tab route re-visited: ${route.name}'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/presentation/onboarding/onboarding_page.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/lib/presentation/onboarding/onboarding_page.dart -------------------------------------------------------------------------------- /lib/presentation/onboarding/pages/welcome_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_template/presentation/core/widgets/layout/app_scaffold.dart'; 3 | 4 | class WelcomePage extends StatelessWidget { 5 | const WelcomePage({super.key}); 6 | @override 7 | Widget build(BuildContext context) { 8 | return AppScaffold( 9 | body: Container(), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lib/presentation/routes/router.dart: -------------------------------------------------------------------------------- 1 | import 'package:auto_route/annotations.dart'; 2 | import 'package:flutter_template/presentation/authentication/pages/forgot_password_page.dart'; 3 | import 'package:flutter_template/presentation/authentication/pages/signin_page.dart'; 4 | import 'package:flutter_template/presentation/authentication/pages/signup_page.dart'; 5 | import 'package:flutter_template/presentation/base/base_page.dart'; 6 | import 'package:flutter_template/presentation/core/pages/landing_page.dart'; 7 | import 'package:flutter_template/presentation/core/pages/onboarding_page.dart'; 8 | import 'package:flutter_template/presentation/core/pages/splash_page.dart'; 9 | import 'package:flutter_template/presentation/core/pages/update_app_page.dart'; 10 | 11 | @MaterialAutoRouter( 12 | replaceInRouteName: "Page,Route", 13 | routes: [ 14 | ///[Core] 15 | AutoRoute(page: SplashPage, initial: true), 16 | AutoRoute(page: OnboardingPage), 17 | AutoRoute(page: UpdateAppPage), 18 | AutoRoute(page: LandingPage), 19 | 20 | ///[Authentication] 21 | AutoRoute(page: SigninPage), 22 | AutoRoute(page: SignupPage), 23 | AutoRoute(page: ForgotPasswordPage), 24 | 25 | ///[Base] 26 | AutoRoute(page: BasePage), 27 | ], 28 | ) 29 | class $AppRouter {} 30 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void fl_register_plugins(FlPluginRegistry* registry) { 13 | g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = 14 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); 15 | flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); 16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 19 | } 20 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_secure_storage_linux 7 | url_launcher_linux 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import cloud_firestore 9 | import cloud_functions 10 | import connectivity_plus 11 | import firebase_auth 12 | import firebase_core 13 | import firebase_crashlytics 14 | import firebase_messaging 15 | import firebase_storage 16 | import flutter_secure_storage_macos 17 | import path_provider_foundation 18 | import shared_preferences_foundation 19 | import sqflite 20 | import url_launcher_macos 21 | 22 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 23 | FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) 24 | FLTFirebaseFunctionsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFunctionsPlugin")) 25 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) 26 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 27 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 28 | FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin")) 29 | FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) 30 | FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) 31 | FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) 32 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 33 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 34 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 35 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 36 | } 37 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = flutter_template 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterTemplate 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_template 2 | description: A new Flutter project. 3 | 4 | publish_to: "none" 5 | 6 | version: 1.0.0+1 7 | 8 | environment: 9 | sdk: ">=2.17.0 <3.0.0" 10 | 11 | dependencies: 12 | auto_route: ^5.0.3 13 | build_runner: ^2.3.2 14 | cached_network_image: ^3.2.3 15 | cloud_firestore: ^4.1.0 16 | cloud_functions: ^4.0.5 17 | connectivity_plus: ^3.0.2 18 | cupertino_icons: ^1.0.5 19 | dartz: ^0.10.0-nullsafety.2 20 | dio: ^4.0.6 21 | dio_smart_retry: ^1.4.0 22 | equatable: ^2.0.5 23 | faker: ^2.1.0 24 | file_picker: ^5.2.4 25 | firebase_auth: ^4.1.4 26 | firebase_core: ^2.3.0 27 | firebase_crashlytics: ^3.0.6 28 | firebase_messaging: ^14.1.2 29 | firebase_performance: ^0.9.0+6 30 | firebase_storage: ^11.0.6 31 | flutter: 32 | sdk: flutter 33 | flutter_bloc: ^8.1.1 34 | flutter_dotenv: ^5.0.2 35 | flutter_localizations: 36 | sdk: flutter 37 | flutter_secure_storage: ^7.0.1 38 | flutter_svg: ^1.1.6 39 | fluttertoast: ^8.1.2 40 | freezed_annotation: ^2.2.0 41 | get_it: ^7.2.0 42 | google_fonts: ^3.0.1 43 | graphql_flutter: ^5.1.0 44 | image_picker: ^0.8.6 45 | injectable: ^2.0.1 46 | intl: ^0.17.0 47 | logger: ^1.1.0 48 | m_toast: ^0.1.8 49 | pin_code_text_field: ^1.8.0 50 | quickalert: ^1.0.1 51 | shared_preferences: ^2.0.15 52 | shimmer: ^2.0.0 53 | url_launcher: ^6.1.7 54 | uuid: ^3.0.7 55 | validators: ^3.0.0 56 | 57 | dev_dependencies: 58 | auto_route_generator: ^5.0.3 59 | change_app_package_name: ^1.1.0 60 | dart_code_metrics: ^5.2.1 61 | flutter_gen_runner: ^5.1.0+1 62 | flutter_launcher_icons: ^0.11.0 63 | flutter_lints: ^2.0.1 64 | flutter_native_splash: ^2.2.15 65 | flutter_test: 66 | sdk: flutter 67 | freezed: ^2.2.1 68 | injectable_generator: ^2.0.1 69 | integration_test: 70 | sdk: flutter 71 | json_serializable: ^6.5.4 72 | lint: ^2.0.1 73 | 74 | flutter: 75 | generate: true 76 | uses-material-design: true 77 | fonts: 78 | - family: Roboto 79 | fonts: 80 | - asset: assets/fonts/Roboto-Black.ttf 81 | weight: 900 82 | - asset: assets/fonts/Roboto-Bold.ttf 83 | weight: 700 84 | - asset: assets/fonts/Roboto-Medium.ttf 85 | weight: 500 86 | - asset: assets/fonts/Roboto-Regular.ttf 87 | weight: 400 88 | - asset: assets/fonts/Roboto-Light.ttf 89 | weight: 300 90 | - asset: assets/fonts/Roboto-Thin.ttf 91 | weight: 100 92 | - asset: assets/fonts/Roboto-ThinItalic.ttf 93 | style: italic 94 | 95 | assets: 96 | - .env 97 | - assets/files/ 98 | - assets/icons/ 99 | - assets/images/ 100 | 101 | 102 | flutter_gen: 103 | output: lib/domain/core/generated 104 | line_length: 80 105 | integrations: 106 | flutter_svg: false 107 | flare_flutter: false 108 | rive: false 109 | lottie: false 110 | assets: 111 | enabled: true 112 | outputs: 113 | style: dot-delimiter 114 | class_name: Assets -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_template/presentation/core/app_widget.dart'; 10 | import 'package:flutter_test/flutter_test.dart'; 11 | 12 | void main() { 13 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 14 | // Build our app and trigger a frame. 15 | await tester.pumpWidget(AppWidget()); 16 | 17 | // Verify that our counter starts at 0. 18 | expect(find.text('0'), findsOneWidget); 19 | expect(find.text('1'), findsNothing); 20 | 21 | // Tap the '+' icon and trigger a frame. 22 | await tester.tap(find.byIcon(Icons.add)); 23 | await tester.pump(); 24 | 25 | // Verify that our counter has incremented. 26 | expect(find.text('0'), findsNothing); 27 | expect(find.text('1'), findsOneWidget); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | flutter_template 30 | 31 | 32 | 33 | 34 | 37 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutter_template", 3 | "short_name": "flutter_template", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /web/splash/img/dark-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/dark-1x.png -------------------------------------------------------------------------------- /web/splash/img/dark-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/dark-2x.png -------------------------------------------------------------------------------- /web/splash/img/dark-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/dark-3x.png -------------------------------------------------------------------------------- /web/splash/img/light-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/light-1x.png -------------------------------------------------------------------------------- /web/splash/img/light-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/light-2x.png -------------------------------------------------------------------------------- /web/splash/img/light-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/web/splash/img/light-3x.png -------------------------------------------------------------------------------- /web/splash/style.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin:0; 3 | height:100%; 4 | background: #ffffff; 5 | background-image: url("img/light-background.png"); 6 | background-size: 100% 100%; 7 | } 8 | 9 | .center { 10 | margin: 0; 11 | position: absolute; 12 | top: 50%; 13 | left: 50%; 14 | -ms-transform: translate(-50%, -50%); 15 | transform: translate(-50%, -50%); 16 | } 17 | 18 | .contain { 19 | display:block; 20 | width:100%; height:100%; 21 | object-fit: contain; 22 | } 23 | 24 | .stretch { 25 | display:block; 26 | width:100%; height:100%; 27 | } 28 | 29 | .cover { 30 | display:block; 31 | width:100%; height:100%; 32 | object-fit: cover; 33 | } 34 | 35 | @media (prefers-color-scheme: dark) { 36 | body { 37 | margin:0; 38 | height:100%; 39 | background: #ffffff; 40 | background-image: url("img/dark-background.png"); 41 | background-size: 100% 100%; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 16 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | connectivity_plus 7 | flutter_secure_storage_windows 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_template" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2021 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_template.exe" "\0" 98 | VALUE "ProductName", "flutter_template" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opporutunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"flutter_template", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KKshitiz/flutter-DDD-template/f1e86a1fd707a23282ce0a418205f44f94791313/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | --------------------------------------------------------------------------------