Repository: lazycatlabs/flutter_auth_app Branch: main Commit: aa066ff8d764 Files: 313 Total size: 480.9 KB Directory structure: gitextract_9aoivx5e/ ├── .github/ │ ├── pull_request_template.md │ └── workflows/ │ ├── merge-ci.yml │ └── pull_request-ci.yml ├── .gitignore ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android/ │ ├── .gitignore │ ├── app/ │ │ ├── build.gradle │ │ ├── google-services.json │ │ ├── proguard-rules.pro │ │ └── src/ │ │ ├── debug/ │ │ │ └── AndroidManifest.xml │ │ ├── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin/ │ │ │ │ └── com/ │ │ │ │ └── lazycatlabs/ │ │ │ │ └── auth/ │ │ │ │ └── MainActivity.kt │ │ │ └── res/ │ │ │ ├── drawable/ │ │ │ │ ├── launch_background.xml │ │ │ │ └── launch_background_12.xml │ │ │ ├── mipmap-anydpi-v26/ │ │ │ │ └── ic_launcher.xml │ │ │ ├── values/ │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── values-night/ │ │ │ └── styles.xml │ │ ├── prd/ │ │ │ └── res/ │ │ │ ├── drawable/ │ │ │ │ └── launch_background.xml │ │ │ ├── drawable-night/ │ │ │ │ └── launch_background.xml │ │ │ ├── drawable-night-v21/ │ │ │ │ └── launch_background.xml │ │ │ ├── drawable-v21/ │ │ │ │ └── launch_background.xml │ │ │ ├── mipmap-anydpi-v26/ │ │ │ │ └── ic_launcher.xml │ │ │ ├── values/ │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── values-night/ │ │ │ │ └── styles.xml │ │ │ ├── values-night-v31/ │ │ │ │ └── styles.xml │ │ │ └── values-v31/ │ │ │ └── styles.xml │ │ ├── profile/ │ │ │ └── AndroidManifest.xml │ │ └── stg/ │ │ ├── google-services.json │ │ └── res/ │ │ ├── drawable/ │ │ │ └── launch_background.xml │ │ ├── drawable-night/ │ │ │ └── launch_background.xml │ │ ├── drawable-night-v21/ │ │ │ └── launch_background.xml │ │ ├── drawable-v21/ │ │ │ └── launch_background.xml │ │ ├── mipmap-anydpi-v26/ │ │ │ └── ic_launcher.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-night/ │ │ │ └── styles.xml │ │ ├── values-night-v31/ │ │ │ └── styles.xml │ │ └── values-v31/ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ └── settings.gradle ├── build.yaml ├── codecov.yml ├── flutter_launcher_icons-prd.yaml ├── flutter_launcher_icons-stg.yaml ├── flutter_native_splash-prd.yaml ├── flutter_native_splash-stg.yaml ├── ios/ │ ├── .gitignore │ ├── Flutter/ │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── ephemeral/ │ │ ├── flutter_lldb_helper.py │ │ └── flutter_lldbinit │ ├── Podfile │ ├── Runner/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon-prd.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── AppIcon-stg.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── BrandingImagePrd.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── BrandingImageStg.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── LaunchBackgroundPrd.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── LaunchBackgroundStg.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── LaunchImagePrd.imageset/ │ │ │ │ └── Contents.json │ │ │ └── LaunchImageStg.imageset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ ├── LaunchScreenPrd.storyboard │ │ │ ├── LaunchScreenStg.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── Runner-Bridging-Header.h │ │ └── Runner.entitlements │ ├── Runner.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ ├── prd.xcscheme │ │ └── stg.xcscheme │ ├── Runner.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata/ │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings │ └── config/ │ ├── prd/ │ │ └── GoogleService-Info.plist │ └── stg/ │ └── GoogleService-Info.plist ├── l10n.yaml ├── lib/ │ ├── core/ │ │ ├── api/ │ │ │ ├── api.dart │ │ │ ├── dio_client.dart │ │ │ ├── dio_interceptor.dart │ │ │ ├── isolate_parser.dart │ │ │ └── list_api.dart │ │ ├── app_route.dart │ │ ├── core.dart │ │ ├── error/ │ │ │ ├── error.dart │ │ │ ├── exceptions.dart │ │ │ └── failure.dart │ │ ├── localization/ │ │ │ ├── intl_en.arb │ │ │ ├── intl_id.arb │ │ │ ├── l10n.dart │ │ │ └── localization.dart │ │ ├── resources/ │ │ │ ├── dimens.dart │ │ │ ├── images.dart │ │ │ ├── palette.dart │ │ │ ├── resources.dart │ │ │ └── styles.dart │ │ ├── usecase/ │ │ │ └── usecase.dart │ │ └── widgets/ │ │ ├── button.dart │ │ ├── button_notification.dart │ │ ├── button_text.dart │ │ ├── circle_image.dart │ │ ├── color_loaders.dart │ │ ├── drop_down.dart │ │ ├── empty.dart │ │ ├── loading.dart │ │ ├── my_appbar.dart │ │ ├── parent.dart │ │ ├── spacer_h.dart │ │ ├── spacer_v.dart │ │ ├── text_f.dart │ │ ├── toast.dart │ │ └── widgets.dart │ ├── dependencies_injection.dart │ ├── features/ │ │ ├── auth/ │ │ │ ├── auth.dart │ │ │ ├── data/ │ │ │ │ ├── data.dart │ │ │ │ ├── datasources/ │ │ │ │ │ ├── auth_remote_datasources.dart │ │ │ │ │ └── datasources.dart │ │ │ │ ├── models/ │ │ │ │ │ ├── general_token_response.dart │ │ │ │ │ ├── login_response.dart │ │ │ │ │ ├── models.dart │ │ │ │ │ └── register_response.dart │ │ │ │ └── repositories/ │ │ │ │ ├── auth_repository_impl.dart │ │ │ │ └── repositories.dart │ │ │ ├── domain/ │ │ │ │ ├── domain.dart │ │ │ │ ├── entities/ │ │ │ │ │ ├── entities.dart │ │ │ │ │ ├── general_token.dart │ │ │ │ │ ├── login.dart │ │ │ │ │ └── register.dart │ │ │ │ ├── repositories/ │ │ │ │ │ ├── auth_repository.dart │ │ │ │ │ └── repositories.dart │ │ │ │ └── usecases/ │ │ │ │ ├── post_general_token.dart │ │ │ │ ├── post_login.dart │ │ │ │ ├── post_logout.dart │ │ │ │ ├── post_register.dart │ │ │ │ └── usecases.dart │ │ │ └── pages/ │ │ │ ├── login/ │ │ │ │ ├── cubit/ │ │ │ │ │ ├── auth_cubit.dart │ │ │ │ │ └── cubit.dart │ │ │ │ ├── login.dart │ │ │ │ └── login_page.dart │ │ │ ├── pages.dart │ │ │ └── register/ │ │ │ ├── cubit/ │ │ │ │ ├── cubit.dart │ │ │ │ └── register_cubit.dart │ │ │ ├── register.dart │ │ │ └── register_page.dart │ │ ├── features.dart │ │ ├── general/ │ │ │ ├── data/ │ │ │ │ ├── data.dart │ │ │ │ └── models/ │ │ │ │ ├── diagnostic.dart │ │ │ │ ├── diagnostic_response.dart │ │ │ │ ├── models.dart │ │ │ │ └── page.dart │ │ │ ├── general.dart │ │ │ └── pages/ │ │ │ ├── cubit/ │ │ │ │ ├── cubit.dart │ │ │ │ └── reload_form_cubit.dart │ │ │ ├── main/ │ │ │ │ ├── cubit/ │ │ │ │ │ ├── cubit.dart │ │ │ │ │ ├── logout_cubit.dart │ │ │ │ │ ├── main_cubit.dart │ │ │ │ │ └── user_cubit.dart │ │ │ │ ├── main.dart │ │ │ │ ├── main_page.dart │ │ │ │ └── menu_drawer.dart │ │ │ ├── pages.dart │ │ │ ├── settings/ │ │ │ │ ├── cubit/ │ │ │ │ │ ├── cubit.dart │ │ │ │ │ └── settings_cubit.dart │ │ │ │ ├── settings.dart │ │ │ │ └── settings_page.dart │ │ │ └── splashscreen/ │ │ │ ├── cubit/ │ │ │ │ ├── cubit.dart │ │ │ │ └── general_token_cubit.dart │ │ │ ├── splash_screen_page.dart │ │ │ └── splashscreen.dart │ │ └── users/ │ │ ├── data/ │ │ │ ├── data.dart │ │ │ ├── datasources/ │ │ │ │ ├── datasources.dart │ │ │ │ └── user_remote_datasources.dart │ │ │ ├── models/ │ │ │ │ ├── models.dart │ │ │ │ ├── user_response.dart │ │ │ │ └── users_response.dart │ │ │ └── repositories/ │ │ │ ├── repositories.dart │ │ │ └── users_repository_impl.dart │ │ ├── domain/ │ │ │ ├── domain.dart │ │ │ ├── entities/ │ │ │ │ ├── entities.dart │ │ │ │ └── users.dart │ │ │ ├── repositories/ │ │ │ │ ├── repositories.dart │ │ │ │ └── users_repository.dart │ │ │ └── usecases/ │ │ │ ├── get_user.dart │ │ │ ├── get_users.dart │ │ │ └── usecases.dart │ │ ├── pages/ │ │ │ ├── dashboard/ │ │ │ │ ├── cubit/ │ │ │ │ │ ├── cubit.dart │ │ │ │ │ └── users_cubit.dart │ │ │ │ ├── dashboard.dart │ │ │ │ └── dashboard_page.dart │ │ │ └── pages.dart │ │ └── users.dart │ ├── lzyct_app.dart │ ├── main.dart │ └── utils/ │ ├── ext/ │ │ ├── context.dart │ │ ├── ext.dart │ │ ├── map.dart │ │ ├── string.dart │ │ └── text_theme.dart │ ├── helper/ │ │ ├── common.dart │ │ ├── constant.dart │ │ ├── data_helper.dart │ │ ├── debouncer.dart │ │ ├── go_router_refresh_stream.dart │ │ └── helper.dart │ ├── services/ │ │ ├── firebase/ │ │ │ ├── firebase.dart │ │ │ ├── firebase_crashlogger.dart │ │ │ ├── firebase_options.dart │ │ │ └── firebase_services.dart │ │ ├── hive/ │ │ │ ├── hive.dart │ │ │ ├── hive_adapters.dart │ │ │ ├── hive_adapters.g.yaml │ │ │ └── main_box.dart │ │ └── services.dart │ └── utils.dart ├── maestro-prd/ │ ├── dashboard.yaml │ ├── login.yaml │ ├── logout.yaml │ ├── main.yaml │ ├── register.yaml │ └── settings.yaml ├── maestro-stg/ │ ├── dashboard.yaml │ ├── login.yaml │ ├── logout.yaml │ ├── main.yaml │ ├── register.yaml │ └── settings.yaml ├── pubspec.yaml └── test/ ├── core/ │ ├── api/ │ │ └── list_api_test.dart │ ├── app_route_test.dart │ ├── error/ │ │ ├── exception_test.dart │ │ └── failure_test.dart │ ├── localization/ │ │ └── l10n_test.dart │ └── widgets/ │ ├── circle_image_test.dart │ └── toast_test.dart ├── features/ │ ├── auth/ │ │ ├── data/ │ │ │ ├── datasources/ │ │ │ │ ├── models/ │ │ │ │ │ ├── general_token_response_test.dart │ │ │ │ │ ├── login_response_test.dart │ │ │ │ │ └── register_response_test.dart │ │ │ │ └── repositories/ │ │ │ │ └── auth_remote_datasources_test.dart │ │ │ └── repositories/ │ │ │ └── auth_repository_impl_test.dart │ │ ├── domain/ │ │ │ └── usecases/ │ │ │ ├── post_general_token_test.dart │ │ │ ├── post_login_test.dart │ │ │ ├── post_logout.dart │ │ │ └── post_register_test.dart │ │ └── pages/ │ │ ├── login/ │ │ │ ├── cubit/ │ │ │ │ ├── auth_cubit_test.dart │ │ │ │ ├── auth_cubit_test.mocks.dart │ │ │ │ └── auth_state_test.dart │ │ │ └── login_page_test.dart │ │ └── register/ │ │ ├── cubit/ │ │ │ ├── register_cubit_test.dart │ │ │ ├── register_cubit_test.mocks.dart │ │ │ └── register_state_test.dart │ │ └── register_page_test.dart │ ├── general/ │ │ ├── data/ │ │ │ └── models/ │ │ │ ├── diagnostic_response_test.dart │ │ │ ├── diagnostic_test.dart │ │ │ └── page_test.dart │ │ └── pages/ │ │ ├── cubit/ │ │ │ ├── reload_form_cubit_test.dart │ │ │ └── reload_form_state_test.dart │ │ ├── main/ │ │ │ ├── cubit/ │ │ │ │ ├── logout_cubit_test.dart │ │ │ │ ├── logout_cubit_test.mocks.dart │ │ │ │ ├── main_cubit_test.dart │ │ │ │ ├── user_cubit_test.dart │ │ │ │ └── user_cubit_test.mocks.dart │ │ │ ├── main_page_test.dart │ │ │ └── menu_drawer_test.dart │ │ ├── settings/ │ │ │ ├── cubit/ │ │ │ │ └── settings_cubit_test.dart │ │ │ └── settings_page_test.dart │ │ └── splashscreen/ │ │ ├── cubit/ │ │ │ ├── general_token_cubit_test.dart │ │ │ ├── general_token_cubit_test.mocks.dart │ │ │ └── general_token_state_test.dart │ │ └── splash_screen_page_test.dart │ └── users/ │ ├── data/ │ │ ├── datasources/ │ │ │ ├── models/ │ │ │ │ └── users_response_test.dart │ │ │ └── repositories/ │ │ │ └── users_remote_datasources_test.dart │ │ └── repositories/ │ │ └── users_repository_impl_test.dart │ ├── domain/ │ │ └── usecases/ │ │ └── get_users_test.dart │ └── pages/ │ └── dashboard/ │ ├── cubit/ │ │ ├── users_cubit_test.dart │ │ ├── users_cubit_test.mocks.dart │ │ └── users_state_test.dart │ └── dashboard_page_test.dart ├── helpers/ │ ├── fake_path_provider_platform.dart │ ├── json_reader.dart │ ├── paths.dart │ ├── stubs/ │ │ ├── diagnostic.json │ │ ├── diagnostic_response_200.json │ │ ├── diagnostic_response_400.json │ │ ├── general_token_response_200.json │ │ ├── general_token_response_401.json │ │ ├── login_response_200.json │ │ ├── login_response_401.json │ │ ├── page.json │ │ ├── register_response_200.json │ │ ├── register_response_400.json │ │ ├── user_response_200.json │ │ ├── user_response_401.json │ │ ├── users_empty_response_200.json │ │ └── users_response_200.json │ ├── test_mock.dart │ └── test_mock.mocks.dart └── utils/ ├── ext/ │ ├── context_test.dart │ └── string_test.dart └── helper/ ├── debouncer_test.dart └── go_router_refresh_stream_test.dart ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/pull_request_template.md ================================================ ## What it does - ## How to test 1. 2. 3. ## Screenshot ================================================ FILE: .github/workflows/merge-ci.yml ================================================ name: Merge CI # This workflow is triggered on pull request to the repository. # Run this script when PR and status is closed on: pull_request: types: [ closed ] jobs: build: # This job will run on ubuntu virtual machine runs-on: ubuntu-latest steps: # Setup Java environment in order to build the Android app. - uses: actions/checkout@v4.2.1 - uses: actions/setup-java@v4.3.0 with: distribution: 'zulu' # See 'Supported distributions' for available options java-version: '17' # Setup the flutter environment. - uses: subosito/flutter-action@v2 with: channel: 'stable' # 'dev', 'alpha', default to: 'stable' # flutter-version: '1.12.x' # you can also specify exact version of flutter # Get flutter dependencies. - name: Run initialize flutter project run: flutter pub get ;flutter gen-l10n;flutter pub run build_runner build --delete-conflicting-outputs # Formatting code - name: Running flutter format run: dart format lib/ # Get current branch - name: Get branch name id: branch-name uses: tj-actions/branch-names@v5 # Check modified files - name: Check for modified files id: git-check run: echo "modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)" >> $GITHUB_OUTPUT # Push code changes - name: Push changes if: steps.git-check.outputs.modified == 'true' run: | git config --global user.name 'Lzyct-Bot' git config --global user.email 'lazycatlabs@users.noreply.github.com' git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} git fetch git checkout ${{ steps.branch-name.outputs.current_branch }} git commit -am "clean: apply formatting changes" git push # Run widget tests for our flutter project. - name: Run flutter test --machine --coverage run: flutter test --machine --coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # Add this secret in your repository settings file: coverage/lcov.info # Build apk. # - name: Build apk file # run: flutter build apk --flavor stg -t lib/main_stg.dart # # # Upload generated apk to the artifacts. # - name: Uploading apk file # uses: actions/upload-artifact@v1 # with: # name: staging-apk # path: build/app/outputs/flutter-apk/app-stg-release.apk - name: Delete branch if merged uses: actions/github-script@v5 with: script: | github.rest.git.deleteRef({ owner: context.repo.owner, repo: context.repo.repo, ref: `heads/${context.payload.pull_request.head.ref}`, }) ================================================ FILE: .github/workflows/pull_request-ci.yml ================================================ name: Pull Request Checker # This workflow is triggered on pull request to the repository. # Run this script when PR and status is open on: pull_request jobs: build: # This job will run on ubuntu virtual machine runs-on: ubuntu-latest steps: # Setup Java environment in order to build the Android app. - uses: actions/checkout@v4.2.0 - uses: actions/setup-java@v4.2.2 with: distribution: 'zulu' # See 'Supported distributions' for available options java-version: '17' # Setup the flutter environment. - uses: subosito/flutter-action@v2 with: channel: 'stable' # 'dev', 'alpha', default to: 'stable' #flutter-version: '3.24.3' # you can also specify exact version of flutter # Check Flutter version - name: Check Flutter version run: flutter doctor -v # Get flutter dependencies. - name: Run initialize flutter project run: flutter pub get ;flutter gen-l10n;flutter pub run build_runner build --delete-conflicting-outputs # Statically analyze the Dart code for any errors. - name: Run flutter analyze run: flutter analyze --no-fatal-infos --no-fatal-warnings # Run widget tests for our flutter project. - name: Install LCOV run: sudo apt-get update && sudo apt-get install -y lcov - name: Run flutter test --machine --coverage run: flutter test --coverage;lcov --remove coverage/lcov.info 'lib/core/localization/generated/' 'lib/core/resources/*' 'lib/utils/services/firebase/*' '**/*.g.dart' -o coverage/new_lcov.info ;genhtml coverage/new_lcov.info -o coverage/html - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # Add this secret in your repository settings file: coverage/new_lcov.info ================================================ FILE: .gitignore ================================================ # Miscellaneous *.class *.log *.pyc *.swp .DS_Store .atom/ .buildlog/ .history .svn/ # IntelliJ related *.iml *.ipr *.iws .idea/ .docs/ # The .vscode folder contains launch configuration and tasks you configure in # VS Code which you may wish to be included in version control, so this line # is commented out by default. #.vscode/ # ignore freezed and json_serializable generated files *.freezed.dart *.g.dart **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ .flutter-plugins .flutter-plugins-dependencies .packages .pub-cache/ .pub/ /build/ coverage/ lib/core/localization/generated # Web related lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols # Obfuscation related app.*.map.json # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages .metadata pubspec.lock ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ We stand with Palestine
# Flutter App Auth 📱 [![codecov](https://codecov.io/gh/lazycatlabs/flutter_auth_app/main/graph/badge.svg)](https://codecov.io/gh/lazycatlabs/flutter_auth_app)

LinkedIn This app has Auth Functions like Login, Register, and Show pagination data. The API using [apimock](https://apimock.lazycatlabs.com/) from [lazycatlabs](https://lazycatlabs.com).
This app also implementing **Flutter Clean Architecture with TDD.** https://github.com/user-attachments/assets/5b9e3559-aa18-4ba1-9e1a-d27d8d304149 ### Light and dark theme icon launcher change https://github.com/user-attachments/assets/3e200e6e-0987-4c28-a285-64e905709535 ### Light and dark theme splash change https://github.com/user-attachments/assets/2c72e060-8ee8-4c1a-9ed7-9f8e3547ecea ## Pre-requisites 📐 | Technology | Recommended Version | Installation Guide | |------------|---------------------|-----------------------------------------------------------------------| | Flutter | v3.24.x | [Flutter Official Docs](https://flutter.dev/docs/get-started/install) | | Dart | v3.5.x | Installed automatically with Flutter | ## Get Started 🚀 - Clone this project ```bash flutter pub get ``` - Run to generate localization files ```bash flutter gen-l10n ``` - Run to generate freezes files ```bash flutter pub run build_runner build --delete-conflicting-outputs ``` - Run for **staging** or ```bash flutter run --flavor stg -t lib/main.dart --dart-define-from-file .env.stg.json ``` - Run for **production** ```bash flutter run --flavor prd -t lib/main.dart --dart-define-from-file .env.prd.json ``` - Test Coverage, we ignore some folders and files which is not necessary to test coverage because it are generated file - Note: on macOS, you need to have lcov installed on your system (`brew install lcov`) to use this: ```bash flutter test -j8 --coverage;lcov --remove coverage/lcov.info 'lib/core/localization/generated/' 'lib/core/resources/*' 'lib/utils/services/firebase/*' '**/*.g.dart' -o coverage/new_lcov.info ;genhtml coverage/new_lcov.info -o coverage/html ```` - To generate a launcher icon based on Flavor ```bash dart run flutter_launcher_icons ``` - To generate native splash screen ```bash dart run flutter_native_splash:create --flavors stg,prd ``` - To generate mock class ```bash dart pub run build_runner build ``` ## Feature ✅ - [x] BLoC State Management - [x] **Clean Architecture with TDD** - [x] Unit Test - [x] Widget Test - [x] BLoC test - [x] Theme Configuration: `System, Light, Dark` - [x] Multi-Language: `English, Bahasa` - [x] Login, Register Example - [x] Pagination Example - [x] [Autofill Username and Password](https://github.com/lazycatlabs/flutter_auth_app/pull/3) - [x] Integration Test - [x] Implement multi-flavor - [x] Auto routing based on login status - [x] Implement [Go Router](https://pub.dev/packages/go_router) ## TODO 📝 - [ ] Login with Biometric / FaceID ## Maestro Test 🧪 - Install Maestro on your machine [Maestro](https://maestro.mobile.dev/getting-started/installing-maestro) - Run this command to run the test ```bash maestro test maestro-stg/main.yaml #or maestro test maestro-prd/main.yaml ``` ## Architecture Proposal by [Resocoder](https://github.com/ResoCoder/flutter-tdd-clean-architecture-course)
![architecture-proposal](./architecture-proposal.png) ## 💡Tips - **Flutter native splashscreen:** The brand image in Android > 12 the frame size is 5:2, if the width is 500px, the height should be 500/2,5 = 200px ## 📜 GNU General Public License v3.0

Buy me coffee if you love my works ☕️

buymeacoffe      ko-fi      paypal saweria



================================================ FILE: analysis_options.yaml ================================================ include: package:lint/strict.yaml analyzer: exclude: - '**.freezed.dart' - '**.g.dart' - '**.mocks.dart' - '**/core/localization/generated/**' errors: invalid_annotation_target: ignore linter: rules: sort_pub_dependencies: false avoid_dynamic_calls: false require_trailing_commas: true # Enforce trailing commas for better formatting prefer_const_constructors: true # Prefer const constructors where possible prefer_const_literals_to_create_immutables: true # Prefer const for immutable literals avoid_unnecessary_containers: true # Discourage unnecessary Container usage always_put_control_body_on_new_line: true # Improves readability for control flow always_put_required_named_parameters_first: true # Improves readability for function signatures prefer_single_quotes: true # Consistent string quotes unnecessary_brace_in_string_interps: true # Remove unnecessary braces in string interpolation unnecessary_late: true # Avoid unnecessary late keyword unnecessary_new: true # Remove unnecessary new keyword unnecessary_this: true # Remove unnecessary this keyword prefer_expression_function_bodies: true # Use expression function bodies for single-line functions ================================================ FILE: android/.gitignore ================================================ gradle-wrapper.jar /.gradle /captures/ /gradlew /gradlew.bat /local.properties GeneratedPluginRegistrant.java app/.cxx # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app key.properties ================================================ FILE: android/app/build.gradle ================================================ plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" id "com.google.gms.google-services" id "com.google.firebase.crashlytics" } def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } android { namespace "com.lazycatlabs.auth" compileSdk 36 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8 } sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.lazycatlabs.auth" minSdkVersion flutter.minSdkVersion targetSdkVersion 35 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } buildTypes { buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.debug // Enables code shrinking, obfuscation, and optimization for only // your project's release build type. minifyEnabled true // Enables resource shrinking, which is performed by the // Android Gradle plugin. shrinkResources true // Includes the default ProGuard rules files that are packaged with // the Android Gradle plugin. To learn more, go to the section about // R8 configuration files. proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt'), 'proguard-rules.pro' } } } flavorDimensions = ["env"] productFlavors { stg { dimension 'env' versionNameSuffix '-stg' applicationIdSuffix ".stg" // TODO : Enable this if you want sign your app // signingConfig signingConfigs.release } prd { dimension 'env' // TODO : Enable this if you want sign your app // signingConfig signingConfigs.release } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0" implementation platform('com.google.firebase:firebase-bom:34.1.0') implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.google.firebase:firebase-analytics' } ================================================ FILE: android/app/google-services.json ================================================ { "project_info": { "project_number": "933342696488", "project_id": "mobile-app-bd59b", "storage_bucket": "mobile-app-bd59b.appspot.com" }, "client": [ { "client_info": { "mobilesdk_app_id": "1:933342696488:android:38f3c637080d914d87511d", "android_client_info": { "package_name": "com.james.weighttracker" } }, "oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyCdU1UveIWYwX-Lsmtl7pIigbu5lug-pTU" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.auths" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:933342696488:android:2a6b2649b130a09e87511d", "android_client_info": { "package_name": "com.lazycatlabs.auth" } }, "oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyCdU1UveIWYwX-Lsmtl7pIigbu5lug-pTU" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.auths" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:933342696488:android:952e68fef0689db687511d", "android_client_info": { "package_name": "com.lazycatlabs.base" } }, "oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyCdU1UveIWYwX-Lsmtl7pIigbu5lug-pTU" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.auths" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:933342696488:android:009bd6bce9a55acb87511d", "android_client_info": { "package_name": "com.lazycatlabs.wautils" } }, "oauth_client": [ { "client_id": "933342696488-i2co7br6pib2js7a8vsjpio4164n0qci.apps.googleusercontent.com", "client_type": 1, "android_info": { "package_name": "com.lazycatlabs.wautils", "certificate_hash": "5cde980e56edd8e9c7396c3a900a0939dcc19681" } }, { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyCdU1UveIWYwX-Lsmtl7pIigbu5lug-pTU" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "933342696488-65r3ei8hig6p8d4mhng670foqjr63ntt.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.auths" } } ] } } } ], "configuration_version": "1" } ================================================ FILE: android/app/proguard-rules.pro ================================================ ## Flutter wrapper -keep class io.flutter.app.** { *; } -keep class io.flutter.plugin.** { *; } -keep class io.flutter.util.** { *; } -keep class io.flutter.view.** { *; } -keep class io.flutter.** { *; } -keep class io.flutter.plugins.** { *; } -dontwarn io.flutter.embedding.** ## Gson rules # Gson uses generic type information stored in a class file when working with fields. Proguard # removes such information by default, so configure it to keep all of it. -keepattributes Signature # For using GSON @Expose annotation -keepattributes *Annotation* # Gson specific classes -dontwarn sun.misc.** #-keep class com.google.gson.stream.** { *; } # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory, # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter) -keep class * extends com.google.gson.TypeAdapter -keep class * implements com.google.gson.TypeAdapterFactory -keep class * implements com.google.gson.JsonSerializer -keep class * implements com.google.gson.JsonDeserializer # Prevent R8 from leaving Data object members always null -keepclassmembers,allowobfuscation class * { @com.google.gson.annotations.SerializedName ; } ================================================ FILE: android/app/src/debug/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/main/kotlin/com/lazycatlabs/auth/MainActivity.kt ================================================ package com.lazycatlabs.auth import android.os.Build import android.os.Bundle import androidx.core.view.WindowCompat import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { override fun onCreate(savedInstanceState: Bundle?) { // Aligns the Flutter view vertically with the window. WindowCompat.setDecorFitsSystemWindows(getWindow(), false) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { // Disable the Android splash screen fade out animation to avoid // a flicker before the similar frame is drawn in Flutter. splashScreen.setOnExitAnimationListener { splashScreenView -> splashScreenView.remove() } } super.onCreate(savedInstanceState) } } ================================================ FILE: android/app/src/main/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/main/res/drawable/launch_background_12.xml ================================================ ================================================ FILE: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml ================================================ ================================================ FILE: android/app/src/main/res/values/colors.xml ================================================ #1E1E2E ================================================ FILE: android/app/src/main/res/values/strings.xml ================================================ Flutter Auth ================================================ FILE: android/app/src/main/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/main/res/values-night/styles.xml ================================================ ================================================ FILE: android/app/src/prd/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/prd/res/drawable-night/launch_background.xml ================================================ ================================================ FILE: android/app/src/prd/res/drawable-night-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/prd/res/drawable-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/prd/res/mipmap-anydpi-v26/ic_launcher.xml ================================================ ================================================ FILE: android/app/src/prd/res/values/colors.xml ================================================ #FFFFFF ================================================ FILE: android/app/src/prd/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/prd/res/values-night/styles.xml ================================================ ================================================ FILE: android/app/src/prd/res/values-night-v31/styles.xml ================================================ ================================================ FILE: android/app/src/prd/res/values-v31/styles.xml ================================================ ================================================ FILE: android/app/src/profile/AndroidManifest.xml ================================================ ================================================ FILE: android/app/src/stg/google-services.json ================================================ { "project_info": { "project_number": "520881115656", "project_id": "sample-49e7c", "storage_bucket": "sample-49e7c.appspot.com" }, "client": [ { "client_info": { "mobilesdk_app_id": "1:520881115656:android:854b1e7d966a0555fd77bd", "android_client_info": { "package_name": "com.james.weighttracker" } }, "oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyAXDLxYlgYywHeVs8Ch8uOq2t2BmtjOM0s" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "520881115656-c82m945c9cc483231hmgn0g8nke7c3q8.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.base.stg" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:520881115656:android:5ce1808f01692ab2fd77bd", "android_client_info": { "package_name": "com.lazycatlabs.auth" } }, "oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyAXDLxYlgYywHeVs8Ch8uOq2t2BmtjOM0s" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "520881115656-c82m945c9cc483231hmgn0g8nke7c3q8.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.base.stg" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:520881115656:android:2ccc910b48e53ef3fd77bd", "android_client_info": { "package_name": "com.lazycatlabs.auth.stg" } }, "oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyAXDLxYlgYywHeVs8Ch8uOq2t2BmtjOM0s" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "520881115656-c82m945c9cc483231hmgn0g8nke7c3q8.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.base.stg" } } ] } } }, { "client_info": { "mobilesdk_app_id": "1:520881115656:android:5cfc03a06988cdfdfd77bd", "android_client_info": { "package_name": "com.lazycatlabs.base.stg" } }, "oauth_client": [ { "client_id": "520881115656-f6flpcn2p16h87t3aq78tnlrrrmcgm4i.apps.googleusercontent.com", "client_type": 1, "android_info": { "package_name": "com.lazycatlabs.base.stg", "certificate_hash": "9818aa85a4c2dbc1bf9b9901c52142410e929530" } }, { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { "current_key": "AIzaSyAXDLxYlgYywHeVs8Ch8uOq2t2BmtjOM0s" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { "client_id": "520881115656-b0iggeu3s5ophb4p94caa0h5jsmd9j7d.apps.googleusercontent.com", "client_type": 3 }, { "client_id": "520881115656-c82m945c9cc483231hmgn0g8nke7c3q8.apps.googleusercontent.com", "client_type": 2, "ios_info": { "bundle_id": "com.lazycatlabs.base.stg" } } ] } } } ], "configuration_version": "1" } ================================================ FILE: android/app/src/stg/res/drawable/launch_background.xml ================================================ ================================================ FILE: android/app/src/stg/res/drawable-night/launch_background.xml ================================================ ================================================ FILE: android/app/src/stg/res/drawable-night-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/stg/res/drawable-v21/launch_background.xml ================================================ ================================================ FILE: android/app/src/stg/res/mipmap-anydpi-v26/ic_launcher.xml ================================================ ================================================ FILE: android/app/src/stg/res/values/colors.xml ================================================ #FFFFFF ================================================ FILE: android/app/src/stg/res/values/strings.xml ================================================ Flutter Auth STG ================================================ FILE: android/app/src/stg/res/values/styles.xml ================================================ ================================================ FILE: android/app/src/stg/res/values-night/styles.xml ================================================ ================================================ FILE: android/app/src/stg/res/values-night-v31/styles.xml ================================================ ================================================ FILE: android/app/src/stg/res/values-v31/styles.xml ================================================ ================================================ FILE: android/build.gradle ================================================ allprojects { repositories { google() mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } tasks.register("clean", Delete) { delete rootProject.buildDir } ================================================ FILE: android/gradle/wrapper/gradle-wrapper.properties ================================================ #Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip ================================================ FILE: android/gradle.properties ================================================ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true ================================================ FILE: android/settings.gradle ================================================ pluginManagement { def flutterSdkPath = { def properties = new Properties() file("local.properties").withInputStream { properties.load(it) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" return flutterSdkPath } settings.ext.flutterSdkPath = flutterSdkPath() includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "8.7.0" apply false id "org.jetbrains.kotlin.android" version "2.2.20" apply false id "com.google.gms.google-services" version "4.4.0" apply false id "com.google.firebase.crashlytics" version "2.9.9" apply false } include ":app" ================================================ FILE: build.yaml ================================================ targets: $default: builders: json_serializable: options: explicit_to_json: true ================================================ FILE: codecov.yml ================================================ # codecov.yml codecov: require_ci_to_pass: yes coverage: precision: 2 round: down range: "70...100" status: project: default: target: 80% # the required coverage value threshold: 1% # the leniency in hitting the target patch: default: target: 80% ignore: - "lib/core/localization/generated/" # Generated files - "lib/utils/services/firebase/*" # Firebase services - "lib/core/resources/*" # Resources - "lib/generated/**/*" # Generated files - "**/*.g.dart" # Generated files - "**/*.freezed.dart" # Freezed generated files ================================================ FILE: flutter_launcher_icons-prd.yaml ================================================ flutter_launcher_icons: android: true ios: true remove_alpha_ios: true image_path: "assets/images/ic_launcher.png" image_path_ios_dark_transparent: "assets/images/ic_launcher_dark.png" adaptive_icon_background: "#FFFFFF" adaptive_icon_foreground: "assets/images/ic_launcher_foreground.png" ================================================ FILE: flutter_launcher_icons-stg.yaml ================================================ flutter_launcher_icons: android: true ios: true remove_alpha_ios: true image_path: "assets/images/ic_launcher_stg.png" image_path_ios_dark_transparent: "assets/images/ic_launcher_stg_dark.png" adaptive_icon_background: "#FFFFFF" adaptive_icon_foreground: "assets/images/ic_launcher_foreground_stg.png" ================================================ FILE: flutter_native_splash-prd.yaml ================================================ flutter_native_splash: color: "#ffffff" image: assets/images/ic_logo.png branding: assets/images/ic_branding.png color_dark: "#000000" image_dark: assets/images/ic_logo_dark.png branding_dark: assets/images/ic_branding_dark.png branding_bottom_padding_ios: 24 branding_bottom_padding_android: 0 android_12: image: assets/images/ic_logo_12.png icon_background_color: "#ffffff" branding: assets/images/ic_branding_12.png image_dark: assets/images/ic_logo_12_dark.png icon_background_color_dark: "#000000" branding_dark: assets/images/ic_branding_12_dark.png web: false ================================================ FILE: flutter_native_splash-stg.yaml ================================================ flutter_native_splash: color: "#ffffff" image: assets/images/ic_logo_stg.png branding: assets/images/ic_branding.png color_dark: "#000000" image_dark: assets/images/ic_logo_stg_dark.png branding_dark: assets/images/ic_branding_dark.png branding_bottom_padding_ios: 24 branding_bottom_padding_android: 0 android_12: image: assets/images/ic_logo_12_stg.png icon_background_color: "#ffffff" branding: assets/images/ic_branding_12.png image_dark: assets/images/ic_logo_12_stg_dark.png icon_background_color_dark: "#000000" branding_dark: assets/images/ic_branding_12_dark.png web: false ================================================ FILE: ios/.gitignore ================================================ *.mode1v3 *.mode2v3 *.moved-aside *.pbxuser *.perspectivev3 **/*sync/ .sconsign.dblite .tags* **/.vagrant/ **/DerivedData/ Icon? **/Pods/ **/.symlinks/ profile xcuserdata **/.generated/ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ Flutter/flutter_export_environment.sh ServiceDefinitions.json Runner/GeneratedPluginRegistrant.* # Exceptions to above rules. !default.mode1v3 !default.mode2v3 !default.pbxuser !default.perspectivev3 # Ignore build folder build/ ================================================ FILE: ios/Flutter/AppFrameworkInfo.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable App CFBundleIdentifier io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName App CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion 1.0 MinimumOSVersion 13.0 ================================================ FILE: ios/Flutter/Debug.xcconfig ================================================ #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Flutter/Release.xcconfig ================================================ #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" ================================================ FILE: ios/Flutter/ephemeral/flutter_lldb_helper.py ================================================ # # Generated file, do not edit. # import lldb def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict): """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages.""" base = frame.register["x0"].GetValueAsAddress() page_len = frame.register["x1"].GetValueAsUnsigned() # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the # first page to see if handled it correctly. This makes diagnosing # misconfiguration (e.g. missing breakpoint) easier. data = bytearray(page_len) data[0:8] = b'IHELPED!' error = lldb.SBError() frame.GetThread().GetProcess().WriteMemory(base, data, error) if not error.Success(): print(f'Failed to write into {base}[+{page_len}]', error) return def __lldb_init_module(debugger: lldb.SBDebugger, _): target = debugger.GetDummyTarget() # Caveat: must use BreakpointCreateByRegEx here and not # BreakpointCreateByName. For some reasons callback function does not # get carried over from dummy target for the later. bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$") bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__)) bp.SetAutoContinue(True) print("-- LLDB integration loaded --") ================================================ FILE: ios/Flutter/ephemeral/flutter_lldbinit ================================================ # # Generated file, do not edit. # command script import --relative-to-command-file flutter_lldb_helper.py ================================================ FILE: ios/Podfile ================================================ # Uncomment this line to define a global platform for your project # platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' project 'Runner', { 'Debug' => :debug, 'Profile' => :release, 'Release' => :release, } def flutter_root generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) unless File.exist?(generated_xcode_build_settings_path) raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" end File.foreach(generated_xcode_build_settings_path) do |line| matches = line.match(/FLUTTER_ROOT\=(.*)/) return matches[1].strip if matches end raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" end require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) flutter_ios_podfile_setup target 'Runner' do use_frameworks! use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end ================================================ FILE: ios/Runner/AppDelegate.swift ================================================ import UIKit import Flutter @main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ================================================ FILE: ios/Runner/Assets.xcassets/AppIcon-prd.appiconset/Contents.json ================================================ {"images":[{"size":"20x20","idiom":"universal","filename":"AppIcon-prd-20x20@2x.png","scale":"2x","platform":"ios"},{"size":"20x20","idiom":"universal","filename":"AppIcon-prd-20x20@3x.png","scale":"3x","platform":"ios"},{"size":"29x29","idiom":"universal","filename":"AppIcon-prd-29x29@2x.png","scale":"2x","platform":"ios"},{"size":"29x29","idiom":"universal","filename":"AppIcon-prd-29x29@3x.png","scale":"3x","platform":"ios"},{"size":"38x38","idiom":"universal","filename":"AppIcon-prd-38x38@2x.png","scale":"2x","platform":"ios"},{"size":"38x38","idiom":"universal","filename":"AppIcon-prd-38x38@3x.png","scale":"3x","platform":"ios"},{"size":"40x40","idiom":"universal","filename":"AppIcon-prd-40x40@2x.png","scale":"2x","platform":"ios"},{"size":"40x40","idiom":"universal","filename":"AppIcon-prd-40x40@3x.png","scale":"3x","platform":"ios"},{"size":"60x60","idiom":"universal","filename":"AppIcon-prd-60x60@2x.png","scale":"2x","platform":"ios"},{"size":"60x60","idiom":"universal","filename":"AppIcon-prd-60x60@3x.png","scale":"3x","platform":"ios"},{"size":"64x64","idiom":"universal","filename":"AppIcon-prd-64x64@2x.png","scale":"2x","platform":"ios"},{"size":"64x64","idiom":"universal","filename":"AppIcon-prd-64x64@3x.png","scale":"3x","platform":"ios"},{"size":"68x68","idiom":"universal","filename":"AppIcon-prd-68x68@2x.png","scale":"2x","platform":"ios"},{"size":"76x76","idiom":"universal","filename":"AppIcon-prd-76x76@2x.png","scale":"2x","platform":"ios"},{"size":"83.5x83.5","idiom":"universal","filename":"AppIcon-prd-83.5x83.5@2x.png","scale":"2x","platform":"ios"},{"size":"1024x1024","idiom":"universal","filename":"AppIcon-prd-1024x1024@1x.png","scale":"1x","platform":"ios"},{"size":"1024x1024","idiom":"ios-marketing","filename":"AppIcon-prd-1024x1024@1x.png","scale":"1x"},{"size":"20x20","idiom":"universal","filename":"AppIcon-prd-Dark-20x20@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"20x20","idiom":"universal","filename":"AppIcon-prd-Dark-20x20@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"29x29","idiom":"universal","filename":"AppIcon-prd-Dark-29x29@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"29x29","idiom":"universal","filename":"AppIcon-prd-Dark-29x29@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"38x38","idiom":"universal","filename":"AppIcon-prd-Dark-38x38@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"38x38","idiom":"universal","filename":"AppIcon-prd-Dark-38x38@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"40x40","idiom":"universal","filename":"AppIcon-prd-Dark-40x40@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"40x40","idiom":"universal","filename":"AppIcon-prd-Dark-40x40@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"60x60","idiom":"universal","filename":"AppIcon-prd-Dark-60x60@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"60x60","idiom":"universal","filename":"AppIcon-prd-Dark-60x60@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"64x64","idiom":"universal","filename":"AppIcon-prd-Dark-64x64@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"64x64","idiom":"universal","filename":"AppIcon-prd-Dark-64x64@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"68x68","idiom":"universal","filename":"AppIcon-prd-Dark-68x68@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"76x76","idiom":"universal","filename":"AppIcon-prd-Dark-76x76@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"83.5x83.5","idiom":"universal","filename":"AppIcon-prd-Dark-83.5x83.5@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"1024x1024","idiom":"universal","filename":"AppIcon-prd-Dark-1024x1024@1x.png","scale":"1x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]}],"info":{"version":1,"author":"xcode"}} ================================================ FILE: ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/Contents.json ================================================ {"images":[{"size":"20x20","idiom":"universal","filename":"AppIcon-stg-20x20@2x.png","scale":"2x","platform":"ios"},{"size":"20x20","idiom":"universal","filename":"AppIcon-stg-20x20@3x.png","scale":"3x","platform":"ios"},{"size":"29x29","idiom":"universal","filename":"AppIcon-stg-29x29@2x.png","scale":"2x","platform":"ios"},{"size":"29x29","idiom":"universal","filename":"AppIcon-stg-29x29@3x.png","scale":"3x","platform":"ios"},{"size":"38x38","idiom":"universal","filename":"AppIcon-stg-38x38@2x.png","scale":"2x","platform":"ios"},{"size":"38x38","idiom":"universal","filename":"AppIcon-stg-38x38@3x.png","scale":"3x","platform":"ios"},{"size":"40x40","idiom":"universal","filename":"AppIcon-stg-40x40@2x.png","scale":"2x","platform":"ios"},{"size":"40x40","idiom":"universal","filename":"AppIcon-stg-40x40@3x.png","scale":"3x","platform":"ios"},{"size":"60x60","idiom":"universal","filename":"AppIcon-stg-60x60@2x.png","scale":"2x","platform":"ios"},{"size":"60x60","idiom":"universal","filename":"AppIcon-stg-60x60@3x.png","scale":"3x","platform":"ios"},{"size":"64x64","idiom":"universal","filename":"AppIcon-stg-64x64@2x.png","scale":"2x","platform":"ios"},{"size":"64x64","idiom":"universal","filename":"AppIcon-stg-64x64@3x.png","scale":"3x","platform":"ios"},{"size":"68x68","idiom":"universal","filename":"AppIcon-stg-68x68@2x.png","scale":"2x","platform":"ios"},{"size":"76x76","idiom":"universal","filename":"AppIcon-stg-76x76@2x.png","scale":"2x","platform":"ios"},{"size":"83.5x83.5","idiom":"universal","filename":"AppIcon-stg-83.5x83.5@2x.png","scale":"2x","platform":"ios"},{"size":"1024x1024","idiom":"universal","filename":"AppIcon-stg-1024x1024@1x.png","scale":"1x","platform":"ios"},{"size":"1024x1024","idiom":"ios-marketing","filename":"AppIcon-stg-1024x1024@1x.png","scale":"1x"},{"size":"20x20","idiom":"universal","filename":"AppIcon-stg-Dark-20x20@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"20x20","idiom":"universal","filename":"AppIcon-stg-Dark-20x20@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"29x29","idiom":"universal","filename":"AppIcon-stg-Dark-29x29@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"29x29","idiom":"universal","filename":"AppIcon-stg-Dark-29x29@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"38x38","idiom":"universal","filename":"AppIcon-stg-Dark-38x38@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"38x38","idiom":"universal","filename":"AppIcon-stg-Dark-38x38@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"40x40","idiom":"universal","filename":"AppIcon-stg-Dark-40x40@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"40x40","idiom":"universal","filename":"AppIcon-stg-Dark-40x40@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"60x60","idiom":"universal","filename":"AppIcon-stg-Dark-60x60@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"60x60","idiom":"universal","filename":"AppIcon-stg-Dark-60x60@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"64x64","idiom":"universal","filename":"AppIcon-stg-Dark-64x64@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"64x64","idiom":"universal","filename":"AppIcon-stg-Dark-64x64@3x.png","scale":"3x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"68x68","idiom":"universal","filename":"AppIcon-stg-Dark-68x68@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"76x76","idiom":"universal","filename":"AppIcon-stg-Dark-76x76@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"83.5x83.5","idiom":"universal","filename":"AppIcon-stg-Dark-83.5x83.5@2x.png","scale":"2x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]},{"size":"1024x1024","idiom":"universal","filename":"AppIcon-stg-Dark-1024x1024@1x.png","scale":"1x","platform":"ios","appearances":[{"appearance":"luminosity","value":"dark"}]}],"info":{"version":1,"author":"xcode"}} ================================================ FILE: ios/Runner/Assets.xcassets/BrandingImagePrd.imageset/Contents.json ================================================ { "images" : [ { "filename" : "BrandingImage.png", "idiom" : "universal", "scale" : "1x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark.png", "idiom" : "universal", "scale" : "1x" }, { "filename" : "BrandingImage@2x.png", "idiom" : "universal", "scale" : "2x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark@2x.png", "idiom" : "universal", "scale" : "2x" }, { "filename" : "BrandingImage@3x.png", "idiom" : "universal", "scale" : "3x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark@3x.png", "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/BrandingImageStg.imageset/Contents.json ================================================ { "images" : [ { "filename" : "BrandingImage.png", "idiom" : "universal", "scale" : "1x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark.png", "idiom" : "universal", "scale" : "1x" }, { "filename" : "BrandingImage@2x.png", "idiom" : "universal", "scale" : "2x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark@2x.png", "idiom" : "universal", "scale" : "2x" }, { "filename" : "BrandingImage@3x.png", "idiom" : "universal", "scale" : "3x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "BrandingImageDark@3x.png", "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/Contents.json ================================================ { "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchBackgroundPrd.imageset/Contents.json ================================================ { "images" : [ { "filename" : "background.png", "idiom" : "universal" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "darkbackground.png", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchBackgroundStg.imageset/Contents.json ================================================ { "images" : [ { "filename" : "background.png", "idiom" : "universal" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "darkbackground.png", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImagePrd.imageset/Contents.json ================================================ { "images" : [ { "filename" : "LaunchImage.png", "idiom" : "universal", "scale" : "1x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark.png", "idiom" : "universal", "scale" : "1x" }, { "filename" : "LaunchImage@2x.png", "idiom" : "universal", "scale" : "2x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark@2x.png", "idiom" : "universal", "scale" : "2x" }, { "filename" : "LaunchImage@3x.png", "idiom" : "universal", "scale" : "3x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark@3x.png", "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Assets.xcassets/LaunchImageStg.imageset/Contents.json ================================================ { "images" : [ { "filename" : "LaunchImage.png", "idiom" : "universal", "scale" : "1x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark.png", "idiom" : "universal", "scale" : "1x" }, { "filename" : "LaunchImage@2x.png", "idiom" : "universal", "scale" : "2x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark@2x.png", "idiom" : "universal", "scale" : "2x" }, { "filename" : "LaunchImage@3x.png", "idiom" : "universal", "scale" : "3x" }, { "appearances" : [ { "appearance" : "luminosity", "value" : "dark" } ], "filename" : "LaunchImageDark@3x.png", "idiom" : "universal", "scale" : "3x" } ], "info" : { "author" : "xcode", "version" : 1 } } ================================================ FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/LaunchScreenPrd.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/LaunchScreenStg.storyboard ================================================ ================================================ FILE: ios/Runner/Base.lproj/Main.storyboard ================================================ ================================================ FILE: ios/Runner/Info.plist ================================================ CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName $(APP_DISPLAY_NAME) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName flutter_auth_app CFBundlePackageType APPL CFBundleShortVersionString $(FLUTTER_BUILD_NAME) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS NSAppleMusicUsageDescription Apple Music Description NSCalendarsUsageDescription Calendar description NSContactsUsageDescription Contact description NSLocationAlwaysUsageDescription NSLocationAlwaysUsageDescription NSLocationWhenInUseUsageDescription NSLocationWhenInUseUsageDescription NSMotionUsageDescription NSMotionUsageDescription NSSpeechRecognitionUsageDescription NSSpeechRecognitionUsageDescription UILaunchStoryboardName ${LAUNCH_SCREEN} UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIViewControllerBasedStatusBarAppearance UIApplicationSupportsIndirectInputEvents UIStatusBarHidden ================================================ FILE: ios/Runner/Runner-Bridging-Header.h ================================================ #import "GeneratedPluginRegistrant.h" ================================================ FILE: ios/Runner/Runner.entitlements ================================================ com.apple.developer.associated-domains applinks:lazycatlabs.com webcredentials:lazycatlabs.com ================================================ FILE: ios/Runner.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 780A53CC2C246251002E0A2C /* LaunchScreenStg.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 780A53C82C246251002E0A2C /* LaunchScreenStg.storyboard */; }; 780A53CD2C246251002E0A2C /* LaunchScreenPrd.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 780A53CA2C246251002E0A2C /* LaunchScreenPrd.storyboard */; }; 78CA03382868ACF50042EE7F /* config in Resources */ = {isa = PBXBuildFile; fileRef = 78CA03372868ACF50042EE7F /* config */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; E2D6FEB538A115832E8C4BC4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 908EE3BAD9BEF949EA5DCFB2 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 5BBAB033A16FB58C30E02EBD /* Pods-Runner.release-prd.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-prd.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-prd.xcconfig"; sourceTree = ""; }; 63A93C53F07E2C630D7ABD08 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 6AC1EB5494E13DCE832B3B38 /* Pods-Runner.release-stg.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release-stg.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release-stg.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 780A53C92C246251002E0A2C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreenStg.storyboard; sourceTree = ""; }; 780A53CB2C246251002E0A2C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreenPrd.storyboard; sourceTree = ""; }; 78CA03372868ACF50042EE7F /* config */ = {isa = PBXFileReference; lastKnownFileType = folder; path = config; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 908EE3BAD9BEF949EA5DCFB2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AB4713132823F47900D6ED06 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; ADEFC56A2C5A340E42B7B20A /* Pods-Runner.debug-stg.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-stg.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-stg.xcconfig"; sourceTree = ""; }; CD7B34EFEDDA1685D846827A /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; D5E2AD314EB23754E64D4B34 /* Pods-Runner.debug-prd.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-prd.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-prd.xcconfig"; sourceTree = ""; }; E0442FB99154CFF9A7A75600 /* Pods-Runner.profile-stg.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-stg.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-stg.xcconfig"; sourceTree = ""; }; E7AF144A3EF15B9DE242E60B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; EFF278CECE2951ED1B883959 /* Pods-Runner.profile-prd.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile-prd.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile-prd.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( E2D6FEB538A115832E8C4BC4 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 18A557447A2C925D0884E8F0 /* Frameworks */ = { isa = PBXGroup; children = ( 908EE3BAD9BEF949EA5DCFB2 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; 38EE4B8F6C60E036C6AE3FA2 /* Pods */ = { isa = PBXGroup; children = ( CD7B34EFEDDA1685D846827A /* Pods-Runner.debug.xcconfig */, E7AF144A3EF15B9DE242E60B /* Pods-Runner.release.xcconfig */, 63A93C53F07E2C630D7ABD08 /* Pods-Runner.profile.xcconfig */, D5E2AD314EB23754E64D4B34 /* Pods-Runner.debug-prd.xcconfig */, ADEFC56A2C5A340E42B7B20A /* Pods-Runner.debug-stg.xcconfig */, 5BBAB033A16FB58C30E02EBD /* Pods-Runner.release-prd.xcconfig */, 6AC1EB5494E13DCE832B3B38 /* Pods-Runner.release-stg.xcconfig */, EFF278CECE2951ED1B883959 /* Pods-Runner.profile-prd.xcconfig */, E0442FB99154CFF9A7A75600 /* Pods-Runner.profile-stg.xcconfig */, ); path = Pods; sourceTree = ""; }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, ); name = Flutter; sourceTree = ""; }; 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( 78CA03372868ACF50042EE7F /* config */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 38EE4B8F6C60E036C6AE3FA2 /* Pods */, 18A557447A2C925D0884E8F0 /* Frameworks */, ); sourceTree = ""; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, ); name = Products; sourceTree = ""; }; 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( 780A53CA2C246251002E0A2C /* LaunchScreenPrd.storyboard */, 780A53C82C246251002E0A2C /* LaunchScreenStg.storyboard */, AB4713132823F47900D6ED06 /* Runner.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C147021CF9000F007C117D /* Info.plist */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, ); path = Runner; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 7B4F8DD92B482FFFC26A5465 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 26110B88D73D3AE38C9A856A /* [CP] Embed Pods Frameworks */, 78CA03392868AD680042EE7F /* Copy GoogleService-Info.plist to the correct location */, 785534932A66121900BBB266 /* ShellScript */, ); buildRules = ( ); dependencies = ( ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 97C146E51CF9000F007C117D; productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 780A53CC2C246251002E0A2C /* LaunchScreenStg.storyboard in Resources */, 78CA03382868ACF50042EE7F /* config in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 780A53CD2C246251002E0A2C /* LaunchScreenPrd.storyboard in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ 26110B88D73D3AE38C9A856A /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 785534932A66121900BBB266 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}", "$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)", ); outputFileListPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/FirebaseCrashlytics/run\"\n"; }; 78CA03392868AD680042EE7F /* Copy GoogleService-Info.plist to the correct location */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( ); name = "Copy GoogleService-Info.plist to the correct location"; outputFileListPaths = ( ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/zsh; shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nsetopt KSH_ARRAYS BASH_REMATCH\nenvironment=\"default\"\n\n# Regex to extract the scheme name from the Build Configuration\n# We have named our Build Configurations as Debug-dev, Debug-prod etc.\n# Here, dev and prod are the scheme names. This kind of naming is required by Flutter for flavors to work.\n# We are using the $CONFIGURATION variable available in the XCode build environment to extract \n# the environment (or flavor)\n# For eg.\n# If CONFIGURATION=\"Debug-prod\", then environment will get set to \"prod\".\nif [[ $CONFIGURATION =~ -([^-]*)$ ]]; then\nenvironment=${BASH_REMATCH[1]}\nfi\n\necho $environment\n\n# Name and path of the resource we're copying\nGOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist\nGOOGLESERVICE_INFO_FILE=${PROJECT_DIR}/config/${environment}/${GOOGLESERVICE_INFO_PLIST}\n\n# Make sure GoogleService-Info.plist exists\necho \"Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_FILE}\"\nif [ ! -f $GOOGLESERVICE_INFO_FILE ]\nthen\necho \"No GoogleService-Info.plist found. Please ensure it's in the proper directory.\"\nexit 1\nfi\n\n# Get a reference to the destination location for the GoogleService-Info.plist\n# This is the default location where Firebase init code expects to find GoogleServices-Info.plist file\nPLIST_DESTINATION=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app\necho \"Will copy ${GOOGLESERVICE_INFO_PLIST} to final destination: ${PLIST_DESTINATION}\"\n\n# Copy over the prod GoogleService-Info.plist for Release builds\ncp \"${GOOGLESERVICE_INFO_FILE}\" \"${PLIST_DESTINATION}\"\nunsetopt KSH_ARRAYS\n"; }; 7B4F8DD92B482FFFC26A5465 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); inputPaths = ( "${PODS_PODFILE_DIR_PATH}/Podfile.lock", "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 780A53C82C246251002E0A2C /* LaunchScreenStg.storyboard */ = { isa = PBXVariantGroup; children = ( 780A53C92C246251002E0A2C /* Base */, ); name = LaunchScreenStg.storyboard; sourceTree = ""; }; 780A53CA2C246251002E0A2C /* LaunchScreenPrd.storyboard */ = { isa = PBXVariantGroup; children = ( 780A53CB2C246251002E0A2C /* Base */, ); name = LaunchScreenPrd.storyboard; sourceTree = ""; }; 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 97C146FB1CF9000F007C117D /* Base */, ); name = Main.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 249021D3217E4FDB00AE95B9 /* Profile-prd */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = "Profile-prd"; }; 249021D4217E4FDB00AE95B9 /* Profile-prd */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prd"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenPrd; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Profile-prd"; }; 78CA03312868A9F00042EE7F /* Debug-stg */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Debug-stg"; }; 78CA03322868A9F00042EE7F /* Debug-stg */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth STG"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-stg"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenStg; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths.stg; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Debug-stg"; }; 78CA03332868A9F90042EE7F /* Profile-stg */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = "Profile-stg"; }; 78CA03342868A9F90042EE7F /* Profile-stg */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth STG"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-stg"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenStg; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths.stg; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Profile-stg"; }; 78CA03352868AA000042EE7F /* Release-stg */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = "Release-stg"; }; 78CA03362868AA000042EE7F /* Release-stg */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth STG"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-stg"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenStg; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths.stg; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Release-stg"; }; 97C147031CF9000F007C117D /* Debug-prd */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Debug-prd"; }; 97C147041CF9000F007C117D /* Release-prd */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = "Release-prd"; }; 97C147061CF9000F007C117D /* Debug-prd */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prd"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenPrd; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Debug-prd"; }; 97C147071CF9000F007C117D /* Release-prd */ = { isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { APP_DISPLAY_NAME = "Flutter Auth"; ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-prd"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = A83F92587U; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.6; LAUNCH_SCREEN = LaunchScreenPrd; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", ); PRODUCT_BUNDLE_IDENTIFIER = com.lazycatlabs.auths; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; name = "Release-prd"; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147031CF9000F007C117D /* Debug-prd */, 78CA03312868A9F00042EE7F /* Debug-stg */, 97C147041CF9000F007C117D /* Release-prd */, 78CA03352868AA000042EE7F /* Release-stg */, 249021D3217E4FDB00AE95B9 /* Profile-prd */, 78CA03332868A9F90042EE7F /* Profile-stg */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Release-prd"; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( 97C147061CF9000F007C117D /* Debug-prd */, 78CA03322868A9F00042EE7F /* Debug-stg */, 97C147071CF9000F007C117D /* Release-prd */, 78CA03362868AA000042EE7F /* Release-stg */, 249021D4217E4FDB00AE95B9 /* Profile-prd */, 78CA03342868A9F90042EE7F /* Profile-stg */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Release-prd"; }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/prd.xcscheme ================================================ ================================================ FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/stg.xcscheme ================================================ ================================================ FILE: ios/Runner.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings ================================================ PreviewsEnabled ================================================ FILE: ios/config/prd/GoogleService-Info.plist ================================================ CLIENT_ID 933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug.apps.googleusercontent.com REVERSED_CLIENT_ID com.googleusercontent.apps.933342696488-ekbqsc1q8pkvk61nj5p0f04061ivr0ug ANDROID_CLIENT_ID 933342696488-i2co7br6pib2js7a8vsjpio4164n0qci.apps.googleusercontent.com API_KEY AIzaSyAPG4_LhFSS94Jez8k20Mu4i7cyCn26hzc GCM_SENDER_ID 933342696488 PLIST_VERSION 1 BUNDLE_ID com.lazycatlabs.auths PROJECT_ID mobile-app-bd59b STORAGE_BUCKET mobile-app-bd59b.appspot.com IS_ADS_ENABLED IS_ANALYTICS_ENABLED IS_APPINVITE_ENABLED IS_GCM_ENABLED IS_SIGNIN_ENABLED GOOGLE_APP_ID 1:933342696488:ios:3ddb617c88b0363187511d ================================================ FILE: ios/config/stg/GoogleService-Info.plist ================================================ CLIENT_ID 520881115656-e14k5pcrklmsih46r01nh1fm9gt4oaf0.apps.googleusercontent.com REVERSED_CLIENT_ID com.googleusercontent.apps.520881115656-e14k5pcrklmsih46r01nh1fm9gt4oaf0 ANDROID_CLIENT_ID 520881115656-a76c2vaojcsa2kj1qk243eclfna6j6ff.apps.googleusercontent.com API_KEY AIzaSyCgylLbnzngRGnumT5dnyfx4foQ2Qdu3dY GCM_SENDER_ID 520881115656 PLIST_VERSION 1 BUNDLE_ID com.lazycatlabs.auths.stg PROJECT_ID sample-49e7c STORAGE_BUCKET sample-49e7c.appspot.com IS_ADS_ENABLED IS_ANALYTICS_ENABLED IS_APPINVITE_ENABLED IS_GCM_ENABLED IS_SIGNIN_ENABLED GOOGLE_APP_ID 1:520881115656:ios:db518045ccad29fffd77bd ================================================ FILE: l10n.yaml ================================================ arb-dir: lib/core/localization output-dir: lib/core/localization/generated template-arb-file: intl_en.arb output-localization-file: strings.dart output-class: Strings ================================================ FILE: lib/core/api/api.dart ================================================ export 'dio_client.dart'; export 'dio_interceptor.dart'; export 'isolate_parser.dart'; export 'list_api.dart'; ================================================ FILE: lib/core/api/dio_client.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:dio/dio.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/utils/utils.dart'; typedef ResponseConverter = T Function(dynamic response); class DioClient with MainBoxMixin, FirebaseCrashLogger { String baseUrl = const String.fromEnvironment('BASE_URL'); String? _token; bool _isUnitTest = false; late Dio _dio; DioClient({bool isUnitTest = false}) { _isUnitTest = isUnitTest; try { _token = token(); } catch (_) {} _dio = _createDio(); if (!_isUnitTest) { _dio.interceptors.add(DioInterceptor()); } } String token() => getData(MainBoxKeys.authToken) ?? getData(MainBoxKeys.generalToken); Dio get dio { if (_isUnitTest) { /// Return static dio if is unit test return _dio; } else { /// We need to recreate dio to avoid token issue after login try { _token = token(); } catch (_) {} final dio = _createDio(); if (!_isUnitTest) { dio.interceptors.add(DioInterceptor()); } return dio; } } Dio _createDio() => Dio( BaseOptions( baseUrl: baseUrl, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', if (_token != null) ...{'Authorization': _token}, }, receiveTimeout: const Duration(minutes: 1), connectTimeout: const Duration(minutes: 1), validateStatus: (int? status) => status! > 0, ), ); Future> getRequest( String url, { required ResponseConverter converter, Map? queryParameters, bool isIsolate = true, }) async { try { final response = await dio.get(url, queryParameters: queryParameters); if ((response.statusCode ?? 0) < 200 || (response.statusCode ?? 0) > 201) { throw DioException( requestOptions: response.requestOptions, response: response, ); } if (!isIsolate) { return Right(converter(response.data)); } final isolateParse = IsolateParser( response.data as Map, converter, ); final result = await isolateParse.parseInBackground(); return Right(result); } on DioException catch (e, stackTrace) { try { if (!_isUnitTest) { nonFatalError(error: e, stackTrace: stackTrace); } return Left( ServerFailure( e.response?.data['diagnostic']['message'] as String? ?? e.message, ), ); } catch (e) { return Left(ServerFailure(e.toString())); } } } Future> postRequest( String url, { required ResponseConverter converter, Map? data, bool isIsolate = true, }) async { try { final response = await dio.post(url, data: data); if ((response.statusCode ?? 0) < 200 || (response.statusCode ?? 0) > 201) { throw DioException( requestOptions: response.requestOptions, response: response, ); } if (!isIsolate) { return Right(converter(response.data)); } final isolateParse = IsolateParser( response.data as Map, converter, ); final result = await isolateParse.parseInBackground(); return Right(result); } on DioException catch (e, stackTrace) { try { if (!_isUnitTest) { nonFatalError(error: e, stackTrace: stackTrace); } return Left( ServerFailure( e.response?.data['diagnostic']['message'] as String? ?? e.message, ), ); } catch (e) { return Left(ServerFailure(e.toString())); } } } } ================================================ FILE: lib/core/api/dio_interceptor.dart ================================================ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/auth/auth.dart'; import 'package:flutter_auth_app/utils/utils.dart'; // coverage:ignore-start class DioInterceptor extends Interceptor with FirebaseCrashLogger, MainBoxMixin { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { String headerMessage = ''; options.headers.forEach((k, v) => headerMessage += '► $k: $v\n'); try { options.queryParameters.forEach((k, v) => debugPrint('► $k: $v')); } catch (_) {} try { const JsonEncoder encoder = JsonEncoder.withIndent(' '); final String prettyJson = encoder.convert(options.data); log.d( // ignore: unnecessary_null_comparison "REQUEST ► ︎ ${options.method != null ? options.method.toUpperCase() : 'METHOD'} ${"${options.baseUrl}${options.path}"}\n\n" 'Headers:\n' '$headerMessage\n' '❖ QueryParameters : \n' 'Body: $prettyJson', ); } catch (e, stackTrace) { log.e('Failed to extract json request $e'); nonFatalError(error: e, stackTrace: stackTrace); } super.onRequest(options, handler); } @override Future onError( DioException dioException, ErrorInterceptorHandler handler, ) async { log.e( "<-- ${dioException.message} ${dioException.response?.requestOptions != null ? (dioException.response!.requestOptions.baseUrl + dioException.response!.requestOptions.path) : 'URL'}\n\n" "${dioException.response != null ? dioException.response!.data : 'Unknown Error'}", ); nonFatalError(error: dioException, stackTrace: dioException.stackTrace); if (dioException.response?.statusCode == 401 && dioException.response?.data['meta']['description'] == 'Unauthenticated.') { if (getData(MainBoxKeys.refreshToken) != null) { await refreshToken(); // Retry the request with the new token return handler.resolve(await _retry(dioException.requestOptions)); } else { logoutBox(); } } return handler.next(dioException); } Future> _retry(RequestOptions requestOptions) { final options = Options( method: requestOptions.method, headers: requestOptions.headers, ); return DioClient().dio.request( requestOptions.path, data: requestOptions.data, queryParameters: requestOptions.queryParameters, options: options, ); } Future refreshToken() async { /// Call API Refresh token final response = await DioClient().postRequest( ListAPI.generalToken, data: { 'clientId': const String.fromEnvironment('USER_CLIENT_ID'), 'clientSecret': const String.fromEnvironment('USER_CLIENT_SECRET'), 'grantType': 'refresh_token', 'refreshToken': getData(MainBoxKeys.refreshToken), }, converter: (response) => LoginResponse.fromJson(response as Map), ); response.fold((l) => logoutBox(), (r) { final data = r.data; addData( MainBoxKeys.refreshToken, '${data?.tokenType} ${data?.refreshToken}', ); addData(MainBoxKeys.authToken, '${data?.tokenType} ${data?.token}'); }); } @override void onResponse(Response response, ResponseInterceptorHandler handler) { String headerMessage = ''; response.headers.forEach((k, v) => headerMessage += '► $k: $v\n'); const JsonEncoder encoder = JsonEncoder.withIndent(' '); final String prettyJson = encoder.convert(response.data); log.d( // ignore: unnecessary_null_comparison "◀ ︎RESPONSE ${response.statusCode} ${response.requestOptions != null ? (response.requestOptions.baseUrl + response.requestOptions.path) : 'URL'}\n\n" 'Headers:\n' '$headerMessage\n' '❖ Results : \n' 'Response: $prettyJson', ); super.onResponse(response, handler); } } // coverage:ignore-end ================================================ FILE: lib/core/api/isolate_parser.dart ================================================ import 'dart:isolate'; import 'package:flutter_auth_app/core/core.dart'; class IsolateParser { final Map json; ResponseConverter converter; IsolateParser(this.json, this.converter); Future parseInBackground() async { final port = ReceivePort(); await Isolate.spawn(_parseListOfJson, port.sendPort); final result = await port.first; return result as T; } void _parseListOfJson(SendPort sendPort) { final result = converter(json); Isolate.exit(sendPort, result); } } ================================================ FILE: lib/core/api/list_api.dart ================================================ class ListAPI { ListAPI._(); // coverage:ignore-line /// Auth static const String generalToken = '/v1/api/auth/general'; static const String refreshToken = '/v1/api/auth/refresh'; static const String user = '/v1/api/user'; static const String login = '/v1/api/auth/login'; static const String logout = '/v1/api/auth/logout'; /// User static const String users = '/v1/api/user/all'; } ================================================ FILE: lib/core/app_route.dart ================================================ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; enum Routes { root('/'), splashScreen('/splashscreen'), /// Home Page dashboard('/dashboard'), settings('/settings'), // Auth Page login('/auth/login'), register('/auth/register'); const Routes(this.path); final String path; } class AppRoute { static late BuildContext context; static late bool isUnitTest; AppRoute.setStream(BuildContext ctx, {bool isTest = false}) { context = ctx; isUnitTest = isTest; } static final GoRouter router = GoRouter( routes: [ GoRoute( path: Routes.splashScreen.path, name: Routes.splashScreen.name, builder: (_, _) => BlocProvider( create: (_) => sl() ..generalToken( const GeneralTokenParams( clientId: String.fromEnvironment('CLIENT_ID'), clientSecret: String.fromEnvironment('CLIENT_SECRET'), ), ), child: SplashScreenPage(), ), ), GoRoute( path: Routes.root.path, name: Routes.root.name, redirect: (_, _) => Routes.dashboard.path, ), GoRoute( path: Routes.login.path, name: Routes.login.name, builder: (_, _) => BlocProvider( create: (_) => sl(), child: const LoginPage(), ), ), GoRoute( path: Routes.register.path, name: Routes.register.name, builder: (_, _) => MultiBlocProvider( providers: [ BlocProvider(create: (_) => sl()), BlocProvider(create: (_) => sl()), ], child: const RegisterPage(), ), ), ShellRoute( builder: (_, _, child) => BlocProvider( create: (context) => sl(), child: MainPage(child: child), ), routes: [ GoRoute( path: Routes.dashboard.path, name: Routes.dashboard.name, builder: (_, _) => BlocProvider( create: (_) => sl()..fetchUsers(const UsersParams()), child: const DashboardPage(), ), ), GoRoute( path: Routes.settings.path, name: Routes.settings.name, builder: (_, _) => const SettingsPage(), ), ], ), ], initialLocation: Routes.splashScreen.path, routerNeglect: true, debugLogDiagnostics: kDebugMode, refreshListenable: isUnitTest ? null //coverage:ignore-start : GoRouterRefreshStream([ context.read().stream, context.read().stream, ]), //coverage:ignore-end redirect: (_, GoRouterState state) { final bool isAllowedPages = state.matchedLocation == Routes.login.path || state.matchedLocation == Routes.register.path || state.matchedLocation == Routes.splashScreen.path; /// Check if not login /// if current page is login page we don't need to direct user /// but if not we must direct user to login page if (!((MainBoxMixin.mainBox?.get(MainBoxKeys.isLogin.name) as bool?) ?? false)) { return isAllowedPages ? null : Routes.login.path; //coverage:ignore-line } /// Check if already login and in login page /// we should direct user to main page if (isAllowedPages && ((MainBoxMixin.mainBox?.get(MainBoxKeys.isLogin.name) as bool?) ?? false)) { return Routes.root.path; } /// No direct return null; }, ); } ================================================ FILE: lib/core/core.dart ================================================ export 'api/api.dart'; export 'app_route.dart'; export 'error/error.dart'; export 'localization/localization.dart'; export 'resources/resources.dart'; export 'usecase/usecase.dart'; export 'widgets/widgets.dart'; ================================================ FILE: lib/core/error/error.dart ================================================ export 'exceptions.dart'; export 'failure.dart'; ================================================ FILE: lib/core/error/exceptions.dart ================================================ class ServerException implements Exception { String? message; ServerException(this.message); } class CacheException implements Exception {} ================================================ FILE: lib/core/error/failure.dart ================================================ abstract class Failure { /// ignore: avoid_unused_constructor_parameters const Failure([List properties = const []]); } class ServerFailure extends Failure { final String? message; const ServerFailure(this.message); @override bool operator ==(Object other) => other is ServerFailure && other.message == message; @override int get hashCode => message.hashCode; } class NoDataFailure extends Failure { @override bool operator ==(Object other) => other is NoDataFailure; @override int get hashCode => 0; } class CacheFailure extends Failure { @override bool operator ==(Object other) => other is CacheFailure; @override int get hashCode => 0; } ================================================ FILE: lib/core/localization/intl_en.arb ================================================ { "dashboard": "Dashboard", "about": "About", "selectDate": "Choose Date", "selectTime": "Choose Time", "select": "Select", "cancel": "Cancel", "pleaseWait": "Please Wait...", "login": "Login", "email": "Email", "password": "Password", "register": "Register", "askRegister": "Don't have an Account?", "errorInvalidEmail": "Email is not valid", "errorEmptyField": "Can't be empty", "errorPasswordLength": "Password must be at least 6 characters", "passwordRepeat": "Repeat Password", "errorPasswordNotMatch": "Password doesn't match", "settings": "Settings", "themeLight": "Theme Light", "themeDark": "Theme Dark", "themeSystem": "Theme System", "chooseTheme": "Choose Theme", "chooseLanguage": "Choose Language", "errorNoData": "No data", "logout": "Logout", "logoutDesc": "Do you want to logout from the app?", "yes": "Yes", "lastUpdate": "Last Update: ", "name": "Name" } ================================================ FILE: lib/core/localization/intl_id.arb ================================================ { "dashboard": "Beranda", "about": "Tentang", "selectDate": "Pilih Tanggal", "selectTime": "Pilih Waktu", "select": "Pilih", "cancel": "Batal", "pleaseWait": "Harap tunggu...", "login": "Masuk", "email": "Email", "password": "Kata Sandi", "register": "Daftar", "askRegister": "Belum punya akun?", "errorInvalidEmail": "Email tidak valid", "errorEmptyField": "Tidak boleh kosong", "errorPasswordLength": "Kata Sandi minimal 6 karakter", "passwordRepeat": "Ulangi Kata Sandi", "errorPasswordNotMatch": "Kata Sandi tidak sama", "settings": "Pengaturan", "themeLight": "Tema Terang", "themeDark": "Tema Gelap", "themeSystem": "Tema Sistem", "chooseTheme": "Pilih tema", "chooseLanguage": "Pilih bahasa", "errorNoData": "Data Kosong", "logout": "Keluar", "logoutDesc": "Apakah anda ingin keluar dari aplikasi?", "yes": "Ya", "lastUpdate": "Terakhir diperbarui: ", "name": "Nama" } ================================================ FILE: lib/core/localization/l10n.dart ================================================ import 'package:flutter/material.dart'; class L10n { L10n._(); //coverage:ignore-line static final all = [ const Locale('en'), const Locale('id'), ]; static String getFlag(String code) { switch (code) { case 'id': return 'Bahasa'; case 'en': default: return 'English'; } } } ================================================ FILE: lib/core/localization/localization.dart ================================================ export 'generated/strings.dart'; export 'l10n.dart'; ================================================ FILE: lib/core/resources/dimens.dart ================================================ import 'package:flutter_screenutil/flutter_screenutil.dart'; class Dimens { Dimens._(); static double displayLarge = 96.sp; static double displayMedium = 60.sp; static double displaySmall = 48.sp; static double headlineMedium = 34.sp; static double headlineSmall = 24.sp; static double titleLarge = 20.sp; static double bodyLarge = 16.sp; static double bodyMedium = 14.sp; static double titleMedium = 18.sp; static double titleSmall = 14.sp; static double labelLarge = 16.sp; static double bodySmall = 12.sp; static double labelSmall = 10.sp; static double zero = 0; static double space2 = 2.w; static double space3 = 3.w; static double space4 = 4.w; static double space5 = 5.w; static double space6 = 6.w; static double space8 = 8.w; static double space12 = 12.w; static double space16 = 16.w; static double space24 = 24.w; static double space30 = 30.w; static double space36 = 36.w; static double space40 = 40.w; static double space46 = 46.w; static double space50 = 50.w; static double selectedIndicatorW = 43.w; static double selectedIndicatorSmallW = 28.w; static double heightAppbarHome = 65.w; static double tab = 38.w; static double menu = 72.w; static double menuContainer = 250.w; static double carousel = 167.w; static double newsHeight = 185.w; static double textField = 50.w; static double header = 200.w; static double minLabel = 116.w; static double bottomBar = 80.w; static double profilePicture = 86.w; static double birthdayCalendar = 120.w; static double buttonH = 40.w; static double imageW = 110.w; static const double cornerRadius = 15; static const double cornerRadiusBottomSheet = 30; } ================================================ FILE: lib/core/resources/images.dart ================================================ class Images { Images._(); static String icLauncher = const String.fromEnvironment('ENV', defaultValue: 'staging') == 'staging' ? 'assets/images/ic_launcher_stg.png' : 'assets/images/ic_launcher.png'; static String icLauncherDark = const String.fromEnvironment('ENV', defaultValue: 'staging') == 'staging' ? 'assets/images/ic_launcher_stg_dark.png' : 'assets/images/ic_launcher_dark.png'; static String icLogo = const String.fromEnvironment('ENV', defaultValue: 'staging') == 'staging' ? 'assets/images/ic_logo_stg.png' : 'assets/images/ic_logo.png'; } ================================================ FILE: lib/core/resources/palette.dart ================================================ import 'package:flutter/material.dart'; // 100% — FF ## 50% — 80 // 99% — FC ## 49% — 7D // 98% — FA ## 48% — 7A // 97% — F7 ## 47% — 78 // 96% — F5 ## 46% — 75 // 95% — F2 ## 45% — 73 // 94% — F0 ## 44% — 70 // 93% — ED ## 43% — 6E // 92% — EB ## 42% — 6B // 91% — E8 ## 41% — 69 // 90% — E6 ## 40% — 66 // 89% — E3 ## 39% — 63 // 88% — E0 ## 38% — 61 // 87% — DE ## 37% — 5E // 86% — DB ## 36% — 5C // 85% — D9 ## 35% — 59 // 84% — D6 ## 34% — 57 // 83% — D4 ## 33% — 54 // 82% — D1 ## 32% — 52 // 81% — CF ## 31% — 4F // 80% — CC ## 30% — 4D // 79% — C9 ## 29% — 4A // 78% — C7 ## 28% — 47 // 77% — C4 ## 27% — 45 // 76% — C2 ## 26% — 42 // 75% — BF ## 25% — 40 // 74% — BD ## 24% — 3D // 73% — BA ## 23% — 3B // 72% — B8 ## 22% — 38 // 71% — B5 ## 21% — 36 // 70% — B3 ## 20% — 33 // 69% — B0 ## 19% — 30 // 68% — AD ## 18% — 2E // 67% — AB ## 17% — 2B // 66% — A8 ## 16% — 29 // 65% — A6 ## 15% — 26 // 64% — A3 ## 14% — 24 // 63% — A1 ## 13% — 21 // 62% — 9E ## 12% — 1F // 61% — 9C ## 11% — 1C // 60% — 99 ## 10% — 1A // 59% — 96 ## 9% — 17 // 58% — 94 ## 8% — 14 // 57% — 91 ## 7% — 12 // 56% — 8F ## 6% — 0F // 55% — 8C ## 5% — 0D // 54% — 8A ## 4% — 0A // 53% — 87 ## 3% — 08 // 52% — 85 ## 2% — 05 // 51% — 82 ## 1% — 03 class Palette { Palette._(); static const Color primary = Color(0xffFF7043); static const Color secondary = Color(0xff00838F); static const Color background = Color(0xffffffff); static const Color backgroundDark = Color(0xff000000); static const Color icon = Color(0xff000000); static const Color iconDark = Color(0xffffffff); static const Color card = backgroundDark; static const Color cardDark = background; static const Color text = Color(0xff000000); static const Color textDark = Color(0xffffffff); static const Color subText = Color(0xff757575); static const Color subTextDark = Color(0xffB0BEC5); static const Color shadow = Color(0xff8c8fa1); static const Color shadowDark = Color(0xff7f849c); static const Color banner = background; static const Color bannerDark = backgroundDark; static const Color redMocha = Color(0xfff38ba8); static const Color greenMocha = Color(0xffa6e3a1); static const Color roseWaterMocha = Color(0xfff5e0dc); static const Color flamingoMocha = Color(0xfff2cdcd); static const Color pinkMocha = Color(0xfff5c2e7); static const Color mauveMocha = Color(0xffcba6f7); static const Color maroonMocha = Color(0xffeba0ac); static const Color peachMocha = Color(0xfffab387); static const Color yellowMocha = Color(0xfff9e2af); static const Color tealMocha = Color(0xff94e2d5); static const Color sapphireMocha = Color(0xff89dceb); static const Color skyMocha = Color(0xff89dceb); static const Color blueMocha = Color(0xff89b4fa); static const Color lavenderMocha = Color(0xffb4befe); static const Color redLatte = Color(0xffd20f39); static const Color greenLatte = Color(0xff40a02b); static const Color roseWaterLatte = Color(0xffdc8a78); static const Color flamingoLatte = Color(0xffdd7878); static const Color pinkLatte = Color(0xffea76cb); static const Color mauveLatte = Color(0xff8839ef); static const Color maroonLatte = Color(0xffe64553); static const Color peachLatte = Color(0xfffe640b); static const Color yellowLatte = Color(0xffdf8e1d); static const Color tealLatte = Color(0xff179299); static const Color sapphireLatte = Color(0xff209fb5); static const Color skyLatte = Color(0xff04a5e5); static const Color blueLatte = Color(0xff1e66f5); static const Color lavenderLatte = Color(0xff7287fd); } ================================================ FILE: lib/core/resources/resources.dart ================================================ export 'dimens.dart'; export 'images.dart'; export 'palette.dart'; export 'styles.dart'; ================================================ FILE: lib/core/resources/styles.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_auth_app/core/core.dart'; /// Light theme ThemeData themeLight(BuildContext context) => ThemeData( fontFamily: 'Poppins', useMaterial3: true, primaryColor: Palette.primary, disabledColor: Palette.shadowDark, hintColor: Palette.subText, cardColor: Palette.background, scaffoldBackgroundColor: Palette.background, colorScheme: const ColorScheme.light().copyWith( primary: Palette.primary, surface: Palette.background, ), textTheme: TextTheme( displayLarge: Theme.of(context).textTheme.displayLarge?.copyWith( fontSize: Dimens.displayLarge, color: Palette.text, ), displayMedium: Theme.of(context).textTheme.displayMedium?.copyWith( fontSize: Dimens.displayMedium, color: Palette.text, ), displaySmall: Theme.of(context).textTheme.displaySmall?.copyWith( fontSize: Dimens.displaySmall, color: Palette.text, ), headlineMedium: Theme.of(context).textTheme.headlineMedium?.copyWith( fontSize: Dimens.headlineMedium, color: Palette.text, ), headlineSmall: Theme.of(context).textTheme.headlineSmall?.copyWith( fontSize: Dimens.headlineSmall, color: Palette.text, ), titleLarge: Theme.of(context).textTheme.titleLarge?.copyWith( fontSize: Dimens.titleLarge, color: Palette.text, ), titleMedium: Theme.of(context).textTheme.titleMedium?.copyWith( fontSize: Dimens.titleMedium, color: Palette.text, ), titleSmall: Theme.of(context).textTheme.titleSmall?.copyWith( fontSize: Dimens.titleSmall, color: Palette.text, ), bodyLarge: Theme.of(context).textTheme.bodyLarge?.copyWith( fontSize: Dimens.bodyLarge, color: Palette.text, ), bodyMedium: Theme.of(context).textTheme.bodyMedium?.copyWith( fontSize: Dimens.bodyMedium, color: Palette.text, ), bodySmall: Theme.of(context).textTheme.bodySmall?.copyWith( fontSize: Dimens.bodySmall, color: Palette.text, ), labelLarge: Theme.of(context).textTheme.labelLarge?.copyWith( fontSize: Dimens.labelLarge, color: Palette.text, ), labelSmall: Theme.of(context).textTheme.labelSmall?.copyWith( fontSize: Dimens.labelSmall, letterSpacing: 0.25, color: Palette.text, ), ), appBarTheme: const AppBarTheme().copyWith( titleTextStyle: Theme.of(context).textTheme.bodyLarge, color: Palette.background, iconTheme: const IconThemeData(color: Palette.icon), systemOverlayStyle: SystemUiOverlayStyle.dark .copyWith(statusBarColor: Colors.transparent), surfaceTintColor: Palette.background, shadowColor: Palette.shadow, ), drawerTheme: const DrawerThemeData().copyWith( elevation: Dimens.zero, surfaceTintColor: Palette.background, backgroundColor: Palette.background, ), bottomSheetTheme: const BottomSheetThemeData().copyWith( backgroundColor: Palette.background, surfaceTintColor: Colors.transparent, elevation: Dimens.zero, ), dialogTheme: const DialogThemeData().copyWith( backgroundColor: Palette.background, surfaceTintColor: Colors.transparent, elevation: Dimens.zero, ), brightness: Brightness.light, iconTheme: const IconThemeData(color: Palette.icon), visualDensity: VisualDensity.adaptivePlatformDensity, extensions: const >[ LzyctColors( background: Palette.background, banner: Palette.bannerDark, card: Palette.card, buttonText: Palette.text, subtitle: Palette.textDark, shadow: Palette.shadowDark, green: Palette.greenLatte, roseWater: Palette.roseWaterLatte, flamingo: Palette.flamingoLatte, pink: Palette.pinkLatte, mauve: Palette.mauveLatte, maroon: Palette.maroonLatte, peach: Palette.peachLatte, yellow: Palette.yellowLatte, teal: Palette.tealLatte, sapphire: Palette.sapphireLatte, sky: Palette.skyLatte, blue: Palette.blueLatte, lavender: Palette.lavenderLatte, red: Palette.redLatte, ), ], ); /// Dark theme ThemeData themeDark(BuildContext context) => ThemeData( fontFamily: 'Poppins', useMaterial3: true, primaryColor: Palette.primary, disabledColor: Palette.shadowDark, hintColor: Palette.subTextDark, cardColor: Palette.backgroundDark, scaffoldBackgroundColor: Palette.backgroundDark, colorScheme: const ColorScheme.dark().copyWith(primary: Palette.primary), textTheme: TextTheme( displayLarge: Theme.of(context) .textTheme .displayLarge ?.copyWith(fontSize: Dimens.displayLarge, color: Palette.textDark), displayMedium: Theme.of(context) .textTheme .displayMedium ?.copyWith(fontSize: Dimens.displayMedium, color: Palette.textDark), displaySmall: Theme.of(context) .textTheme .displaySmall ?.copyWith(fontSize: Dimens.displaySmall, color: Palette.textDark), headlineMedium: Theme.of(context).textTheme.headlineMedium?.copyWith( fontSize: Dimens.headlineMedium, color: Palette.textDark, ), headlineSmall: Theme.of(context) .textTheme .headlineSmall ?.copyWith(fontSize: Dimens.headlineSmall, color: Palette.textDark), titleLarge: Theme.of(context) .textTheme .titleLarge ?.copyWith(fontSize: Dimens.titleLarge, color: Palette.textDark), titleMedium: Theme.of(context) .textTheme .titleMedium ?.copyWith(fontSize: Dimens.titleMedium, color: Palette.textDark), titleSmall: Theme.of(context) .textTheme .titleSmall ?.copyWith(fontSize: Dimens.titleSmall, color: Palette.textDark), bodyLarge: Theme.of(context) .textTheme .bodyLarge ?.copyWith(fontSize: Dimens.bodyLarge, color: Palette.textDark), bodyMedium: Theme.of(context) .textTheme .bodyMedium ?.copyWith(fontSize: Dimens.bodyMedium, color: Palette.textDark), bodySmall: Theme.of(context) .textTheme .bodySmall ?.copyWith(fontSize: Dimens.bodySmall, color: Palette.textDark), labelLarge: Theme.of(context) .textTheme .labelLarge ?.copyWith(fontSize: Dimens.labelLarge, color: Palette.textDark), labelSmall: Theme.of(context).textTheme.labelSmall?.copyWith( fontSize: Dimens.labelSmall, letterSpacing: 0.25, color: Palette.textDark, ), ), appBarTheme: const AppBarTheme().copyWith( titleTextStyle: Theme.of(context).textTheme.bodyLarge, iconTheme: const IconThemeData(color: Palette.iconDark), color: Palette.backgroundDark, systemOverlayStyle: SystemUiOverlayStyle.light.copyWith( statusBarColor: Colors.transparent, ), surfaceTintColor: Palette.backgroundDark, shadowColor: Palette.shadowDark, ), drawerTheme: const DrawerThemeData().copyWith( elevation: Dimens.zero, surfaceTintColor: Palette.backgroundDark, backgroundColor: Palette.backgroundDark, shadowColor: Palette.shadowDark, ), bottomSheetTheme: const BottomSheetThemeData().copyWith( backgroundColor: Palette.backgroundDark, surfaceTintColor: Colors.transparent, elevation: Dimens.zero, ), dialogTheme: const DialogThemeData().copyWith( backgroundColor: Palette.backgroundDark, surfaceTintColor: Colors.transparent, elevation: Dimens.zero, ), brightness: Brightness.dark, iconTheme: const IconThemeData(color: Palette.iconDark), visualDensity: VisualDensity.adaptivePlatformDensity, extensions: const >[ LzyctColors( background: Palette.backgroundDark, banner: Palette.background, buttonText: Palette.textDark, card: Palette.cardDark, subtitle: Palette.text, shadow: Palette.shadowDark, green: Palette.greenMocha, roseWater: Palette.roseWaterMocha, flamingo: Palette.flamingoMocha, pink: Palette.pinkMocha, mauve: Palette.mauveMocha, maroon: Palette.maroonMocha, peach: Palette.peachMocha, yellow: Palette.yellowMocha, teal: Palette.tealMocha, sapphire: Palette.sapphireMocha, sky: Palette.skyMocha, blue: Palette.blueMocha, lavender: Palette.lavenderMocha, red: Palette.redMocha, ), ], ); class LzyctColors extends ThemeExtension { final Color? background; final Color? banner; final Color? card; final Color? buttonText; final Color? subtitle; final Color? shadow; final Color? green; final Color? roseWater; final Color? flamingo; final Color? pink; final Color? mauve; final Color? maroon; final Color? peach; final Color? yellow; final Color? teal; final Color? sky; final Color? sapphire; final Color? blue; final Color? lavender; final Color? red; const LzyctColors({ this.background, this.banner, this.card, this.buttonText, this.subtitle, this.shadow, this.green, this.roseWater, this.flamingo, this.pink, this.mauve, this.maroon, this.peach, this.yellow, this.teal, this.sapphire, this.sky, this.blue, this.lavender, this.red, }); @override ThemeExtension copyWith({ Color? background, Color? banner, Color? card, Color? buttonText, Color? subtitle, Color? shadow, Color? green, Color? roseWater, Color? flamingo, Color? pink, Color? mauve, Color? maroon, Color? peach, Color? yellow, Color? teal, Color? sky, Color? sapphire, Color? blue, Color? lavender, Color? red, }) => LzyctColors( background: background ?? this.background, banner: banner ?? this.banner, card: card ?? this.card, buttonText: buttonText ?? this.buttonText, subtitle: subtitle ?? this.subtitle, shadow: shadow ?? this.shadow, green: green ?? this.green, roseWater: roseWater ?? this.roseWater, flamingo: flamingo ?? this.flamingo, pink: pink ?? this.pink, mauve: mauve ?? this.mauve, maroon: maroon ?? this.maroon, peach: peach ?? this.peach, yellow: yellow ?? this.yellow, teal: teal ?? this.teal, sky: sky ?? this.sky, sapphire: sapphire ?? this.sapphire, blue: blue ?? this.blue, lavender: lavender ?? this.lavender, red: red ?? this.red, ); @override ThemeExtension lerp( covariant ThemeExtension? other, double t, ) { if (other is! LzyctColors) { return this; } return LzyctColors( banner: Color.lerp(banner, other.banner, t), background: Color.lerp(background, other.background, t), card: Color.lerp(card, other.card, t), buttonText: Color.lerp(buttonText, other.buttonText, t), subtitle: Color.lerp(subtitle, other.subtitle, t), shadow: Color.lerp(shadow, other.shadow, t), green: Color.lerp(green, other.green, t), roseWater: Color.lerp(roseWater, other.roseWater, t), flamingo: Color.lerp(flamingo, other.flamingo, t), pink: Color.lerp(pink, other.pink, t), mauve: Color.lerp(mauve, other.mauve, t), maroon: Color.lerp(maroon, other.maroon, t), peach: Color.lerp(peach, other.peach, t), yellow: Color.lerp(yellow, other.yellow, t), teal: Color.lerp(teal, other.teal, t), sapphire: Color.lerp(sapphire, other.sapphire, t), blue: Color.lerp(blue, other.blue, t), lavender: Color.lerp(lavender, other.lavender, t), sky: Color.lerp(sky, other.sky, t), red: Color.lerp(red, other.red, t), ); } } class BoxDecorations { BoxDecorations(this.context); final BuildContext context; BoxDecoration get button => BoxDecoration( color: Palette.primary, borderRadius: const BorderRadius.all(Radius.circular(Dimens.cornerRadius)), boxShadow: [BoxShadows(context).button], ); BoxDecoration get card => BoxDecoration( color: Theme.of(context).cardColor, borderRadius: const BorderRadius.all(Radius.circular(Dimens.cornerRadius)), boxShadow: [BoxShadows(context).card], ); } class BoxShadows { BoxShadows(this.context); final BuildContext context; BoxShadow get button => BoxShadow( color: Theme.of(context) .extension()! .shadow! .withValues(alpha: 0.5), blurRadius: 16.0, spreadRadius: 1.0, ); BoxShadow get card => BoxShadow( color: Theme.of(context) .extension()! .shadow! .withValues(alpha: 0.5), blurRadius: 5.0, spreadRadius: 0.5, ); BoxShadow get dialog => BoxShadow( color: Theme.of(context).extension()!.shadow!, offset: const Offset(0, -4), blurRadius: 16.0, ); BoxShadow get dialogAlt => BoxShadow( color: Theme.of(context).extension()!.shadow!, offset: const Offset(0, 4), blurRadius: 16.0, ); BoxShadow get buttonMenu => BoxShadow( color: Theme.of(context).extension()!.shadow!, blurRadius: 4.0, ); } ================================================ FILE: lib/core/usecase/usecase.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; abstract class UseCase { Future> call(Params params); } /// Class to handle when useCase don't need params class NoParams {} ================================================ FILE: lib/core/widgets/button.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class Button extends StatelessWidget { final String title; final VoidCallback? onPressed; final double? width; final Color? color; final Color? titleColor; final double? fontSize; final Color? splashColor; const Button({ required this.title, required this.onPressed, super.key, this.width, this.color, this.titleColor, this.fontSize, this.splashColor, }); @override Widget build(BuildContext context) => SizedBox( width: width, child: TextButton( onPressed: onPressed, style: TextButton.styleFrom( backgroundColor: color ?? Theme.of(context).extension()!.banner, foregroundColor: Theme.of(context).extension()!.buttonText, disabledBackgroundColor: Theme.of(context) .extension()! .buttonText ?.withValues(alpha: 0.5), padding: EdgeInsets.symmetric( horizontal: Dimens.space24, vertical: Dimens.space12, ), shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all( Radius.circular(Dimens.cornerRadius), ), ), ), child: Text( title.toUpperCase(), style: Theme.of(context).textTheme.labelLarge?.copyWith( color: Theme.of(context).extension()!.background, ), textAlign: TextAlign.center, ), ), ); } ================================================ FILE: lib/core/widgets/button_notification.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class ButtonNotification extends StatelessWidget { const ButtonNotification({super.key}); @override Widget build(BuildContext context) => IconButton( icon: SizedBox( width: Dimens.space36, height: Dimens.space36, child: Stack( children: [ Positioned( left: 0, top: 0, bottom: 0, child: Icon(Icons.notifications_outlined, size: Dimens.space30), ), Positioned( right: Dimens.space4, bottom: Dimens.space6, child: Visibility( child: CircleAvatar( backgroundColor: Palette.secondary, maxRadius: Dimens.space8, child: Center( child: Text( '1', style: Theme.of(context).textTheme.labelSmall?.copyWith( color: Theme.of( context, ).extension()!.background, ), textAlign: TextAlign.center, ), ), ), ), ), ], ), ), onPressed: () { ///TODO: Go to notifications page // context.goTo(AppRoute.notifications); }, ); } ================================================ FILE: lib/core/widgets/button_text.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class ButtonText extends StatelessWidget { final String title; final VoidCallback onPressed; final double? width; final Color? color; final Color? titleColor; final double? fontSize; final Color? splashColor; const ButtonText({ required this.title, required this.onPressed, super.key, this.width, this.color, this.titleColor, this.fontSize, this.splashColor, }); @override Widget build(BuildContext context) => Container( margin: EdgeInsets.symmetric(vertical: Dimens.space8), child: TextButton( onPressed: onPressed, style: TextButton.styleFrom( foregroundColor: Theme.of(context).extension()!.pink, ), child: Text( title.toUpperCase(), style: Theme.of(context).textTheme.labelLarge, textAlign: TextAlign.center, ), ), ); } ================================================ FILE: lib/core/widgets/circle_image.dart ================================================ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class CircleImage extends StatelessWidget { final String url; final double? size; const CircleImage({required this.url, super.key, this.size}); @override Widget build(BuildContext context) => ClipRRect( borderRadius: BorderRadius.circular(360), /// 360 degree circle child: CachedNetworkImage( fit: BoxFit.cover, width: size, height: size, fadeInDuration: const Duration(milliseconds: 300), imageUrl: url, placeholder: (context, url) => SizedBox( width: Dimens.space46, height: Dimens.space46, child: const Loading(showMessage: false), ), // errorWidget: (context, url, error) => // new SvgPicture.asset(Images.icEmpty), ), ); } ================================================ FILE: lib/core/widgets/color_loaders.dart ================================================ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class ColorLoader extends StatefulWidget { final double radius; final double dotRadius; const ColorLoader({this.radius = 30.0, this.dotRadius = 6.0}); @override _ColorLoaderState createState() => _ColorLoaderState(); } class _ColorLoaderState extends State with SingleTickerProviderStateMixin { late Animation animationRotation; late Animation animationRadiusIn; late Animation animationRadiusOut; late AnimationController controller; double? radius; double? dotRadius; @override void initState() { super.initState(); radius = widget.radius; dotRadius = widget.dotRadius; controller = AnimationController( vsync: this, duration: const Duration(milliseconds: 3000), ); animationRotation = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation( parent: controller, curve: const Interval(0.0, 1.0), ), ); animationRadiusIn = Tween(begin: 1.0, end: 0.0).animate( CurvedAnimation( parent: controller, curve: const Interval(0.75, 1.0, curve: Curves.elasticIn), ), ); animationRadiusOut = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation( parent: controller, curve: const Interval(0.0, 0.25, curve: Curves.elasticOut), ), ); controller.addListener(() { setState(() { if (controller.value >= 0.75 && controller.value <= 1.0) { radius = widget.radius * animationRadiusIn.value; } else if (controller.value >= 0.0 && controller.value <= 0.25) { radius = widget.radius * animationRadiusOut.value; } }); }); // controller.addStatusListener((status) {}); controller.repeat(); } @override Widget build(BuildContext context) => SizedBox( width: 100.0, height: 100.0, //color: Colors.black12, child: Center( child: RotationTransition( turns: animationRotation, child: Center( child: Stack( children: [ Transform.translate( offset: Offset.zero, child: Dot( radius: radius, color: Colors.black26, ), ), Transform.translate( offset: Offset( radius! * cos(0.0), radius! * sin(0.0), ), child: Dot( radius: dotRadius, color: Palette.primary, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 1 * pi / 4), radius! * sin(0.0 + 1 * pi / 4), ), child: Dot( radius: dotRadius, color: Palette.secondary, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 2 * pi / 4), radius! * sin(0.0 + 2 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.red, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 3 * pi / 4), radius! * sin(0.0 + 3 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.yellow, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 4 * pi / 4), radius! * sin(0.0 + 4 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.green, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 5 * pi / 4), radius! * sin(0.0 + 5 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.flamingo, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 6 * pi / 4), radius! * sin(0.0 + 6 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.lavender, ), ), Transform.translate( offset: Offset( radius! * cos(0.0 + 7 * pi / 4), radius! * sin(0.0 + 7 * pi / 4), ), child: Dot( radius: dotRadius, color: Theme.of(context).extension()!.pink, ), ), ], ), ), ), ), ); @override void dispose() { controller.dispose(); super.dispose(); } } class Dot extends StatelessWidget { final double? radius; final Color? color; const Dot({this.radius, this.color}); @override Widget build(BuildContext context) => Center( child: Container( width: radius, height: radius, decoration: BoxDecoration(color: color, shape: BoxShape.circle), ), ); } ================================================ FILE: lib/core/widgets/drop_down.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class DropDown extends StatefulWidget { const DropDown({ required this.value, required this.items, required this.onChanged, super.key, this.hint, this.hintIsVisible = true, this.prefixIcon, }); final T value; final List> items; final bool hintIsVisible; final String? hint; final ValueChanged? onChanged; final Widget? prefixIcon; @override _DropDownState createState() => _DropDownState(); } class _DropDownState extends State> { @override Widget build(BuildContext context) => Container( margin: EdgeInsets.symmetric(vertical: Dimens.space8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (widget.hintIsVisible) ...{ Text( widget.hint ?? '', style: Theme.of(context) .textTheme .bodySmall ?.copyWith(color: Theme.of(context).hintColor), ), SpacerV(value: Dimens.space6), }, ButtonTheme( key: widget.key, alignedDropdown: true, padding: EdgeInsets.zero, textTheme: ButtonTextTheme.primary, child: DropdownButtonFormField( isExpanded: true, dropdownColor: Theme.of(context).extension()!.banner, icon: const Icon(Icons.keyboard_arrow_down), style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of(context).extension()!.subtitle, ), decoration: InputDecoration( alignLabelWithHint: true, isDense: true, isCollapsed: true, filled: true, labelStyle: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of(context) .extension()! .subtitle, ), fillColor: Theme.of(context).extension()!.card, prefixIcon: Padding( padding: EdgeInsets.only(left: Dimens.space12), child: widget.prefixIcon, ), prefixIconConstraints: BoxConstraints( minHeight: Dimens.space24, maxHeight: Dimens.space24, ), contentPadding: EdgeInsets.symmetric(vertical: Dimens.space12), enabledBorder: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide( color: Theme.of(context).extension()!.card!, ), ), border: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide(color: Theme.of(context).cardColor), ), disabledBorder: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide(color: Theme.of(context).cardColor), ), focusedErrorBorder: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide( color: Theme.of(context).extension()!.red!, ), ), errorBorder: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide( color: Theme.of(context).extension()!.red!, ), ), focusedBorder: OutlineInputBorder( gapPadding: 0, borderRadius: BorderRadius.circular(Dimens.space4), borderSide: BorderSide( color: Theme.of(context).extension()!.pink!, ), ), ), value: widget.value, items: widget.items, onChanged: widget.onChanged, ), ), ], ), ); } ================================================ FILE: lib/core/widgets/empty.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/utils/utils.dart'; class Empty extends StatelessWidget { final String? errorMessage; const Empty({super.key, this.errorMessage}); @override Widget build(BuildContext context) => Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( Images.icLauncher, width: context.widthInPercent(45), ), Text( errorMessage ?? Strings.of(context)!.errorNoData, ), ], ); } ================================================ FILE: lib/core/widgets/loading.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class Loading extends StatelessWidget { const Loading({this.showMessage = true}); final bool showMessage; @override Widget build(BuildContext context) => FittedBox( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const ColorLoader(), Visibility( visible: showMessage, child: Text( Strings.of(context)!.pleaseWait, style: Theme.of(context).textTheme.bodyMedium, ), ), ], ), ); } ================================================ FILE: lib/core/widgets/my_appbar.dart ================================================ import 'package:flutter/material.dart'; class MyAppBar { const MyAppBar(); PreferredSize call() => PreferredSize( preferredSize: const Size.fromHeight(kToolbarHeight), child: AppBar(elevation: 0), ); } ================================================ FILE: lib/core/widgets/parent.dart ================================================ import 'package:flutter/material.dart'; class Parent extends StatefulWidget { final Widget? child; final PreferredSize? appBar; final bool avoidBottomInset; final Widget? floatingButton; final Widget? bottomNavigation; final Widget? drawer; final Widget? endDrawer; final Color? backgroundColor; final Key? scaffoldKey; final bool extendBodyBehindAppBar; const Parent({ super.key, this.child, this.appBar, this.avoidBottomInset = true, this.floatingButton, this.backgroundColor, this.bottomNavigation, this.drawer, this.scaffoldKey, this.endDrawer, this.extendBodyBehindAppBar = false, }); @override _ParentState createState() => _ParentState(); } class _ParentState extends State { @override Widget build(BuildContext context) => GestureDetector( onTap: () => FocusManager.instance.primaryFocus?.unfocus(), child: Scaffold( key: widget.scaffoldKey, backgroundColor: widget.backgroundColor, resizeToAvoidBottomInset: widget.avoidBottomInset, extendBodyBehindAppBar: widget.extendBodyBehindAppBar, appBar: widget.appBar, body: widget.child, drawer: widget.drawer, endDrawer: widget.endDrawer, floatingActionButton: widget.floatingButton, bottomNavigationBar: widget.bottomNavigation, ), ); } ================================================ FILE: lib/core/widgets/spacer_h.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class SpacerH extends StatelessWidget { const SpacerH({super.key, this.value}); final double? value; @override Widget build(BuildContext context) => Container( width: value ?? Dimens.space8, ); } ================================================ FILE: lib/core/widgets/spacer_v.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; class SpacerV extends StatelessWidget { const SpacerV({super.key, this.value}); final double? value; @override Widget build(BuildContext context) => Container( height: value ?? Dimens.space8, ); } ================================================ FILE: lib/core/widgets/text_f.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/utils/utils.dart'; class TextF extends StatefulWidget { const TextF({ required this.label, super.key, this.controller, this.errorMessage, this.isValid = false, this.prefixIcon, this.suffixIcon, this.obscureText, this.keyboardType, this.inputFormatters, this.enabled = true, this.textInputAction, this.onTap, this.autoFillHints, this.description, this.labelTextStyle, this.noErrorSpace = false, this.focusNode, this.backgroundColor, this.hint, this.validatorListener, this.height, this.textStyle, this.maxLines = 1, this.semantic, }); final TextEditingController? controller; final bool isValid; final String label; final String? errorMessage; final Widget? suffixIcon; final Widget? prefixIcon; final bool? obscureText; final bool enabled; final TextInputType? keyboardType; final TextInputAction? textInputAction; final List? inputFormatters; final VoidCallback? onTap; final Function(String)? validatorListener; final List? autoFillHints; final String? description; final TextStyle? labelTextStyle; final TextStyle? textStyle; final bool noErrorSpace; final FocusNode? focusNode; final Color? backgroundColor; final String? hint; final double? height; final int maxLines; final String? semantic; @override TextFState createState() => TextFState(); } class TextFState extends State { late FocusNode _fn; bool _isFocus = false; bool _isError = false; bool _isFirstLoad = true; final _debouncer = Debouncer(); @override void initState() { super.initState(); _fn = widget.focusNode ?? FocusNode(); _fn.addListener(() { setState(() { _isFocus = _fn.hasFocus; /// Check if focus changed if (!_isFocus) { _isError = !widget.isValid; } }); }); } void _updateStatus() { if (_isFirstLoad) { _isFirstLoad = false; } else { if (_isFocus) { _isError = !widget.isValid; } } } void setIsError({required bool isError}) { setState(() { if (_isFirstLoad) { _isFirstLoad = false; } else { _isError = isError; } }); } @override Widget build(BuildContext context) { _updateStatus(); return GestureDetector( onTap: widget.onTap, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Stack( children: [ Container( width: double.maxFinite, height: widget.height ?? Dimens.textField, decoration: BoxDecoration( color: widget.enabled ? widget.backgroundColor ?? Theme.of(context).extension()!.background : Theme.of(context).extension()!.shadow, border: Border.all( color: _isError ? Theme.of(context).extension()!.red! : Theme.of(context).extension()!.shadow!, ), borderRadius: BorderRadius.circular(Dimens.space4), ), alignment: Alignment.topLeft, padding: EdgeInsets.only(bottom: Dimens.space4), ), Positioned( top: Dimens.space5, left: Dimens.zero, right: Dimens.zero, bottom: Dimens.space4, child: _textFormField, ), ], ), if (widget.description != null && !_isError) Padding( padding: EdgeInsets.only(top: Dimens.space6), child: Text( widget.description!, style: Theme.of(context).textTheme.bodySmall?.copyWith( color: _isError ? Theme.of(context).extension()!.red! : Theme.of(context).extension()!.shadow, ), ), ), if (!widget.noErrorSpace) ...[ AnimatedSwitcher( duration: const Duration(milliseconds: 300), child: _isError && widget.errorMessage != null ? Padding( padding: EdgeInsets.only( left: Dimens.space16, top: Dimens.space4, ), child: Text( widget.errorMessage ?? '', style: Theme.of(context).textTheme.bodySmall?.copyWith( color: Theme.of(context) .extension()! .red, ), ), ) : const SizedBox.shrink(), ), const SpacerV(), ], ], ), ); } Widget get _textFormField => Semantics( label: widget.semantic, child: TextFormField( autofillHints: widget.autoFillHints, textInputAction: widget.textInputAction, onFieldSubmitted: (_) => FocusScope.of(context).nextFocus(), enabled: widget.enabled, inputFormatters: widget.inputFormatters, keyboardType: widget.keyboardType, controller: widget.controller, obscureText: widget.obscureText ?? false, focusNode: _fn, maxLines: widget.maxLines, onTap: widget.onTap, style: widget.textStyle ?? Theme.of(context).textTheme.bodyMedium500, decoration: InputDecoration( isDense: true, contentPadding: EdgeInsets.only( left: Dimens.space16, top: Dimens.space4, ), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, border: InputBorder.none, errorBorder: InputBorder.none, prefixIcon: widget.prefixIcon, suffixIcon: widget.suffixIcon, label: widget.label.isEmpty ? null : Text( widget.label, style: widget.labelTextStyle ?? Theme.of(context).textTheme.bodySmall?.copyWith( color: _isError ? Theme.of(context) .extension()! .red! : Theme.of(context) .extension()! .banner!, overflow: TextOverflow.ellipsis, ), ), alignLabelWithHint: true, hintText: widget.hint, floatingLabelBehavior: widget.hint != null ? FloatingLabelBehavior.always : null, hintStyle: Theme.of(context) .textTheme .bodyMedium ?.copyWith(color: Theme.of(context).hintColor), ), onChanged: (String value) => _debouncer.run(() => widget.validatorListener?.call(value)), onSaved: (String? value) => widget.validatorListener?.call(value ?? ''), ), ); } ================================================ FILE: lib/core/widgets/toast.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class Toast extends StatelessWidget { final IconData? icon; final Color? bgColor; final Color? textColor; final String? message; const Toast({super.key, this.icon, this.bgColor, this.message, this.textColor}); @override Widget build(BuildContext context) => Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( decoration: BoxDecoration( color: bgColor, borderRadius: BorderRadius.circular(15), ), padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 16), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( icon, color: textColor, ), SizedBox( width: 4.w, ), Container( constraints: BoxConstraints(maxWidth: 250.w), child: Text( message!, style: Theme.of(context) .textTheme .bodyMedium ?.copyWith(color: textColor), textAlign: TextAlign.start, maxLines: 5, softWrap: true, ), ), ], ), ), ], ); } ================================================ FILE: lib/core/widgets/widgets.dart ================================================ export 'button.dart'; export 'button_notification.dart'; export 'button_text.dart'; export 'circle_image.dart'; export 'color_loaders.dart'; export 'drop_down.dart'; export 'empty.dart'; export 'loading.dart'; export 'my_appbar.dart'; export 'parent.dart'; export 'spacer_h.dart'; export 'spacer_v.dart'; export 'text_f.dart'; export 'toast.dart'; ================================================ FILE: lib/dependencies_injection.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:get_it/get_it.dart'; GetIt sl = GetIt.instance; Future serviceLocator({ bool isUnitTest = false, bool isHiveEnable = true, String prefixBox = '', }) async { /// For unit testing only if (isUnitTest) { await sl.reset(); } if (isHiveEnable) { await _initHiveBoxes(isUnitTest: isUnitTest, prefixBox: prefixBox); } sl.registerSingleton(DioClient(isUnitTest: isUnitTest)); _dataSources(); _repositories(); _useCase(); _cubit(); } Future _initHiveBoxes({ bool isUnitTest = false, String prefixBox = '', }) async { await MainBoxMixin.initHive(prefixBox); sl.registerSingleton(MainBoxMixin()); } /// Register repositories void _repositories() { sl.registerLazySingleton( () => AuthRepositoryImpl(sl(), sl()), ); sl.registerLazySingleton(() => UsersRepositoryImpl(sl())); } /// Register dataSources void _dataSources() { sl.registerLazySingleton( () => AuthRemoteDatasourceImpl(sl()), ); sl.registerLazySingleton( () => UsersRemoteDatasourceImpl(sl()), ); } void _useCase() { /// Auth sl.registerLazySingleton(() => PostLogin(sl())); sl.registerLazySingleton(() => PostLogout(sl())); sl.registerLazySingleton(() => PostRegister(sl())); sl.registerLazySingleton(() => PostGeneralToken(sl())); /// Users sl.registerLazySingleton(() => GetUsers(sl())); sl.registerLazySingleton(() => GetUser(sl())); } void _cubit() { /// Auth sl.registerFactory(() => RegisterCubit(sl())); sl.registerFactory(() => AuthCubit(sl())); sl.registerFactory(() => GeneralTokenCubit(sl())); sl.registerFactory(() => LogoutCubit(sl())); /// General sl.registerFactory(() => ReloadFormCubit()); /// Users sl.registerFactory(() => UserCubit(sl())); sl.registerFactory(() => UsersCubit(sl())); sl.registerFactory(() => SettingsCubit()); sl.registerFactory(() => MainCubit()); } ================================================ FILE: lib/features/auth/auth.dart ================================================ export 'data/data.dart'; export 'domain/domain.dart'; export 'pages/pages.dart'; ================================================ FILE: lib/features/auth/data/data.dart ================================================ export 'datasources/datasources.dart'; export 'models/models.dart'; export 'repositories/repositories.dart'; ================================================ FILE: lib/features/auth/data/datasources/auth_remote_datasources.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; abstract class AuthRemoteDatasource { Future> register(RegisterParams params); Future> login(LoginParams params); Future> generalToken( GeneralTokenParams params, ); Future> logout(); } class AuthRemoteDatasourceImpl implements AuthRemoteDatasource { final DioClient _client; AuthRemoteDatasourceImpl(this._client); @override Future> register( RegisterParams params, ) async { final response = await _client.postRequest( ListAPI.user, data: params.toJson(), converter: (response) => RegisterResponse.fromJson(response as Map), ); return response; } @override Future> login(LoginParams params) async { final response = await _client.postRequest( ListAPI.login, data: params.toJson(), converter: (response) => LoginResponse.fromJson(response as Map), ); return response; } @override Future> generalToken( GeneralTokenParams params, ) async { final response = await _client.postRequest( ListAPI.generalToken, data: params.toJson(), converter: (response) => GeneralTokenResponse.fromJson(response as Map), ); return response; } @override Future> logout() async { final response = await _client.postRequest( ListAPI.logout, converter: (response) => DiagnosticResponse.fromJson(response as Map), ); return response; } } ================================================ FILE: lib/features/auth/data/datasources/datasources.dart ================================================ export 'auth_remote_datasources.dart'; ================================================ FILE: lib/features/auth/data/models/general_token_response.dart ================================================ import 'package:flutter_auth_app/features/auth/auth.dart'; import 'package:flutter_auth_app/features/general/general.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'general_token_response.freezed.dart'; part 'general_token_response.g.dart'; @freezed sealed class GeneralTokenResponse with _$GeneralTokenResponse { const factory GeneralTokenResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, @JsonKey(name: 'data') DataGeneralToken? data, }) = _GeneralTokenResponse; const GeneralTokenResponse._(); GeneralToken toEntity() => GeneralToken(token: '${data?.tokenType} ${data?.token}'); factory GeneralTokenResponse.fromJson(Map json) => _$GeneralTokenResponseFromJson(json); } @freezed sealed class DataGeneralToken with _$DataGeneralToken { const factory DataGeneralToken({ @JsonKey(name: 'token') String? token, @JsonKey(name: 'tokenType') String? tokenType, }) = _DataGeneralToken; factory DataGeneralToken.fromJson(Map json) => _$DataGeneralTokenFromJson(json); } ================================================ FILE: lib/features/auth/data/models/login_response.dart ================================================ import 'package:flutter_auth_app/features/auth/auth.dart'; import 'package:flutter_auth_app/features/general/general.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'login_response.freezed.dart'; part 'login_response.g.dart'; @freezed sealed class LoginResponse with _$LoginResponse { const factory LoginResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, @JsonKey(name: 'data') DataLogin? data, }) = _LoginResponse; const LoginResponse._(); Login toEntity() => Login(token: '${data?.tokenType} ${data?.token}'); factory LoginResponse.fromJson(Map json) => _$LoginResponseFromJson(json); } @freezed sealed class DataLogin with _$DataLogin { const factory DataLogin({ @JsonKey(name: 'token') String? token, @JsonKey(name: 'tokenType') String? tokenType, @JsonKey(name: 'refreshToken') String? refreshToken, }) = _DataLogin; factory DataLogin.fromJson(Map json) => _$DataLoginFromJson(json); } ================================================ FILE: lib/features/auth/data/models/models.dart ================================================ export 'general_token_response.dart'; export 'login_response.dart'; export 'register_response.dart'; ================================================ FILE: lib/features/auth/data/models/register_response.dart ================================================ import 'package:flutter_auth_app/features/auth/auth.dart'; import 'package:flutter_auth_app/features/general/general.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'register_response.freezed.dart'; part 'register_response.g.dart'; @freezed sealed class RegisterResponse with _$RegisterResponse { const factory RegisterResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, @JsonKey(name: 'data') DataRegister? data, }) = _RegisterResponse; const RegisterResponse._(); Register toEntity() => Register(message: diagnostic?.message ?? ''); factory RegisterResponse.fromJson(Map json) => _$RegisterResponseFromJson(json); } @freezed sealed class DataRegister with _$DataRegister { const factory DataRegister({ @JsonKey(name: 'id') String? id, @JsonKey(name: 'name') String? name, @JsonKey(name: 'email') String? email, @JsonKey(name: 'photo') String? photo, @JsonKey(name: 'verified') bool? verified, @JsonKey(name: 'createdAt') String? createdAt, @JsonKey(name: 'updatedAt') String? updatedAt, }) = _DataRegister; factory DataRegister.fromJson(Map json) => _$DataRegisterFromJson(json); } ================================================ FILE: lib/features/auth/data/repositories/auth_repository_impl.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/auth/auth.dart'; import 'package:flutter_auth_app/utils/services/hive/hive.dart'; class AuthRepositoryImpl implements AuthRepository { /// Data Source final AuthRemoteDatasource authRemoteDatasource; final MainBoxMixin mainBoxMixin; const AuthRepositoryImpl(this.authRemoteDatasource, this.mainBoxMixin); @override Future> login(LoginParams params) async { final response = await authRemoteDatasource.login(params); return response.fold((failure) => Left(failure), (loginResponse) { mainBoxMixin.addData(MainBoxKeys.isLogin, true); mainBoxMixin.addData( MainBoxKeys.authToken, '${loginResponse.data?.tokenType} ${loginResponse.data?.token}', ); mainBoxMixin.addData( MainBoxKeys.refreshToken, '${loginResponse.data?.tokenType} ${loginResponse.data?.refreshToken}', ); return Right(loginResponse.toEntity()); }); } @override Future> register(RegisterParams params) async { final response = await authRemoteDatasource.register(params); return response.fold( (failure) => Left(failure), (registerResponse) => Right(registerResponse.toEntity()), ); } @override Future> generalToken( GeneralTokenParams params, ) async { final response = await authRemoteDatasource.generalToken(params); return response.fold((failure) => Left(failure), (loginResponse) { mainBoxMixin.addData( MainBoxKeys.generalToken, '${loginResponse.data?.tokenType} ${loginResponse.data?.token}', ); return Right(loginResponse.toEntity()); }); } @override Future> logout() async { final response = await authRemoteDatasource.logout(); return response.fold( (failure) => Left(failure), (loginResponse) => Right(loginResponse.diagnostic?.message ?? ''), ); } } ================================================ FILE: lib/features/auth/data/repositories/repositories.dart ================================================ export 'auth_repository_impl.dart'; ================================================ FILE: lib/features/auth/domain/domain.dart ================================================ export 'entities/entities.dart'; export 'repositories/repositories.dart'; export 'usecases/usecases.dart'; ================================================ FILE: lib/features/auth/domain/entities/entities.dart ================================================ export 'general_token.dart'; export 'login.dart'; export 'register.dart'; ================================================ FILE: lib/features/auth/domain/entities/general_token.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'general_token.freezed.dart'; @freezed sealed class GeneralToken with _$GeneralToken { const factory GeneralToken({String? token}) = _GeneralToken; } ================================================ FILE: lib/features/auth/domain/entities/login.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'login.freezed.dart'; @freezed sealed class Login with _$Login { const factory Login({String? token}) = _Login; } ================================================ FILE: lib/features/auth/domain/entities/register.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'register.freezed.dart'; @freezed sealed class Register with _$Register { const factory Register({String? message}) = _Register; } ================================================ FILE: lib/features/auth/domain/repositories/auth_repository.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/auth/auth.dart'; abstract class AuthRepository { Future> login(LoginParams params); Future> register(RegisterParams params); Future> generalToken(GeneralTokenParams params); Future> logout(); } ================================================ FILE: lib/features/auth/domain/repositories/repositories.dart ================================================ export 'auth_repository.dart'; ================================================ FILE: lib/features/auth/domain/usecases/post_general_token.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'post_general_token.freezed.dart'; part 'post_general_token.g.dart'; class PostGeneralToken extends UseCase { final AuthRepository _repo; PostGeneralToken(this._repo); @override Future> call(GeneralTokenParams params) => _repo.generalToken(params); } @freezed sealed class GeneralTokenParams with _$GeneralTokenParams { const factory GeneralTokenParams({ String? clientId, String? clientSecret, }) = _GeneralTokenParams; factory GeneralTokenParams.fromJson(Map json) => _$GeneralTokenParamsFromJson(json); } ================================================ FILE: lib/features/auth/domain/usecases/post_login.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'post_login.freezed.dart'; part 'post_login.g.dart'; class PostLogin extends UseCase { final AuthRepository _repo; PostLogin(this._repo); @override Future> call(LoginParams params) => _repo.login(params); } @freezed sealed class LoginParams with _$LoginParams { const factory LoginParams({ @Default('') String email, @Default('') String password, String? osInfo, String? deviceInfo, @Default('GeneratedFCMToken') String fcmToken, }) = _LoginParams; factory LoginParams.fromJson(Map json) => _$LoginParamsFromJson(json); } ================================================ FILE: lib/features/auth/domain/usecases/post_logout.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; class PostLogout extends UseCase { final AuthRepository _repo; // coverage:ignore-start PostLogout(this._repo); @override Future> call(NoParams _) => _repo.logout(); // coverage:ignore-end } ================================================ FILE: lib/features/auth/domain/usecases/post_register.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'post_register.freezed.dart'; part 'post_register.g.dart'; class PostRegister extends UseCase { final AuthRepository _repo; PostRegister(this._repo); @override Future> call(RegisterParams params) => _repo.register(params); } @freezed sealed class RegisterParams with _$RegisterParams { const factory RegisterParams({ String? name, String? email, String? password, }) = _RegisterParams; factory RegisterParams.fromJson(Map json) => _$RegisterParamsFromJson(json); } ================================================ FILE: lib/features/auth/domain/usecases/usecases.dart ================================================ export 'post_general_token.dart'; export 'post_login.dart'; export 'post_logout.dart'; export 'post_register.dart'; ================================================ FILE: lib/features/auth/pages/login/cubit/auth_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'auth_cubit.freezed.dart'; class AuthCubit extends Cubit { AuthCubit(this._postLogin) : super(const AuthStateLoading()); final PostLogin _postLogin; Future login(LoginParams params) async { emit(const AuthStateLoading()); final data = await _postLogin.call(params); data.fold( (l) { if (l is ServerFailure) { emit(AuthStateFailure(l.message ?? '')); } }, (r) => emit(AuthStateSuccess(r.token)), ); } } @freezed sealed class AuthState with _$AuthState { const factory AuthState.loading() = AuthStateLoading; const factory AuthState.success(String? data) = AuthStateSuccess; const factory AuthState.failure(String message) = AuthStateFailure; const factory AuthState.showHide() = AuthStateShowHide; const factory AuthState.init() = AuthStateInit; } ================================================ FILE: lib/features/auth/pages/login/cubit/cubit.dart ================================================ export 'auth_cubit.dart'; ================================================ FILE: lib/features/auth/pages/login/login.dart ================================================ export 'cubit/cubit.dart'; export 'login_page.dart'; ================================================ FILE: lib/features/auth/pages/login/login_page.dart ================================================ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class LoginPage extends StatefulWidget { const LoginPage({super.key}); @override State createState() => _LoginPageState(); } class _LoginPageState extends State { /// Controller final _conEmail = TextEditingController(); final _conPassword = TextEditingController(); bool _isPasswordVisible = false; /// Focus Node final _fnEmail = FocusNode(); final _fnPassword = FocusNode(); /// Global key final _formValidator = {}; @override Widget build(BuildContext context) => Parent( child: BlocListener( listener: (_, state) => switch (state) { AuthStateLoading() => context.show(), AuthStateSuccess(:final data) => (() { context.dismiss(); data.toString().toToastSuccess(context); TextInput.finishAutofillContext(); context.goNamed(Routes.root.name); })(), AuthStateFailure(:final message) => (() { context.dismiss(); message.toToastError(context); })(), _ => {}, }, child: Center( child: SingleChildScrollView( child: Padding( padding: EdgeInsets.all(Dimens.space24), child: AutofillGroup( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( Theme.of(context).brightness == Brightness.dark ? Images.icLauncherDark : Images.icLauncher, width: context.widthInPercent(70), ), SpacerV(value: Dimens.space50), _loginForm(), ButtonText( title: Strings.of(context)!.askRegister, onPressed: () { /// Direct to register page context.pushNamed(Routes.register.name); }, ), ], ), ), ), ), ), ), ); Widget _loginForm() => BlocBuilder( builder: (_, _) => Column( children: [ TextF( autoFillHints: const [AutofillHints.email], key: const Key('email'), focusNode: _fnEmail, textInputAction: TextInputAction.next, controller: _conEmail, keyboardType: TextInputType.emailAddress, prefixIcon: Icon( Icons.alternate_email, color: Theme.of(context).textTheme.bodyLarge?.color, ), hint: 'mudassir@lazycatlabs.com', label: Strings.of(context)!.email, isValid: _formValidator.putIfAbsent('email', () => false), validatorListener: (String value) { _formValidator['email'] = value.isValidEmail(); context.read().reload(); }, errorMessage: Strings.of(context)!.errorInvalidEmail, ), TextF( autoFillHints: const [AutofillHints.password], key: const Key('password'), focusNode: _fnPassword, textInputAction: TextInputAction.done, controller: _conPassword, keyboardType: TextInputType.text, prefixIcon: Icon( Icons.lock_outline, color: Theme.of(context).textTheme.bodyLarge?.color, ), obscureText: !_isPasswordVisible, hint: 'pass123', label: Strings.of(context)!.password, suffixIcon: IconButton( padding: EdgeInsets.zero, constraints: const BoxConstraints(), onPressed: () { _isPasswordVisible = !_isPasswordVisible; context.read().reload(); }, icon: Icon( _isPasswordVisible ? Icons.visibility_off : Icons.visibility, ), ), isValid: _formValidator.putIfAbsent('password', () => false), validatorListener: (String value) { _formValidator['password'] = value.length > 5; context.read().reload(); }, errorMessage: Strings.of(context)!.errorPasswordLength, ), SpacerV(value: Dimens.space24), Button( title: Strings.of(context)!.login, width: double.maxFinite, onPressed: _formValidator.validate() ? () => context.read().login( LoginParams( email: _conEmail.text, password: _conPassword.text, osInfo: Platform.operatingSystem, deviceInfo: Platform.localHostname, ), ) : null, ), ], ), ); } ================================================ FILE: lib/features/auth/pages/pages.dart ================================================ export 'login/login.dart'; export 'register/register.dart'; ================================================ FILE: lib/features/auth/pages/register/cubit/cubit.dart ================================================ export 'register_cubit.dart'; ================================================ FILE: lib/features/auth/pages/register/cubit/register_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'register_cubit.freezed.dart'; class RegisterCubit extends Cubit { final PostRegister _postRegister; RegisterCubit(this._postRegister) : super(const RegisterStateLoading()); Future register(RegisterParams params) async { emit(const RegisterStateLoading()); final data = await _postRegister.call(params); data.fold( (l) { if (l is ServerFailure) { emit(RegisterStateFailure(l.message ?? '')); } }, (r) => emit(RegisterStateSuccess(r)), ); } } @freezed sealed class RegisterState with _$RegisterState { const factory RegisterState.loading() = RegisterStateLoading; const factory RegisterState.success(Register? data) = RegisterStateSuccess; const factory RegisterState.failure(String message) = RegisterStateFailure; const factory RegisterState.init() = RegisterStateInit; const factory RegisterState.showHidePassword() = RegisterStateShowHidePassword; } ================================================ FILE: lib/features/auth/pages/register/register.dart ================================================ export 'cubit/cubit.dart'; export 'register_page.dart'; ================================================ FILE: lib/features/auth/pages/register/register_page.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class RegisterPage extends StatefulWidget { const RegisterPage({super.key}); @override State createState() => _RegisterPageState(); } class _RegisterPageState extends State { /// Controller final _conName = TextEditingController(); final _conEmail = TextEditingController(); final _conPassword = TextEditingController(); final _conPasswordRepeat = TextEditingController(); /// Focus Node final _fnName = FocusNode(); final _fnEmail = FocusNode(); final _fnPassword = FocusNode(); final _fnPasswordRepeat = FocusNode(); /// isPasswordVisible bool _isPasswordVisible = false; bool _isPasswordRepeatVisible = false; final _formValidator = {}; @override Widget build(BuildContext context) => Parent( appBar: const MyAppBar().call(), child: BlocListener( listener: (_, state) => switch (state) { RegisterStateLoading() => context.show(), RegisterStateSuccess(:final data) => (() { context.dismiss(); data?.message?.toToastSuccess(context); /// back to login page after register success context.pop(); })(), RegisterStateFailure(:final message) => (() { context.dismiss(); message.toToastError(context); })(), _ => {}, }, child: Center( child: SingleChildScrollView( child: Padding( padding: EdgeInsets.all(Dimens.space24), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( Theme.of(context).brightness == Brightness.dark ? Images.icLauncherDark : Images.icLauncher, width: context.widthInPercent(70), ), _registerForm(), ], ), ), ), ), ), ); Widget _registerForm() => BlocBuilder( builder: (_, _) => Column( children: [ TextF( key: const Key('name'), focusNode: _fnName, textInputAction: TextInputAction.next, controller: _conName, keyboardType: TextInputType.emailAddress, prefixIcon: Icon( Icons.person, color: Theme.of(context).textTheme.bodyLarge?.color, ), hint: 'Mudassir', label: Strings.of(context)!.name, isValid: _formValidator.putIfAbsent('name', () => false), validatorListener: (String value) { _formValidator['name'] = value.isNotEmpty; context.read().reload(); }, errorMessage: Strings.of(context)!.errorEmptyField, ), TextF( key: const Key('email'), focusNode: _fnEmail, textInputAction: TextInputAction.next, controller: _conEmail, keyboardType: TextInputType.emailAddress, prefixIcon: Icon( Icons.alternate_email, color: Theme.of(context).textTheme.bodyLarge?.color, ), hint: 'mudassir@lazycatlabs.com', label: Strings.of(context)!.email, isValid: _formValidator.putIfAbsent('email', () => false), validatorListener: (String value) { _formValidator['email'] = value.isValidEmail(); context.read().reload(); }, errorMessage: Strings.of(context)!.errorInvalidEmail, ), TextF( key: const Key('password'), focusNode: _fnPassword, textInputAction: TextInputAction.next, controller: _conPassword, keyboardType: TextInputType.text, prefixIcon: Icon( Icons.lock_outline, color: Theme.of(context).textTheme.bodyLarge?.color, ), obscureText: !_isPasswordVisible, hint: '••••••••••••', label: Strings.of(context)!.password, suffixIcon: IconButton( padding: EdgeInsets.zero, constraints: const BoxConstraints(), onPressed: () { _isPasswordVisible = !_isPasswordVisible; context.read().reload(); }, icon: Icon( !_isPasswordVisible ? Icons.visibility_off : Icons.visibility, ), ), isValid: _formValidator.putIfAbsent('password', () => false), validatorListener: (String value) { _formValidator['password'] = value.length > 5; context.read().reload(); }, errorMessage: Strings.of(context)!.errorPasswordLength, semantic: 'password', ), TextF( key: const Key('repeat_password'), focusNode: _fnPasswordRepeat, textInputAction: TextInputAction.done, controller: _conPasswordRepeat, keyboardType: TextInputType.text, prefixIcon: Icon( Icons.lock_outline, color: Theme.of(context).textTheme.bodyLarge?.color, ), obscureText: !_isPasswordRepeatVisible, hint: '••••••••••••', label: Strings.of(context)!.passwordRepeat, suffixIcon: IconButton( padding: EdgeInsets.zero, constraints: const BoxConstraints(), onPressed: () { _isPasswordRepeatVisible = !_isPasswordRepeatVisible; context.read().reload(); }, icon: Icon( !_isPasswordRepeatVisible ? Icons.visibility_off : Icons.visibility, ), ), isValid: _formValidator.putIfAbsent( 'repeat_password', () => false, ), validatorListener: (String value) { _formValidator['repeat_password'] = value == _conPassword.text; context.read().reload(); }, errorMessage: Strings.of(context)!.errorPasswordNotMatch, semantic: 'repeat_password', ), SpacerV(value: Dimens.space24), Button( key: const Key('btn_register'), width: double.maxFinite, title: Strings.of(context)!.register, onPressed: _formValidator.validate() ? () { /// Validate form first context.read().register( RegisterParams( name: _conName.text, email: _conEmail.text, password: _conPassword.text, ), ); } : null, ), ], ), ); } ================================================ FILE: lib/features/features.dart ================================================ export 'auth/auth.dart'; export 'general/general.dart'; export 'users/users.dart'; ================================================ FILE: lib/features/general/data/data.dart ================================================ export 'models/models.dart'; ================================================ FILE: lib/features/general/data/models/diagnostic.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'diagnostic.freezed.dart'; part 'diagnostic.g.dart'; @freezed sealed class Diagnostic with _$Diagnostic { const factory Diagnostic({ @JsonKey(name: 'status') String? status, @JsonKey(name: 'message') String? message, }) = _Diagnostic; factory Diagnostic.fromJson(Map json) => _$DiagnosticFromJson(json); } ================================================ FILE: lib/features/general/data/models/diagnostic_response.dart ================================================ import 'package:flutter_auth_app/features/general/general.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'diagnostic_response.freezed.dart'; part 'diagnostic_response.g.dart'; @freezed sealed class DiagnosticResponse with _$DiagnosticResponse { const factory DiagnosticResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, }) = _DiagnosticResponse; factory DiagnosticResponse.fromJson(Map json) => _$DiagnosticResponseFromJson(json); } ================================================ FILE: lib/features/general/data/models/models.dart ================================================ export 'diagnostic.dart'; export 'diagnostic_response.dart'; export 'page.dart'; ================================================ FILE: lib/features/general/data/models/page.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'page.freezed.dart'; part 'page.g.dart'; @freezed sealed class Page with _$Page { const factory Page({ @JsonKey(name: 'currentPage') int? currentPage, @JsonKey(name: 'perPage') int? perPage, @JsonKey(name: 'lastPage') int? lastPage, @JsonKey(name: 'total') int? total, }) = _Page; factory Page.fromJson(Map json) => _$PageFromJson(json); } ================================================ FILE: lib/features/general/general.dart ================================================ export 'data/data.dart'; export 'pages/pages.dart'; ================================================ FILE: lib/features/general/pages/cubit/cubit.dart ================================================ export 'reload_form_cubit.dart'; ================================================ FILE: lib/features/general/pages/cubit/reload_form_cubit.dart ================================================ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'reload_form_cubit.freezed.dart'; class ReloadFormCubit extends Cubit { ReloadFormCubit() : super(const ReloadFormStateInitial()); void reload() { emit(const ReloadFormStateInitial()); emit(const ReloadFormStateFormUpdate()); } } @freezed sealed class ReloadFormState with _$ReloadFormState { const factory ReloadFormState.initial() = ReloadFormStateInitial; const factory ReloadFormState.formUpdated() = ReloadFormStateFormUpdate; } ================================================ FILE: lib/features/general/pages/main/cubit/cubit.dart ================================================ export 'logout_cubit.dart'; export 'main_cubit.dart'; export 'user_cubit.dart'; ================================================ FILE: lib/features/general/pages/main/cubit/logout_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/services/hive/hive.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'logout_cubit.freezed.dart'; class LogoutCubit extends Cubit { final PostLogout _postLogout; LogoutCubit(this._postLogout) : super(const LogoutStateLoading()); Future postLogout() async { emit(const LogoutStateLoading()); final data = await _postLogout.call(NoParams()); data.fold( (l) => emit(LogoutStateFailure((l as ServerFailure).message ?? '')), (r) async { await sl().logoutBox(); emit(LogoutStateSuccess(r)); }, ); } } @freezed sealed class LogoutState with _$LogoutState { const factory LogoutState.loading() = LogoutStateLoading; const factory LogoutState.failure(String message) = LogoutStateFailure; const factory LogoutState.success(String message) = LogoutStateSuccess; } ================================================ FILE: lib/features/general/pages/main/cubit/main_cubit.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'main_cubit.freezed.dart'; class MainCubit extends Cubit { MainCubit() : super(const MainStateLoading()); int _currentIndex = 0; late List? dataMenus; void updateIndex(int index, DataHelper? mockMenu, {BuildContext? context}) { emit(const MainStateLoading()); _currentIndex = index; if (context != null) { initMenu(context, mockMenu: mockMenu); } emit(MainStateSuccess(mockMenu ?? dataMenus?[_currentIndex])); } void initMenu(BuildContext context, {DataHelper? mockMenu}) { dataMenus = [ DataHelper( title: Strings.of(context)?.dashboard ?? 'Dashboard', isSelected: true, ), DataHelper(title: Strings.of(context)?.settings ?? 'Settings'), DataHelper(title: Strings.of(context)?.logout ?? 'Logout'), ]; updateIndex(_currentIndex, mockMenu); } bool onBackPressed( BuildContext context, GlobalKey scaffoldState, { bool isDrawerClosed = false, }) { if (dataMenus == null) { return false; } if (dataMenus?[_currentIndex].title == (Strings.of(context)?.dashboard ?? 'Dashboard')) { return true; } else { if ((scaffoldState.currentState?.isEndDrawerOpen ?? false) || isDrawerClosed) { //hide navigation drawer scaffoldState.currentState?.openDrawer(); } else { for (final menu in dataMenus!) { menu.isSelected = menu.title == (Strings.of(context)?.dashboard ?? 'Dashboard'); } } return false; } } } @freezed sealed class MainState with _$MainState { const factory MainState.loading() = MainStateLoading; const factory MainState.success(DataHelper? data) = MainStateSuccess; } ================================================ FILE: lib/features/general/pages/main/cubit/user_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'user_cubit.freezed.dart'; class UserCubit extends Cubit { final GetUser _getUser; UserCubit(this._getUser) : super(const UserStateLoading()); Future getUser() async { emit(const UserStateLoading()); final data = await _getUser.call(NoParams()); data.fold( (l) => emit(UserStateFailure((l as ServerFailure).message ?? '')), (r) => emit(UserStateSuccess(r)), ); } } @freezed sealed class UserState with _$UserState { const factory UserState.loading() = UserStateLoading; const factory UserState.failure(String message) = UserStateFailure; const factory UserState.success(User? data) = UserStateSuccess; } ================================================ FILE: lib/features/general/pages/main/main.dart ================================================ export 'cubit/cubit.dart'; export 'main_page.dart'; export 'menu_drawer.dart'; ================================================ FILE: lib/features/general/pages/main/main_page.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class MainPage extends StatefulWidget { const MainPage({required this.child, super.key}); final Widget child; @override _MainPageState createState() => _MainPageState(); } class _MainPageState extends State { final GlobalKey _scaffoldKey = GlobalKey(); @override void didChangeDependencies() { super.didChangeDependencies(); context.read().initMenu(context); } @override Widget build(BuildContext context) => PopScope( onPopInvokedWithResult: (_, _) => context.read().onBackPressed(context, _scaffoldKey), child: Parent( scaffoldKey: _scaffoldKey, appBar: _appBar(), drawer: SizedBox( width: context.widthInPercent(80), child: BlocProvider( //coverage:ignore-start create: (_) => sl()..getUser(), child: MenuDrawer( dataMenu: context.read().dataMenus ?? [ DataHelper(title: 'Dashboard', isSelected: true), DataHelper(title: 'Settings'), DataHelper(title: 'Logout'), ], currentIndex: (int index) { /// don't update when index is logout if (index != 2) { context.read().updateIndex(index, null); } /// hide navigation drawer _scaffoldKey.currentState?.openEndDrawer(); }, onLogoutPressed: () => showDialog( context: context, builder: (_) => AlertDialog( title: Text( Strings.of(context)!.logout, style: Theme.of(context).textTheme.bodyLarge?.copyWith( color: Theme.of(context).extension()!.red, ), ), content: Text( Strings.of(context)!.logoutDesc, style: Theme.of(context).textTheme.bodyMedium, ), actions: [ TextButton( onPressed: () => context.pop(), child: Text( Strings.of(context)!.cancel, style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of(context).hintColor, ), ), ), BlocListener( listener: (ctx, state) => switch (state) { LogoutStateLoading() => ctx.show(), LogoutStateFailure(:final message) => (() { ctx.dismiss(); message.toToastError(context); })(), LogoutStateSuccess(:final message) => (() { ctx.dismiss(); message.toToastSuccess(context); context.goNamed(Routes.root.name); })(), }, child: TextButton( onPressed: () { Navigator.pop(context); context.read().postLogout(); }, child: Text( Strings.of(context)!.yes, style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of( context, ).extension()!.red, ), ), ), ), ], ), ), ), //coverage:ignore-end ), ), child: widget.child, ), ); PreferredSize _appBar() => PreferredSize( preferredSize: const Size.fromHeight(kToolbarHeight), child: AppBar( automaticallyImplyLeading: false, centerTitle: true, title: BlocBuilder( builder: (_, state) => Text(switch (state) { MainStateLoading() => '-', MainStateSuccess(:final data) => data?.title ?? '-', }, style: Theme.of(context).textTheme.titleLarge), ), leading: IconButton( icon: Icon(Icons.sort, size: Dimens.space24, semanticLabel: 'Menu'), //coverage:ignore-start onPressed: () => _scaffoldKey.currentState?.openDrawer(), //coverage:ignore-end ), actions: const [ /// Notification on Dashboard ButtonNotification(), ], ), ); } ================================================ FILE: lib/features/general/pages/main/menu_drawer.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class MenuDrawer extends StatelessWidget { const MenuDrawer({ required this.dataMenu, required this.currentIndex, required this.onLogoutPressed, super.key, }); final List dataMenu; final Function(int) currentIndex; final VoidCallback onLogoutPressed; @override Widget build(BuildContext context) => Drawer( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Container( width: context.widthInPercent(100), height: Dimens.header, padding: EdgeInsets.symmetric(horizontal: Dimens.space16), color: Theme.of(context).extension()!.banner, child: SafeArea( child: BlocBuilder( builder: (_, state) => switch (state) { UserStateLoading() => const Loading(), UserStateFailure(:final message) => Center( child: Text(message), ), UserStateSuccess(:final data) => Row( children: [ CircleImage( url: data?.avatar ?? '', size: Dimens.profilePicture, ), const SpacerH(), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "${data?.name ?? ""} ${data?.isVerified ?? false ? "✅" : ""}", style: Theme.of(context).textTheme.titleLargeBold ?.copyWith( color: Theme.of( context, ).extension()!.subtitle, ), ), Text( data?.email ?? '', style: Theme.of(context).textTheme.bodySmall ?.copyWith( color: Theme.of( context, ).extension()!.subtitle, ), ), ], ), ), ], ), }, ), ), ), const SpacerV(), Expanded( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: dataMenu .map( (value) => SizedBox( width: double.maxFinite, child: InkWell( onTap: () { for (final menu in dataMenu) { menu.isSelected = menu.title == value.title; if (value.title != null) { currentIndex(dataMenu.indexOf(value)); } } _selectedPage(context, value.title!); }, child: Padding( padding: EdgeInsets.symmetric( vertical: Dimens.space12, horizontal: Dimens.space24, ), child: Text( value.title!, style: Theme.of(context).textTheme.bodyLarge, ), ), ), ), ) .toList(), ), ), ), // const SpacerH(), ], ), ); void _selectedPage(BuildContext context, String title) { //Update page from selected Page if (title == Strings.of(context)!.settings) { context.goNamed(Routes.settings.name); } else if (title == Strings.of(context)!.dashboard) { context.goNamed(Routes.dashboard.name); } else if (title == Strings.of(context)!.logout) { onLogoutPressed.call(); } } } ================================================ FILE: lib/features/general/pages/pages.dart ================================================ export 'cubit/cubit.dart'; export 'main/main.dart'; export 'settings/settings.dart'; export 'splashscreen/splashscreen.dart'; ================================================ FILE: lib/features/general/pages/settings/cubit/cubit.dart ================================================ export 'settings_cubit.dart'; ================================================ FILE: lib/features/general/pages/settings/cubit/settings_cubit.dart ================================================ import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class SettingsCubit extends Cubit with MainBoxMixin { SettingsCubit() : super(DataHelper(type: 'en')); void updateTheme(ActiveTheme activeTheme) { addData(MainBoxKeys.theme, activeTheme.name); emit( DataHelper( activeTheme: activeTheme, type: getData(MainBoxKeys.locale) ?? 'en', ), ); } void updateLanguage(String type) { /// Update locale code addData(MainBoxKeys.locale, type); emit(DataHelper(type: type, activeTheme: getActiveTheme())); } ActiveTheme getActiveTheme() { final activeTheme = ActiveTheme.values.singleWhere( (element) => element.name == (getData(MainBoxKeys.theme) ?? ActiveTheme.system.name), ); emit( DataHelper( activeTheme: activeTheme, type: getData(MainBoxKeys.locale) ?? 'en', ), ); return activeTheme; } } ================================================ FILE: lib/features/general/pages/settings/settings.dart ================================================ export 'cubit/cubit.dart'; export 'settings_page.dart'; ================================================ FILE: lib/features/general/pages/settings/settings_page.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class SettingsPage extends StatefulWidget { const SettingsPage({super.key}); @override _SettingsPageState createState() => _SettingsPageState(); } class _SettingsPageState extends State with MainBoxMixin { late final ActiveTheme _selectedTheme = sl().getActiveTheme(); late final List _listLanguage = [ DataHelper(title: Constants.get.english, type: 'en'), DataHelper(title: Constants.get.bahasa, type: 'id'), ]; late DataHelper _selectedLanguage = (getData(MainBoxKeys.locale) ?? 'en') == 'en' ? _listLanguage[0] : _listLanguage[1]; @override Widget build(BuildContext context) => Parent( child: SingleChildScrollView( child: Padding( padding: EdgeInsets.all(Dimens.space16), child: Column( children: [ DropDown( key: const Key('dropdown_theme'), hint: Strings.of(context)!.chooseTheme, value: _selectedTheme, prefixIcon: Icon( Icons.light, color: Theme.of(context).extension()!.subtitle, ), items: ActiveTheme.values .map( (data) => DropdownMenuItem( value: data, child: Text( _getThemeName(data, context), style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of( context, ).extension()!.subtitle, ), ), ), ) .toList(), onChanged: (value) { /// Reload theme context.read().updateTheme( value ?? ActiveTheme.system, ); }, ), /// Language DropDown( key: const Key('dropdown_language'), hint: Strings.of(context)!.chooseLanguage, value: _selectedLanguage, prefixIcon: Icon( Icons.language_outlined, color: Theme.of(context).extension()!.subtitle, ), items: _listLanguage .map( (data) => DropdownMenuItem( value: data, child: Text( data.title ?? '-', style: Theme.of(context).textTheme.bodyMedium?.copyWith( color: Theme.of( context, ).extension()!.subtitle, ), ), ), ) .toList(), onChanged: (DataHelper? value) { _selectedLanguage = value ?? _listLanguage[0]; /// Reload theme if (!mounted) { return; } context.read().updateLanguage( value?.type ?? 'en', ); }, ), ], ), ), ), ); String _getThemeName(ActiveTheme activeTheme, BuildContext context) { if (activeTheme == ActiveTheme.system) { return Strings.of(context)!.themeSystem; } else if (activeTheme == ActiveTheme.dark) { return Strings.of(context)!.themeDark; } else { return Strings.of(context)!.themeLight; } } } ================================================ FILE: lib/features/general/pages/splashscreen/cubit/cubit.dart ================================================ export 'general_token_cubit.dart'; ================================================ FILE: lib/features/general/pages/splashscreen/cubit/general_token_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'general_token_cubit.freezed.dart'; class GeneralTokenCubit extends Cubit { GeneralTokenCubit(this._postGeneralToken) : super(const GeneralTokenStateLoading()); final PostGeneralToken _postGeneralToken; Future generalToken(GeneralTokenParams params) async { emit(const GeneralTokenStateLoading()); final data = await _postGeneralToken.call(params); data.fold( (l) { if (l is ServerFailure) { emit(GeneralTokenStateFailure(l.message ?? '')); } }, (r) => emit(GeneralTokenStateSuccess(r.token)), ); } } @freezed sealed class GeneralTokenState with _$GeneralTokenState { const factory GeneralTokenState.loading() = GeneralTokenStateLoading; const factory GeneralTokenState.success(String? data) = GeneralTokenStateSuccess; const factory GeneralTokenState.failure(String message) = GeneralTokenStateFailure; } ================================================ FILE: lib/features/general/pages/splashscreen/splash_screen_page.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/general/general.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; class SplashScreenPage extends StatelessWidget { @override Widget build(BuildContext context) => Parent( child: BlocListener( //coverage:ignore-start listener: (context, state) => { if (state is GeneralTokenStateSuccess) {context.goNamed(Routes.root.name)} }, //coverage:ignore-end child: ColoredBox( color: Theme.of(context).extension()!.background!, child: Center( child: Image.asset( Theme.of(context).brightness == Brightness.dark ? Images.icLauncherDark : Images.icLauncher, width: context.widthInPercent(55), ), ), ), ), ); } ================================================ FILE: lib/features/general/pages/splashscreen/splashscreen.dart ================================================ export 'cubit/cubit.dart'; export 'splash_screen_page.dart'; ================================================ FILE: lib/features/users/data/data.dart ================================================ export 'datasources/datasources.dart'; export 'models/models.dart'; export 'repositories/repositories.dart'; ================================================ FILE: lib/features/users/data/datasources/datasources.dart ================================================ export 'user_remote_datasources.dart'; ================================================ FILE: lib/features/users/data/datasources/user_remote_datasources.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; abstract class UsersRemoteDatasource { Future> users(UsersParams userParams); Future> user(); } class UsersRemoteDatasourceImpl implements UsersRemoteDatasource { final DioClient _client; UsersRemoteDatasourceImpl(this._client); @override Future> users(UsersParams userParams) async { final response = await _client.getRequest( ListAPI.users, queryParameters: userParams.toJson(), converter: (response) => UsersResponse.fromJson(response as Map), ); return response; } @override Future> user() async { final response = await _client.getRequest( ListAPI.user, converter: (response) => UserResponse.fromJson(response as Map), ); return response; } } ================================================ FILE: lib/features/users/data/models/models.dart ================================================ export 'user_response.dart'; export 'users_response.dart'; ================================================ FILE: lib/features/users/data/models/user_response.dart ================================================ import 'package:flutter_auth_app/features/general/general.dart'; import 'package:flutter_auth_app/features/users/users.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'user_response.freezed.dart'; part 'user_response.g.dart'; @freezed sealed class UserResponse with _$UserResponse { const factory UserResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, @JsonKey(name: 'data') DataUser? data, }) = _UserResponse; const UserResponse._(); User toEntity() => User( name: data?.name, email: data?.email, avatar: data?.photo, isVerified: data?.verified, updatedAt: data?.updatedAt, ); factory UserResponse.fromJson(Map json) => _$UserResponseFromJson(json); } ================================================ FILE: lib/features/users/data/models/users_response.dart ================================================ import 'package:flutter_auth_app/features/general/general.dart'; import 'package:flutter_auth_app/features/users/users.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'users_response.freezed.dart'; part 'users_response.g.dart'; @freezed sealed class UsersResponse with _$UsersResponse { const factory UsersResponse({ @JsonKey(name: 'diagnostic') Diagnostic? diagnostic, @JsonKey(name: 'data') List? data, @JsonKey(name: 'page') Page? page, }) = _UsersResponse; const UsersResponse._(); Users toEntity() => Users( users: data ?.map( (data) => User( name: data.name, email: data.email, avatar: data.photo, isVerified: data.verified, updatedAt: data.updatedAt, ), ) .toList(), currentPage: page?.currentPage, lastPage: page?.lastPage, ); factory UsersResponse.fromJson(Map json) => _$UsersResponseFromJson(json); } @freezed sealed class DataUser with _$DataUser { const factory DataUser({ @JsonKey(name: 'id') String? id, @JsonKey(name: 'name') String? name, @JsonKey(name: 'email') String? email, @JsonKey(name: 'photo') String? photo, @JsonKey(name: 'verified') bool? verified, @JsonKey(name: 'createdAt') String? createdAt, @JsonKey(name: 'updatedAt') String? updatedAt, }) = _DataUser; factory DataUser.fromJson(Map json) => _$DataUserFromJson(json); } ================================================ FILE: lib/features/users/data/repositories/repositories.dart ================================================ export 'users_repository_impl.dart'; ================================================ FILE: lib/features/users/data/repositories/users_repository_impl.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; class UsersRepositoryImpl implements UsersRepository { /// Data Source final UsersRemoteDatasource usersRemoteDatasource; const UsersRepositoryImpl(this.usersRemoteDatasource); @override Future> users(UsersParams usersParams) async { final response = await usersRemoteDatasource.users(usersParams); return response.fold( (failure) => Left(failure), (usersResponse) { if (usersResponse.data?.isEmpty ?? true) { return Left(NoDataFailure()); //coverage:ignore-line } return Right(usersResponse.toEntity()); }, ); } @override Future> user() async { final response = await usersRemoteDatasource.user(); return response.fold( (failure) => Left(failure), (userResponse) => Right(userResponse.toEntity()), ); } } ================================================ FILE: lib/features/users/domain/domain.dart ================================================ export 'entities/entities.dart'; export 'repositories/repositories.dart'; export 'usecases/usecases.dart'; ================================================ FILE: lib/features/users/domain/entities/entities.dart ================================================ export 'users.dart'; ================================================ FILE: lib/features/users/domain/entities/users.dart ================================================ import 'package:freezed_annotation/freezed_annotation.dart'; part 'users.freezed.dart'; @freezed sealed class Users with _$Users { const factory Users({ List? users, int? currentPage, int? lastPage, }) = _Users; } @freezed sealed class User with _$User { const factory User({ String? name, String? avatar, String? email, bool? isVerified, String? updatedAt, }) = _User; } ================================================ FILE: lib/features/users/domain/repositories/repositories.dart ================================================ export 'users_repository.dart'; ================================================ FILE: lib/features/users/domain/repositories/users_repository.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; abstract class UsersRepository { Future> users(UsersParams usersParams); Future> user(); } ================================================ FILE: lib/features/users/domain/usecases/get_user.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; class GetUser extends UseCase { final UsersRepository _repo; // coverage:ignore-start GetUser(this._repo); @override Future> call(NoParams _) => _repo.user(); // coverage:ignore-end } ================================================ FILE: lib/features/users/domain/usecases/get_users.dart ================================================ import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'get_users.freezed.dart'; part 'get_users.g.dart'; class GetUsers extends UseCase { final UsersRepository _repo; GetUsers(this._repo); @override Future> call(UsersParams params) => _repo.users(params); } @freezed sealed class UsersParams with _$UsersParams { const factory UsersParams({@Default(1) int page}) = _UsersParams; factory UsersParams.fromJson(Map json) => _$UsersParamsFromJson(json); } ================================================ FILE: lib/features/users/domain/usecases/usecases.dart ================================================ export 'get_user.dart'; export 'get_users.dart'; ================================================ FILE: lib/features/users/pages/dashboard/cubit/cubit.dart ================================================ export 'users_cubit.dart'; ================================================ FILE: lib/features/users/pages/dashboard/cubit/users_cubit.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'users_cubit.freezed.dart'; class UsersCubit extends Cubit { UsersCubit(this._getUser) : super(const UsersStateLoading()); int currentPage = 1; int lastPage = 1; final List users = []; final GetUsers _getUser; Future refresh() async { /// reset data users.clear(); /// reset page currentPage = 1; lastPage = 1; /// fetch data await fetchUsers(UsersParams(page: currentPage)); } Future nextPage() async { if (currentPage < lastPage) { currentPage++; await fetchUsers(UsersParams(page: currentPage)); } } Future fetchUsers(UsersParams usersParams) async { if (currentPage == 1) { emit(const UsersStateLoading()); } final data = await _getUser.call(usersParams); data.fold( (l) { if (l is ServerFailure) { emit(UsersStateFailure(l.message ?? '')); } else if (l is NoDataFailure) { emit(const UsersStateEmpty()); } }, (r) { users.addAll(r.users ?? []); currentPage = r.currentPage ?? 1; lastPage = r.lastPage ?? 1; final updatedUsers = Users( currentPage: currentPage, lastPage: lastPage, users: users, ); if (currentPage != 1) { emit(const UsersStateInitial()); } emit(UsersStateSuccess(updatedUsers)); }, ); } } @freezed sealed class UsersState with _$UsersState { const factory UsersState.loading() = UsersStateLoading; const factory UsersState.initial() = UsersStateInitial; const factory UsersState.success(Users data) = UsersStateSuccess; const factory UsersState.failure(String message) = UsersStateFailure; const factory UsersState.empty() = UsersStateEmpty; } ================================================ FILE: lib/features/users/pages/dashboard/dashboard.dart ================================================ export 'cubit/cubit.dart'; export 'dashboard_page.dart'; ================================================ FILE: lib/features/users/pages/dashboard/dashboard_page.dart ================================================ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/users/users.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class DashboardPage extends StatefulWidget { const DashboardPage({super.key}); @override State createState() => _DashboardPageState(); } class _DashboardPageState extends State { late final ScrollController _scrollController = ScrollController() ..addListener(() { //coverage:ignore-start if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) { context.read().nextPage(); } //coverage:ignore-end }); @override Widget build(BuildContext context) => Parent( child: RefreshIndicator( color: Theme.of(context).extension()!.pink, backgroundColor: Theme.of(context).extension()!.background, onRefresh: () => context.read().refresh(), child: BlocBuilder( builder: (_, state) => switch (state) { UsersStateLoading() => const Center(child: Loading()), UsersStateInitial() => const SizedBox.shrink(), UsersStateSuccess(:final data) => ListView.builder( controller: _scrollController, physics: const AlwaysScrollableScrollPhysics(), itemCount: data.currentPage == data.lastPage ? data.users?.length //coverage:ignore-line : ((data.users?.length ?? 0) + 1), padding: EdgeInsets.symmetric(vertical: Dimens.space16), itemBuilder: (_, index) => index < (data.users?.length ?? 0) ? userItem(data.users![index]) : Padding( padding: EdgeInsets.all(Dimens.space16), child: const Center( child: CupertinoActivityIndicator(), ), ), ), UsersStateFailure(:final message) => Center(child: Empty(errorMessage: message)), UsersStateEmpty() => const Center(child: Empty()), }, ), ), ); Container userItem(User user) => Container( decoration: BoxDecorations(context).card, margin: EdgeInsets.symmetric( vertical: Dimens.space12, horizontal: Dimens.space16, ), child: Row( children: [ ClipRRect( borderRadius: BorderRadius.only( topLeft: Radius.circular(Dimens.space8), bottomLeft: Radius.circular(Dimens.space8), ), child: CachedNetworkImage( imageUrl: user.avatar ?? '', width: Dimens.profilePicture, height: Dimens.profilePicture, fit: BoxFit.cover, ), ), SpacerH(value: Dimens.space16), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( user.name ?? '', style: Theme.of(context).textTheme.titleLargeBold, ), Text( user.email ?? '', style: Theme.of(context) .textTheme .bodySmall ?.copyWith(color: Theme.of(context).hintColor), ), const SpacerV(), Row( children: [ Text( Strings.of(context)!.lastUpdate, style: Theme.of(context) .textTheme .labelSmall ?.copyWith(color: Theme.of(context).hintColor), ), Flexible( child: Text( (user.updatedAt ?? '').toStringDateAlt(), style: Theme.of(context) .textTheme .labelSmall ?.copyWith(color: Theme.of(context).hintColor), textAlign: TextAlign.end, ), ), ], ), ], ), ), ], ), ); } ================================================ FILE: lib/features/users/pages/pages.dart ================================================ export 'dashboard/dashboard.dart'; ================================================ FILE: lib/features/users/users.dart ================================================ export 'data/data.dart'; export 'domain/domain.dart'; export 'pages/pages.dart'; ================================================ FILE: lib/lzyct_app.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_auth_app/utils/helper/helper.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:oktoast/oktoast.dart'; class LzyctApp extends StatelessWidget { @override Widget build(BuildContext context) { SystemChrome.setSystemUIOverlayStyle( const SystemUiOverlayStyle(statusBarColor: Colors.transparent), ); log.d(const String.fromEnvironment('ENV')); return MultiBlocProvider( providers: [ BlocProvider(create: (_) => sl()..getActiveTheme()), BlocProvider(create: (_) => sl()), BlocProvider(create: (_) => sl()), ], child: OKToast( child: ScreenUtilInit( /// Set screen size to make responsive /// Almost all device designSize: const Size(375, 667), minTextAdapt: true, splitScreenMode: true, builder: (context, _) { /// Pass context to appRoute AppRoute.setStream(context); return BlocBuilder( builder: (_, data) => MaterialApp.router( routerConfig: AppRoute.router, localizationsDelegates: const [ Strings.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], debugShowCheckedModeBanner: false, builder: (BuildContext context, Widget? child) { final MediaQueryData data = MediaQuery.of(context); return MediaQuery( data: data.copyWith( textScaler: TextScaler.noScaling, alwaysUse24HourFormat: true, ), child: child!, ); }, title: Constants.get.appName, theme: themeLight(context), darkTheme: themeDark(context), locale: Locale(data.type ?? 'en'), supportedLocales: L10n.all, themeMode: data.activeTheme.mode, ), ); }, ), ), ); } } ================================================ FILE: lib/main.dart ================================================ import 'dart:async'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/lzyct_app.dart'; import 'package:flutter_auth_app/utils/utils.dart'; void main() { runZonedGuarded( /// Lock device orientation to portrait () async { WidgetsFlutterBinding.ensureInitialized(); /// Register Service locator await serviceLocator(); await FirebaseServices.init(); return SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]).then((_) => runApp(LzyctApp())); }, (error, stackTrace) => FirebaseCrashlytics.instance.recordError(error, stackTrace), ); } ================================================ FILE: lib/utils/ext/context.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; extension ContextExtensions on BuildContext { double widthInPercent(double percent) { final toDouble = percent / 100; return MediaQuery.of(this).size.width * toDouble; } double heightInPercent(double percent) { final toDouble = percent / 100; return MediaQuery.of(this).size.height * toDouble; } //Start Loading Dialog static late BuildContext ctx; Future show() => showDialog( context: this, barrierDismissible: false, builder: (c) { ctx = c; return PopScope( canPop: false, child: Material( color: Colors.transparent, child: Center( child: Container( decoration: BoxDecoration( color: Theme.of(c).extension()!.background, borderRadius: BorderRadius.circular(Dimens.cornerRadius), ), margin: EdgeInsets.symmetric(horizontal: Dimens.space30), padding: EdgeInsets.all(Dimens.space24), child: const Loading(), ), ), ), ); }, ); void dismiss() { try { Navigator.pop(ctx); } catch (_) {} } } ================================================ FILE: lib/utils/ext/ext.dart ================================================ export 'context.dart'; export 'map.dart'; export 'string.dart'; export 'text_theme.dart'; ================================================ FILE: lib/utils/ext/map.dart ================================================ extension MapExtension on Map { bool validate() { bool isValid = isNotEmpty; final values = this.values.toList(); for (final item in values) { if (!item) { isValid = false; break; } } return isValid; } } ================================================ FILE: lib/utils/ext/string.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:intl/intl.dart'; import 'package:oktoast/oktoast.dart'; extension StringExtension on String { bool isValidEmail() => RegExp( r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$', ).hasMatch(this); //https://github.com/ponnamkarthik/FlutterToast/issues/262 //coverage:ignore-start void toToastError(BuildContext context, {bool isUnitTest = false}) { try { final message = isEmpty ? 'error' : this; //dismiss before show toast dismissAllToast(showAnim: true); showToastWidget( Toast( bgColor: Theme.of(context).extension()!.red, icon: Icons.error, message: message, textColor: Colors.white, ), dismissOtherToast: true, position: ToastPosition.top, duration: const Duration(seconds: 3), ); } catch (e, stackTrace) { if (!isUnitTest) { FirebaseCrashLogger().nonFatalError(error: e, stackTrace: stackTrace); } log.e('error $e'); } } void toToastSuccess(BuildContext context, {bool isUnitTest = false}) { try { final message = isEmpty ? 'success' : this; //dismiss before show toast dismissAllToast(showAnim: true); // showToast(msg) showToastWidget( Toast( bgColor: Theme.of(context).extension()!.green, icon: Icons.check_circle, message: message, textColor: Colors.white, ), dismissOtherToast: true, position: ToastPosition.top, duration: const Duration(seconds: 3), ); } catch (e, stackTrace) { if (!isUnitTest) { FirebaseCrashLogger().nonFatalError(error: e, stackTrace: stackTrace); } log.e('$e'); } } void toToastLoading(BuildContext context, {bool isUnitTest = false}) { try { final message = isEmpty ? 'loading' : this; //dismiss before show toast dismissAllToast(showAnim: true); showToastWidget( Toast( bgColor: Theme.of(context).extension()!.pink, icon: Icons.info, message: message, textColor: Colors.white, ), dismissOtherToast: true, position: ToastPosition.top, duration: const Duration(seconds: 3), ); } catch (e, stackTrace) { if (!isUnitTest) { FirebaseCrashLogger().nonFatalError(error: e, stackTrace: stackTrace); } log.e('$e'); } } //coverage:ignore-end String toStringDateAlt({bool isShort = false, bool isToLocal = true}) { try { DateTime object; if (isToLocal) { object = DateTime.parse(this).toLocal(); } else { object = DateTime.parse(this); } return DateFormat("dd ${isShort ? "MMM" : "MMMM"} yyyy HH:mm", 'id') .format(object); } catch (_) { return '-'; } } } ================================================ FILE: lib/utils/ext/text_theme.dart ================================================ import 'package:flutter/material.dart'; extension TextThemeExtension on TextTheme { TextStyle? get titleLargeBold => titleLarge?.copyWith(fontWeight: FontWeight.bold); TextStyle? get bodyMedium500 => bodyMedium?.copyWith(fontWeight: FontWeight.w500); } ================================================ FILE: lib/utils/helper/common.dart ================================================ import 'dart:developer' as developer; import 'package:logger/logger.dart'; //coverage:ignore-start final log = Logger( printer: PrettyPrinter( methodCount: 1, lineLength: 110, ), output: MyConsoleOutput(), ); class MyConsoleOutput extends ConsoleOutput { @override void output(OutputEvent event) => event.lines.forEach(developer.log); } //coverage:ignore-end ================================================ FILE: lib/utils/helper/constant.dart ================================================ class Constants { Constants._(); static Constants get = Constants._(); String appName = 'Flutter Auth App'; String english = 'English'; String bahasa = 'Bahasa'; String imagePlaceHolder = 'https://cdn.dribbble.com/users/5478575/screenshots/12108011/media/17e913f849a16ea1f349b73afa04bbf9.jpg?compress=1&resize=400x300'; } ================================================ FILE: lib/utils/helper/data_helper.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/utils/utils.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'data_helper.freezed.dart'; @unfreezed abstract class DataHelper with _$DataHelper { factory DataHelper({ String? title, String? desc, String? iconPath, IconData? icon, String? url, String? type, int? id, @Default(false) bool isSelected, @Default(ActiveTheme.light) ActiveTheme activeTheme, }) = _DataHelper; } ================================================ FILE: lib/utils/helper/debouncer.dart ================================================ import 'dart:async'; import 'package:flutter/foundation.dart'; /// Use debouncer to detect user not in typing class Debouncer { Duration? duration; VoidCallback? action; Timer? _timer; Debouncer({this.duration}); void run(VoidCallback action) { if (_timer != null) { _timer!.cancel(); } _timer = Timer(duration ?? const Duration(milliseconds: 300), action); } } ================================================ FILE: lib/utils/helper/go_router_refresh_stream.dart ================================================ import 'dart:async'; import 'package:flutter/material.dart'; class GoRouterRefreshStream extends ChangeNotifier { GoRouterRefreshStream(List> streams) { notifyListeners(); for (final stream in streams) { stream.listen((dynamic _) => notifyListeners()); } } late final List> _subscriptions; @override void dispose() { try { for (final subscription in _subscriptions) { subscription.cancel(); //coverage:ignore-line } } catch (_) {} super.dispose(); } } ================================================ FILE: lib/utils/helper/helper.dart ================================================ export 'common.dart'; export 'constant.dart'; export 'data_helper.dart'; export 'debouncer.dart'; export 'go_router_refresh_stream.dart'; ================================================ FILE: lib/utils/services/firebase/firebase.dart ================================================ export 'firebase_crashlogger.dart'; export 'firebase_options.dart'; export 'firebase_services.dart'; ================================================ FILE: lib/utils/services/firebase/firebase_crashlogger.dart ================================================ import 'package:firebase_crashlytics/firebase_crashlytics.dart'; mixin class FirebaseCrashLogger { Future nonFatalError({ required dynamic error, required StackTrace stackTrace, }) async { await FirebaseCrashlytics.instance.recordError(error, stackTrace); } } ================================================ FILE: lib/utils/services/firebase/firebase_options.dart ================================================ // File generated by FlutterFire CLI. // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; import 'package:flutter/foundation.dart' show TargetPlatform, defaultTargetPlatform, kIsWeb; /// Default [FirebaseOptions] for use with your Firebase apps. /// /// Example: /// ```dart /// import 'firebase_options.dart'; /// // ... /// await Firebase.initializeApp( /// options: DefaultFirebaseOptionsStg.currentPlatform, /// ); /// ``` class DefaultFirebaseOptions { static FirebaseOptions get currentPlatform { if (kIsWeb) { throw UnsupportedError( 'DefaultFirebaseOptionsStg have not been configured for web - ' 'you can reconfigure this by running the FlutterFire CLI again.', ); } switch (defaultTargetPlatform) { case TargetPlatform.android: return android; case TargetPlatform.iOS: return ios; default: throw UnsupportedError( 'DefaultFirebaseOptionsStg are not supported for this platform.', ); } } static const FirebaseOptions android = FirebaseOptions( apiKey: String.fromEnvironment('ANDROID_API_KEY'), appId: String.fromEnvironment('ANDROID_APP_ID'), messagingSenderId: String.fromEnvironment('ANDROID_SENDER_ID'), projectId: String.fromEnvironment('ANDROID_PROJECT_ID'), storageBucket: String.fromEnvironment('ANDROID_STORAGE_BUCKET'), ); static const FirebaseOptions ios = FirebaseOptions( apiKey: String.fromEnvironment('IOS_API_KEY'), appId: String.fromEnvironment('IOS_APP_ID'), messagingSenderId: String.fromEnvironment('IOS_SENDER_ID'), projectId: String.fromEnvironment('IOS_PROJECT_ID'), storageBucket: String.fromEnvironment('IOS_STORAGE_BUCKET'), androidClientId: String.fromEnvironment('IOS_ANDROID_CLIENT_ID'), iosClientId: String.fromEnvironment('IOS_IOS_CLIENT_ID'), iosBundleId: String.fromEnvironment('IOS_BUNDLE_ID'), ); } ================================================ FILE: lib/utils/services/firebase/firebase_services.dart ================================================ import 'dart:isolate'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter_auth_app/utils/utils.dart'; mixin FirebaseServices { static Future init() async { /// Initialize Firebase await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); // Pass all uncaught errors from the framework to Crashlytics. // FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError; await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); /// Catch errors that happen outside of the Flutter context, Isolate.current.addErrorListener( RawReceivePort((List pair) async { final List errorAndStacktrace = pair; await FirebaseCrashlytics.instance.recordError( errorAndStacktrace.first, errorAndStacktrace.last as StackTrace, ); }).sendPort, ); } } ================================================ FILE: lib/utils/services/hive/hive.dart ================================================ export 'hive_adapters.dart'; export 'main_box.dart'; ================================================ FILE: lib/utils/services/hive/hive_adapters.dart ================================================ import 'package:hive_ce/hive.dart'; // part 'hive_adapters.g.dart'; @GenerateAdapters([]) // This is for code generation // ignore: unused_element void _() {} ================================================ FILE: lib/utils/services/hive/hive_adapters.g.yaml ================================================ # Generated by Hive CE # Manual modifications may be necessary for certain migrations # Check in to version control nextTypeId: 0 types: {} ================================================ FILE: lib/utils/services/hive/main_box.dart ================================================ import 'package:flutter/material.dart'; import 'package:hive_ce_flutter/hive_flutter.dart'; enum ActiveTheme { light(ThemeMode.light), dark(ThemeMode.dark), system(ThemeMode.system); final ThemeMode mode; const ActiveTheme(this.mode); } enum MainBoxKeys { generalToken, authToken, refreshToken, fcm, language, theme, locale, isLogin, } mixin class MainBoxMixin { static late Box? mainBox; static const _boxName = 'flutter_auth_app'; static Future initHive(String prefixBox) async { // Initialize hive (persistent database) await Hive.initFlutter(); mainBox = await Hive.openBox('$prefixBox$_boxName'); } Future addData(MainBoxKeys key, T value) async { await mainBox?.put(key.name, value); } Future removeData(MainBoxKeys key) async { await mainBox?.delete(key.name); } T getData(MainBoxKeys key) => mainBox?.get(key.name) as T; Future logoutBox() async { /// Clear the box await removeData(MainBoxKeys.isLogin); await removeData(MainBoxKeys.authToken); } } ================================================ FILE: lib/utils/services/services.dart ================================================ export 'firebase/firebase.dart'; export 'hive/hive.dart'; ================================================ FILE: lib/utils/utils.dart ================================================ export 'ext/ext.dart'; export 'helper/helper.dart'; export 'services/services.dart'; ================================================ FILE: maestro-prd/dashboard.yaml ================================================ appId: com.lazycatlabs.auths --- - swipe: direction: "UP" - swipe: direction: "UP" - swipe: direction: "UP" ================================================ FILE: maestro-prd/login.yaml ================================================ appId: com.lazycatlabs.auths --- - launchApp - tapOn: "Email" - inputText: "mudassir@lazycatlabs.com" - tapOn: "Password" - inputText: "pass123" - tapOn: "LOGIN" ================================================ FILE: maestro-prd/logout.yaml ================================================ appId: com.lazycatlabs.auths --- - tapOn: "Menu" - tapOn: "Logout" - tapOn: "Yes" ================================================ FILE: maestro-prd/main.yaml ================================================ appId: com.lazycatlabs.auths --- - runFlow: "login.yaml" - runFlow: "dashboard.yaml" - runFlow: "settings.yaml" - runFlow: "dashboard.yaml" - runFlow: "logout.yaml" - runFlow: "register.yaml" ================================================ FILE: maestro-prd/register.yaml ================================================ appId: com.lazycatlabs.auths --- - tapOn: "DON'T HAVE AN ACCOUNT?" - tapOn: "Name" - inputText: "Mudassir" - tapOn: "Email" - inputText: "mudassir@lazycatlabs.com" - tapOn: "password\nPassword" - inputText: "pass123" - tapOn: point: "50%,38%" - tapOn: "repeat_password\nRepeat Password" - inputText: "pass123" - tapOn: point: "50%,38%" - tapOn: "REGISTER" ================================================ FILE: maestro-prd/settings.yaml ================================================ appId: com.lazycatlabs.auths --- - tapOn: "Menu" - tapOn: "Settings" - tapOn: "Theme System" - tapOn: "Theme Dark" - tapOn: "Theme Dark" - tapOn: "Theme Light" - tapOn: "Theme Light" - tapOn: "Theme Dark" - tapOn: "English" - tapOn: "Bahasa" - tapOn: "Bahasa" - tapOn: "English" - tapOn: "Menu" - tapOn: "Dashboard" ================================================ FILE: maestro-stg/dashboard.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - swipe: direction: "UP" - swipe: direction: "UP" - swipe: direction: "UP" ================================================ FILE: maestro-stg/login.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - launchApp - tapOn: "Email" - inputText: "mudassir@lazycatlabs.com" - tapOn: "Password" - inputText: "pass123" - tapOn: "LOGIN" ================================================ FILE: maestro-stg/logout.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - tapOn: "Menu" - tapOn: "Logout" - tapOn: "Yes" ================================================ FILE: maestro-stg/main.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - runFlow: "login.yaml" - runFlow: "dashboard.yaml" - runFlow: "settings.yaml" - runFlow: "dashboard.yaml" - runFlow: "logout.yaml" - runFlow: "register.yaml" ================================================ FILE: maestro-stg/register.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - tapOn: "DON'T HAVE AN ACCOUNT?" - tapOn: "Name" - inputText: "Mudassir" - tapOn: "Email" - inputText: "mudassir@lazycatlabs.com" - tapOn: "password\nPassword" - inputText: "pass123" - tapOn: point: "50%,38%" - tapOn: "repeat_password\nRepeat Password" - inputText: "pass123" - tapOn: point: "50%,38%" - tapOn: "REGISTER" ================================================ FILE: maestro-stg/settings.yaml ================================================ appId: com.lazycatlabs.auths.stg --- - tapOn: "Menu" - tapOn: "Settings" - tapOn: "Theme System" - tapOn: "Theme Dark" - tapOn: "Theme Dark" - tapOn: "Theme Light" - tapOn: "Theme Light" - tapOn: "Theme Dark" - tapOn: "English" - tapOn: "Bahasa" - tapOn: "Bahasa" - tapOn: "English" - tapOn: "Menu" - tapOn: "Dashboard" ================================================ FILE: pubspec.yaml ================================================ name: flutter_auth_app description: This is base for my project in flutter # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. publish_to: 'none' # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your app. # A version number is three numbers separated by dots, like 1.2.43 # followed by an optional build number separated by a +. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # In Android, build-name is used as versionName while build-number used as versionCode. # Read more about Android versioning at https://developer.android.com/studio/publish/versioning # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html version: 1.0.0+1 environment: sdk: ^3.8.0 dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter # The following adds the Cupertino Icons font to your app. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 # Use as default SVG image loader, prefer use SVG as image asset flutter_svg: ^2.2.1 # Functional programming thingies dartz: ^0.10.1 # Use as Network Client dio: ^5.9.0 # Use hive to save local data hive_ce: ^2.12.0 hive_ce_flutter: ^2.3.2 # Use for Dependencies Injection get_it: ^8.2.0 # Use for State Management with BLoC pattern flutter_bloc: ^9.1.1 # Use for custom toast with Status, ex:Loading,Success,Failed oktoast: ^3.4.0 # Use for responsive UI, set default size base on Mock Up flutter_screenutil: ^5.9.3 cached_network_image: ^3.4.1 # logger logger: ^2.6.1 # Firebase firebase_core: ^4.1.0 firebase_analytics: ^12.0.1 firebase_crashlytics: ^5.0.1 # router go_router: ^16.2.1 # Freezed freezed_annotation: ^3.1.0 json_annotation: ^4.9.0 flutter_native_splash: ^2.4.6 intl: ^0.20.2 dev_dependencies: flutter_test: sdk: flutter flutter_launcher_icons: ^0.14.4 lint: ^2.8.0 flutter_lints: ^6.0.0 bloc_test: ^10.0.0 build_runner: ^2.8.0 http_mock_adapter: ^0.6.1 #Temporary using old version because error when generate build_runner mockito: ^5.5.1 # Freezed freezed: ^3.2.3 json_serializable: ^6.11.1 # hive generator hive_ce_generator: ^1.9.5 # TODO: Remove these overrides after packages are updated dependency_overrides: # intl: ^0.20.2 analyzer: ^8.1.1 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: # The following line ensures that the Material Icons font is # included with your app, so that you can use the icons in # the material Icons class. uses-material-design: true # Enable the generation of the Flutter plugin registrant. generate: true # To add assets to your app, add an assets section, like this: assets: - assets/images/ - assets/fonts/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: fonts: - family: Poppins fonts: - asset: assets/fonts/Poppins-Thin.ttf weight: 100 - asset: assets/fonts/Poppins-ExtraLight.ttf weight: 200 - asset: assets/fonts/Poppins-Light.ttf weight: 300 - asset: assets/fonts/Poppins-Regular.ttf weight: 400 - asset: assets/fonts/Poppins-Medium.ttf weight: 500 - asset: assets/fonts/Poppins-SemiBold.ttf weight: 600 - asset: assets/fonts/Poppins-Bold.ttf weight: 700 - asset: assets/fonts/Poppins-ExtraBold.ttf weight: 800 - asset: assets/fonts/Poppins-Black.ttf weight: 900 # # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages ================================================ FILE: test/core/api/list_api_test.dart ================================================ import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('ListAPI', () { test('Auth endpoints', () { expect(ListAPI.generalToken, equals('/v1/api/auth/general')); expect(ListAPI.user, equals('/v1/api/user')); expect(ListAPI.login, equals('/v1/api/auth/login')); expect(ListAPI.logout, equals('/v1/api/auth/logout')); }); test('User endpoints', () { expect(ListAPI.users, equals('/v1/api/user/all')); }); }); } ================================================ FILE: test/core/app_route_test.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/general/general.dart'; import 'package:flutter_auth_app/features/users/users.dart'; import 'package:flutter_auth_app/utils/services/hive/hive.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:go_router/go_router.dart'; /// ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import '../helpers/fake_path_provider_platform.dart'; import '../helpers/test_mock.mocks.dart'; void main() { setUp(() async { TestWidgetsFlutterBinding.ensureInitialized(); PathProviderPlatform.instance = FakePathProvider(); await serviceLocator(isUnitTest: true, prefixBox: 'app_route_test_'); }); test('Routes enum contains correct paths', () { expect(Routes.root.path, equals('/')); expect(Routes.splashScreen.path, equals('/splashscreen')); expect(Routes.dashboard.path, equals('/dashboard')); expect(Routes.settings.path, equals('/settings')); expect(Routes.login.path, equals('/auth/login')); expect(Routes.register.path, equals('/auth/register')); }); test('Check AppRoute setStream', () { final context = MockBuildContext(); AppRoute.setStream(context, isTest: true); expect(AppRoute.context, equals(context)); expect(AppRoute.isUnitTest, equals(true)); }); test('Check AppRoute router', () { expect(AppRoute.router, isA()); }); test('Check initial route is splashscreen', () { final context = MockBuildContext(); AppRoute.setStream(context, isTest: true); expect( AppRoute.router.routeInformationProvider.value.uri.path, equals(Routes.splashScreen.path), ); }); testWidgets('Dashboard route builds within shell correctly', ( WidgetTester tester, ) async { final context = MockBuildContext(); //set login as true MainBoxMixin.mainBox?.put(MainBoxKeys.isLogin.name, true); AppRoute.setStream(context, isTest: true); // Create a test app with the router await tester.pumpWidget( ScreenUtilInit( designSize: const Size(375, 667), minTextAdapt: true, splitScreenMode: true, builder: (_, _) => MaterialApp.router( routerConfig: AppRoute.router, localizationsDelegates: const [ Strings.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], locale: const Locale('en'), supportedLocales: L10n.all, theme: themeLight(context), ), ), ); // Navigate to dashboard await tester.pumpAndSettle(); expect(find.byType(MainPage), findsOneWidget); expect(find.byType(DashboardPage), findsOneWidget); }); } ================================================ FILE: test/core/error/exception_test.dart ================================================ import 'package:flutter_auth_app/core/error/exceptions.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('Exceptions', () { test('ServerException should store message', () { const errorMessage = 'Server error occurred'; final exception = ServerException(errorMessage); expect(exception.message, equals(errorMessage)); }); test('CacheException should be instantiable', () { final exception = CacheException(); expect(exception, isA()); }); }); } ================================================ FILE: test/core/error/failure_test.dart ================================================ import 'package:flutter_auth_app/core/error/failure.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('Failure', () { test('ServerFailure equality and hashCode', () { const failure1 = ServerFailure('Error message'); const failure2 = ServerFailure('Error message'); const failure3 = ServerFailure('Different message'); expect(failure1, equals(failure2)); expect(failure1, isNot(equals(failure3))); expect(failure1.hashCode, equals(failure2.hashCode)); expect(failure1.hashCode, isNot(equals(failure3.hashCode))); }); test('NoDataFailure equality and hashCode', () { final failure1 = NoDataFailure(); final failure2 = NoDataFailure(); expect(failure1, equals(failure2)); expect(failure1.hashCode, equals(failure2.hashCode)); }); test('CacheFailure equality and hashCode', () { final failure1 = CacheFailure(); final failure2 = CacheFailure(); expect(failure1, equals(failure2)); expect(failure1.hashCode, equals(failure2.hashCode)); }); }); } ================================================ FILE: test/core/localization/l10n_test.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('L10n', () { test('all locales', () { expect(L10n.all, contains(const Locale('en'))); expect(L10n.all, contains(const Locale('id'))); }); test('getFlag returns correct language name', () { expect(L10n.getFlag('en'), equals('English')); expect(L10n.getFlag('id'), equals('Bahasa')); }); test('getFlag returns default language name for unknown code', () { expect(L10n.getFlag('unknown'), equals('English')); }); }); } ================================================ FILE: test/core/widgets/circle_image_test.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../helpers/test_mock.mocks.dart'; void main() { Widget rootWidget(Widget body) => ScreenUtilInit( designSize: const Size(375, 667), minTextAdapt: true, splitScreenMode: true, builder: (_, _) => MaterialApp( localizationsDelegates: const [ Strings.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], locale: const Locale('en'), supportedLocales: L10n.all, theme: themeLight(MockBuildContext()), home: body, ), ); testWidgets('displays circle image', (WidgetTester tester) async { await tester.pumpWidget( rootWidget( const CircleImage(url: 'https://example.com/image.jpg', size: 50), ), ); expect(find.byType(CircleImage), findsOneWidget); }); } ================================================ FILE: test/core/widgets/toast_test.dart ================================================ import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../helpers/test_mock.mocks.dart'; void main() { Widget rootWidget(Widget body) => ScreenUtilInit( designSize: const Size(375, 667), minTextAdapt: true, splitScreenMode: true, builder: (_, _) => MaterialApp( localizationsDelegates: const [ Strings.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], locale: const Locale('en'), supportedLocales: L10n.all, theme: themeLight(MockBuildContext()), home: body, ), ); testWidgets('displays circle image', (WidgetTester tester) async { await tester.pumpWidget( rootWidget( const Toast( bgColor: Colors.red, icon: Icons.error, message: 'Message', textColor: Colors.white, ), ), ); expect(find.byType(Toast), findsOneWidget); expect(find.byType(Icon), findsOneWidget); expect(find.text('Message'), findsOneWidget); }); } ================================================ FILE: test/features/auth/data/datasources/models/general_token_response_test.dart ================================================ import 'dart:convert'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../../helpers/json_reader.dart'; import '../../../../../helpers/paths.dart'; void main() { const generalTokenResponse = GeneralTokenResponse( diagnostic: Diagnostic(status: '200', message: 'Success'), data: DataGeneralToken( token: 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8M2H7lG8u1DTq1jj7rb1BEtwGw', tokenType: 'Bearer', ), ); test('from json, should return a valid model from json', () { /// arrange final jsonMap = json.decode(jsonReader(pathGeneralTokenResponse200)); /// act final result = GeneralTokenResponse.fromJson(jsonMap as Map); /// assert expect(result, equals(generalTokenResponse)); }); test('to json, should return a json map containing proper data', () { /// act final result = generalTokenResponse.toJson(); /// arrange final exceptedJson = { 'diagnostic': { 'status': '200', 'message': 'Success', }, 'data': { 'token': 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8M2H7lG8u1DTq1jj7rb1BEtwGw', 'tokenType': 'Bearer', }, }; /// assert expect(result, equals(exceptedJson)); }); } ================================================ FILE: test/features/auth/data/datasources/models/login_response_test.dart ================================================ import 'dart:convert'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../../helpers/json_reader.dart'; import '../../../../../helpers/paths.dart'; void main() { const loginResponse = LoginResponse( diagnostic: Diagnostic(status: '200', message: 'Success'), data: DataLogin( token: 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8M2H7lG8u1DTq1jj7rb1BEtwGw', tokenType: 'Bearer', refreshToken: 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8', ), ); test('from json, should return a valid model from json', () { /// arrange final jsonMap = json.decode(jsonReader(pathLoginResponse200)); /// act final result = LoginResponse.fromJson(jsonMap as Map); /// assert expect(result, equals(loginResponse)); }); test('to json, should return a json map containing proper data', () { /// act final result = loginResponse.toJson(); /// arrange final exceptedJson = { 'diagnostic': {'status': '200', 'message': 'Success'}, 'data': { 'token': 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8M2H7lG8u1DTq1jj7rb1BEtwGw', 'tokenType': 'Bearer', 'refreshToken': 'lazycatlabs.eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJhdXRoX2FwcCIsImlhdCI6MTY5OTExMDMxOSwiZXhwIjoxNjk5NzE1MTE5fQ.SlybkWOQs9JJpTG-tRYJapalESGNE63atPEfw6ry7NdcoZFkjYDAdlYfnIBlp9eUISAjSc7IUtvKGks0jEJ27V_iUBdKcS0aTVvtd8g1yW14UBGW6jKsOn9QtgxWnPELP0GZ1TRzObZW3bYAXpiVsC9o0LnONmq5ehMUgHVYknF_wTfHwSB2pb77pAZguwK4I9MI4BoqcvcuET36MEgYs9vY-e0f2y50nHN4kbjVe9iFay0GeNIRQsWzzmyN5Xd9Zv5HiSCgbB80UA6SrneoExBi-fNIlxrOxJRaVt16-1ElXu04W5Y_FIoY-jekmMWusE54csh3Woo6ChQQJEopfuU6prdP50TN7UpqiH_o3R77MdgcYBdJ-puZOt-XsplOHNAjDtp2rpo9UExQUlOVxQFuvSKkanxaOSsAXYuOaEh9iBoq0LQ_JiaIbrZBn7EVxKhFnUJokv7SvPMg2LG7p7wczgxYjnuxG0fDRRjK2vAQyAj0rIigd6xpA6g-ii5VWRsk_sMJw-QJW_ivZdQZwjlXeH-EcVeTaZ9yn2zmmavF6sxDxC1SDGGkbKjUpfIdQYa-t82sPO0HUd_OBQ8ZiBGmSV1gi-8lAat1XtJTgsgM0zTxqK5kwekc3gsoZfVdlhJ8SyN6ohyOMU8Hv8', }, }; /// assert expect(result, equals(exceptedJson)); }); } ================================================ FILE: test/features/auth/data/datasources/models/register_response_test.dart ================================================ import 'dart:convert'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../../helpers/json_reader.dart'; import '../../../../../helpers/paths.dart'; void main() { const registerResponse = RegisterResponse( diagnostic: Diagnostic( status: '200', message: 'Success', ), data: DataRegister( id: '8364aa6f-6887-4502-a6b0-62f082196476', name: 'Mudassir', email: 'mudassir@lazycatlabs.com', photo: 'https://user-images.githubusercontent.com/1531684/281937715-f53c55be-4b70-43b5-bb50-11706fb71ada.png', verified: false, createdAt: '2024-08-25T15:04:28.191067', updatedAt: '2024-08-25T15:04:28.191067', ), ); test('from json, should return a valid model from json', () { /// arrange final jsonMap = json.decode(jsonReader(pathRegisterResponse200)); /// act final result = RegisterResponse.fromJson(jsonMap as Map); /// assert expect(result, equals(registerResponse)); }); test('to json, should return a json map containing proper data', () { /// act final result = registerResponse.toJson(); /// arrange final exceptedJson = { 'diagnostic': { 'status': '200', 'message': 'Success', }, 'data': { 'id': '8364aa6f-6887-4502-a6b0-62f082196476', 'name': 'Mudassir', 'email': 'mudassir@lazycatlabs.com', 'photo': 'https://user-images.githubusercontent.com/1531684/281937715-f53c55be-4b70-43b5-bb50-11706fb71ada.png', 'verified': false, 'createdAt': '2024-08-25T15:04:28.191067', 'updatedAt': '2024-08-25T15:04:28.191067', }, }; /// assert expect(result, equals(exceptedJson)); }); } ================================================ FILE: test/features/auth/data/datasources/repositories/auth_remote_datasources_test.dart ================================================ import 'dart:convert'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:http_mock_adapter/http_mock_adapter.dart'; /// ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import '../../../../../helpers/fake_path_provider_platform.dart'; import '../../../../../helpers/json_reader.dart'; import '../../../../../helpers/paths.dart'; void main() { late DioAdapter dioAdapter; late AuthRemoteDatasourceImpl dataSource; setUp(() async { TestWidgetsFlutterBinding.ensureInitialized(); PathProviderPlatform.instance = FakePathProvider(); await serviceLocator( isUnitTest: true, prefixBox: 'auth_remote_datasource_test_', ); dioAdapter = DioAdapter(dio: sl().dio); dataSource = AuthRemoteDatasourceImpl(sl()); }); group('register', () { const registerParams = RegisterParams(email: 'mudassir@lazycatlabs.com', password: 'Pass123'); final registerModel = RegisterResponse.fromJson( json.decode(jsonReader(pathRegisterResponse200)) as Map, ); test( 'should return register success model when response code is 200', () async { /// arrange dioAdapter.onPost( ListAPI.user, (server) => server.reply( 200, json.decode(jsonReader(pathRegisterResponse200)), ), data: registerParams.toJson(), ); /// act final result = await dataSource.register(registerParams); /// assert result.fold( (l) => expect(l, null), (r) => expect(r, registerModel), ); }, ); test( 'should return register unsuccessful model when response code is 400', () async { /// arrange dioAdapter.onPost( ListAPI.user, (server) => server.reply( 400, json.decode(jsonReader(pathRegisterResponse400)), ), data: registerParams.toJson(), ); /// act final result = await dataSource.register(registerParams); /// assert result.fold( (l) => expect(l, isA()), (r) => expect(r, null), ); }, ); }); group('login', () { const loginParams = LoginParams(email: 'mudassir@lazycatlabs.com', password: 'Pass123'); final loginModel = LoginResponse.fromJson( json.decode(jsonReader(pathLoginResponse200)) as Map, ); test( 'should return login success model when response code is 200', () async { /// arrange dioAdapter.onPost( ListAPI.login, (server) => server.reply( 200, json.decode(jsonReader(pathLoginResponse200)), ), data: loginParams.toJson(), ); /// act final result = await dataSource.login(loginParams); /// assert result.fold( (l) => expect(l, null), (r) => expect(r, loginModel), ); }, ); test( 'should return login unsuccessful model when response code is 401', () async { /// arrange dioAdapter.onPost( ListAPI.login, (server) => server.reply( 401, json.decode(jsonReader(pathLoginResponse401)), ), data: loginParams.toJson(), ); /// act final result = await dataSource.login(loginParams); /// assert result.fold( (l) => expect(l, isA()), (r) => expect(r, null), ); }, ); }); group('general token', () { const generalTokenParams = GeneralTokenParams(clientId: 'apimock', clientSecret: 'apimock_secret'); final generalTokenResponse = GeneralTokenResponse.fromJson( json.decode(jsonReader(pathGeneralTokenResponse200)) as Map, ); test( 'should return general token success model when response code is 200', () async { /// arrange dioAdapter.onPost( ListAPI.generalToken, (server) => server.reply( 200, json.decode(jsonReader(pathGeneralTokenResponse200)), ), data: generalTokenParams.toJson(), ); /// act final result = await dataSource.generalToken(generalTokenParams); /// assert result.fold( (l) => expect(l, null), (r) => expect(r, generalTokenResponse), ); }, ); test( 'should return general token unsuccessful model when response code is 401', () async { /// arrange dioAdapter.onPost( ListAPI.login, (server) => server.reply( 401, json.decode(jsonReader(pathGeneralTokenResponse401)), ), data: generalTokenParams.toJson(), ); /// act final result = await dataSource.generalToken(generalTokenParams); /// assert result.fold( (l) => expect(l, isA()), (r) => expect(r, null), ); }, ); }); } ================================================ FILE: test/features/auth/data/repositories/auth_repository_impl_test.dart ================================================ import 'dart:convert'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; /// ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import '../../../../helpers/fake_path_provider_platform.dart'; import '../../../../helpers/json_reader.dart'; import '../../../../helpers/paths.dart'; import '../../../../helpers/test_mock.mocks.dart'; void main() { late MockAuthRemoteDatasource mockAuthRemoteDatasource; late AuthRepositoryImpl authRepositoryImpl; late Login login; late GeneralToken generalToken; late Register register; setUp(() async { TestWidgetsFlutterBinding.ensureInitialized(); PathProviderPlatform.instance = FakePathProvider(); await serviceLocator( isUnitTest: true, prefixBox: 'auth_repository_impl_test_', ); mockAuthRemoteDatasource = MockAuthRemoteDatasource(); authRepositoryImpl = AuthRepositoryImpl(mockAuthRemoteDatasource, sl()); login = LoginResponse.fromJson( json.decode(jsonReader(pathLoginResponse200)) as Map, ).toEntity(); register = RegisterResponse.fromJson( json.decode(jsonReader(pathRegisterResponse200)) as Map, ).toEntity(); generalToken = GeneralTokenResponse.fromJson( json.decode(jsonReader(pathGeneralTokenResponse200)) as Map, ).toEntity(); }); group('general token', () { const generalTokenParams = GeneralTokenParams(clientId: 'apimock', clientSecret: 'apimock_secret'); test('should return general token when call data is successful', () async { // arrange when(mockAuthRemoteDatasource.generalToken(generalTokenParams)) .thenAnswer( (_) async => Right( GeneralTokenResponse.fromJson( json.decode(jsonReader(pathGeneralTokenResponse200)) as Map, ), ), ); // act final result = await authRepositoryImpl.generalToken(generalTokenParams); // assert verify(mockAuthRemoteDatasource.generalToken(generalTokenParams)); expect(result, Right(generalToken)); }); test( 'should return server failure when call data is unsuccessful', () async { // arrange when(mockAuthRemoteDatasource.generalToken(generalTokenParams)) .thenAnswer((_) async => const Left(ServerFailure(''))); // act final result = await authRepositoryImpl.generalToken(generalTokenParams); // assert verify(mockAuthRemoteDatasource.generalToken(generalTokenParams)); expect(result, const Left(ServerFailure(''))); }, ); }); group('login', () { const loginParams = LoginParams(email: 'mudassir@lazycatlabs.com', password: 'pass123'); test('should return login when call data is successful', () async { // arrange when(mockAuthRemoteDatasource.login(loginParams)).thenAnswer( (_) async => Right( LoginResponse.fromJson( json.decode(jsonReader(pathLoginResponse200)) as Map, ), ), ); // act final result = await authRepositoryImpl.login(loginParams); // assert verify(mockAuthRemoteDatasource.login(loginParams)); expect(result, Right(login)); }); test( 'should return server failure when call data is unsuccessful', () async { // arrange when(mockAuthRemoteDatasource.login(loginParams)) .thenAnswer((_) async => const Left(ServerFailure(''))); // act final result = await authRepositoryImpl.login(loginParams); // assert verify(mockAuthRemoteDatasource.login(loginParams)); expect(result, const Left(ServerFailure(''))); }, ); }); group('register', () { const registerParams = RegisterParams(email: 'mudassir@lazycatlabs.com', password: 'pass123'); test('should return register when call data is successful', () async { // arrange when(mockAuthRemoteDatasource.register(registerParams)).thenAnswer( (_) async => Right( RegisterResponse.fromJson( json.decode(jsonReader(pathRegisterResponse200)) as Map, ), ), ); // act final result = await authRepositoryImpl.register(registerParams); // assert verify(mockAuthRemoteDatasource.register(registerParams)); expect(result, equals(Right(register))); }); test( 'should return server failure when call data is unsuccessful', () async { // arrange when(mockAuthRemoteDatasource.register(registerParams)) .thenAnswer((_) async => const Left(ServerFailure(''))); // act final result = await authRepositoryImpl.register(registerParams); // assert verify(mockAuthRemoteDatasource.register(registerParams)); expect(result, const Left(ServerFailure(''))); }, ); }); } ================================================ FILE: test/features/auth/domain/usecases/post_general_token_test.dart ================================================ import 'dart:convert'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import '../../../../helpers/json_reader.dart'; import '../../../../helpers/paths.dart'; import '../../../../helpers/test_mock.mocks.dart'; void main() { late MockAuthRepository mockAuthRepository; late PostGeneralToken postGeneralToken; late GeneralToken generalToken; const generalTokenParams = GeneralTokenParams(clientId: 'apimock', clientSecret: 'apimock_secret'); setUp(() { generalToken = GeneralTokenResponse.fromJson( json.decode(jsonReader(pathGeneralTokenResponse200)) as Map, ).toEntity(); mockAuthRepository = MockAuthRepository(); postGeneralToken = PostGeneralToken(mockAuthRepository); }); test('should get general_token from the repository', () async { /// arrange when(mockAuthRepository.generalToken(generalTokenParams)) .thenAnswer((_) async => Right(generalToken)); /// act final result = await postGeneralToken.call(generalTokenParams); /// assert expect(result, equals(Right(generalToken))); }); test('parse GeneralTokenParams to json', () { /// act final result = generalTokenParams.toJson(); final expected = {'clientId': 'apimock', 'clientSecret': 'apimock_secret'}; /// assert expect(result, equals(expected)); }); test('parse GeneralTokenParams from json', () { /// act final params = GeneralTokenParams.fromJson({ 'clientId': 'apimock', 'clientSecret': 'apimock_secret', }); /// assert expect(params, equals(generalTokenParams)); }); } ================================================ FILE: test/features/auth/domain/usecases/post_login_test.dart ================================================ import 'dart:convert'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import '../../../../helpers/json_reader.dart'; import '../../../../helpers/paths.dart'; import '../../../../helpers/test_mock.mocks.dart'; void main() { late MockAuthRepository mockAuthRepository; late PostLogin postLogin; late Login login; const loginParams = LoginParams(email: 'mudassir@lazycatlabs.com', password: 'pass123'); setUp(() { login = LoginResponse.fromJson( json.decode(jsonReader(pathLoginResponse200)) as Map, ).toEntity(); mockAuthRepository = MockAuthRepository(); postLogin = PostLogin(mockAuthRepository); }); test('should get login from the repository', () async { /// arrange when(mockAuthRepository.login(loginParams)) .thenAnswer((_) async => Right(login)); /// act final result = await postLogin.call(loginParams); /// assert expect(result, equals(Right(login))); }); test('parse LoginParams to json', () { /// act final result = loginParams.toJson(); final expected = { 'email': 'mudassir@lazycatlabs.com', 'password': 'pass123', 'osInfo': null, 'deviceInfo': null, 'fcmToken': 'GeneratedFCMToken', }; /// assert expect(result, equals(expected)); }); test('parse LoginParams from json', () { /// act final params = LoginParams.fromJson({ 'email': 'mudassir@lazycatlabs.com', 'password': 'pass123', }); /// assert expect(params, equals(loginParams)); }); } ================================================ FILE: test/features/auth/domain/usecases/post_logout.dart ================================================ import 'dart:convert'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import '../../../../helpers/json_reader.dart'; import '../../../../helpers/paths.dart'; import '../../../../helpers/test_mock.mocks.dart'; void main() { late MockAuthRepository mockAuthRepository; late PostLogout postLogout; late String logout; setUp(() { logout = DiagnosticResponse.fromJson( json.decode(jsonReader(pathGeneralTokenResponse200)) as Map, ).diagnostic?.message ?? ''; mockAuthRepository = MockAuthRepository(); postLogout = PostLogout(mockAuthRepository); }); test('should get logout from the repository', () async { /// arrange when(mockAuthRepository.logout()).thenAnswer((_) async => Right(logout)); /// act final result = await postLogout.call(NoParams()); /// assert expect(result, equals(Right(logout))); }); } ================================================ FILE: test/features/auth/domain/usecases/post_register_test.dart ================================================ import 'dart:convert'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import '../../../../helpers/json_reader.dart'; import '../../../../helpers/paths.dart'; import '../../../../helpers/test_mock.mocks.dart'; void main() { late MockAuthRepository mockAuthRepository; late PostRegister postRegister; late Register register; const registerParams = RegisterParams( name: 'Mudassir', email: 'mudassir@lazycatlabs.com', password: 'pass123', ); setUp(() { register = RegisterResponse.fromJson( json.decode(jsonReader(pathRegisterResponse200)) as Map, ).toEntity(); mockAuthRepository = MockAuthRepository(); postRegister = PostRegister(mockAuthRepository); }); test('should get register from the repository', () async { /// arrange when(mockAuthRepository.register(registerParams)) .thenAnswer((_) async => Right(register)); /// act final result = await postRegister.call(registerParams); /// assert expect(result, equals(Right(register))); }); test('parse RegisterParams to json', () { /// act final result = registerParams.toJson(); final expected = { 'name': 'Mudassir', 'email': 'mudassir@lazycatlabs.com', 'password': 'pass123', }; /// assert expect(result, equals(expected)); }); test('parse RegisterParams from json', () { /// act final params = RegisterParams.fromJson({ 'name': 'Mudassir', 'email': 'mudassir@lazycatlabs.com', 'password': 'pass123', }); /// assert expect(params, equals(registerParams)); }); } ================================================ FILE: test/features/auth/pages/login/cubit/auth_cubit_test.dart ================================================ import 'dart:convert'; import 'package:bloc_test/bloc_test.dart'; import 'package:dartz/dartz.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; /// ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import '../../../../../helpers/fake_path_provider_platform.dart'; import '../../../../../helpers/json_reader.dart'; import '../../../../../helpers/paths.dart'; import 'auth_cubit_test.mocks.dart'; @GenerateMocks([PostLogin]) void main() { late AuthCubit authCubit; late Login login; late MockPostLogin mockPostLogin; const loginParams = LoginParams( email: 'mudassir@lazycatlabs.com', password: 'pass123', ); const errorMessage = 'Wrong username or password'; /// Initialize data setUp(() async { TestWidgetsFlutterBinding.ensureInitialized(); PathProviderPlatform.instance = FakePathProvider(); await serviceLocator(isUnitTest: true, prefixBox: 'auth_cubit_test_'); login = LoginResponse.fromJson( json.decode(jsonReader(pathLoginResponse200)) as Map, ).toEntity(); mockPostLogin = MockPostLogin(); authCubit = AuthCubit(mockPostLogin); }); /// Dispose bloc tearDown(() => authCubit.close()); /// Initial data should be loading test('Initial data should be AuthStatus.loading', () { expect(authCubit.state, const AuthState.loading()); }); blocTest( 'When repo success get data should be return AuthState', build: () { when(mockPostLogin.call(loginParams)) .thenAnswer((_) async => Right(login)); return authCubit; }, act: (cubit) => cubit.login(loginParams), wait: const Duration(milliseconds: 100), expect: () => [ const AuthState.loading(), AuthState.success(login.token), ], ); blocTest( 'When user input wrong credential should be return ServerFailure', build: () { when(mockPostLogin.call(loginParams)) .thenAnswer((_) async => const Left(ServerFailure(errorMessage))); return authCubit; }, act: (AuthCubit authCubit) => authCubit.login(loginParams), wait: const Duration(milliseconds: 100), expect: () => const [ AuthState.loading(), AuthState.failure(errorMessage), ], ); } ================================================ FILE: test/features/auth/pages/login/cubit/auth_cubit_test.mocks.dart ================================================ // Mocks generated by Mockito 5.4.6 from annotations // in flutter_auth_app/test/features/auth/pages/login/cubit/auth_cubit_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; import 'package:dartz/dartz.dart' as _i2; import 'package:flutter_auth_app/core/core.dart' as _i5; import 'package:flutter_auth_app/features/features.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references // ignore_for_file: deprecated_member_use // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class class _FakeEither_0 extends _i1.SmartFake implements _i2.Either { _FakeEither_0(Object parent, Invocation parentInvocation) : super(parent, parentInvocation); } /// A class which mocks [PostLogin]. /// /// See the documentation for Mockito's code generation for more information. class MockPostLogin extends _i1.Mock implements _i3.PostLogin { MockPostLogin() { _i1.throwOnMissingStub(this); } @override _i4.Future<_i2.Either<_i5.Failure, _i3.Login>> call( _i3.LoginParams? params, ) => (super.noSuchMethod( Invocation.method(#call, [params]), returnValue: _i4.Future<_i2.Either<_i5.Failure, _i3.Login>>.value( _FakeEither_0<_i5.Failure, _i3.Login>( this, Invocation.method(#call, [params]), ), ), ) as _i4.Future<_i2.Either<_i5.Failure, _i3.Login>>); } ================================================ FILE: test/features/auth/pages/login/cubit/auth_state_test.dart ================================================ import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { group('AuthStatusX', () { test('returns correct values for AuthStatus.loading', () { const status = AuthState.loading(); expect(status, const AuthState.loading()); }); test('returns correct values for AuthStatus.success', () { const status = AuthState.success(null); expect(status, const AuthState.success(null)); }); test('returns correct values for AuthStatus.failure', () { const status = AuthState.failure(''); expect(status, const AuthState.failure('')); }); }); } ================================================ FILE: test/features/auth/pages/login/login_page_test.dart ================================================ import 'dart:io'; import 'package:bloc_test/bloc_test.dart'; import 'package:flutter/material.dart'; import 'package:flutter_auth_app/core/core.dart'; import 'package:flutter_auth_app/dependencies_injection.dart'; import 'package:flutter_auth_app/features/features.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_test/flutter_test.dart'; // ignore: depend_on_referenced_packages import 'package:mocktail/mocktail.dart'; /// ignore: depend_on_referenced_packages import 'package:path_provider_platform_interface/path_provider_platform_interface.dart'; import '../../../../helpers/fake_path_provider_platform.dart'; import '../../../../helpers/test_mock.mocks.dart'; class MockAuthCubit extends MockCubit implements AuthCubit {} class FakeAuthCubit extends Fake implements AuthCubit {} class FakeReloadFormCubit extends Fake implements ReloadFormCubit {} class MockReloadFormCubit extends MockCubit implements ReloadFormCubit {} void main() { late AuthCubit authCubit; late ReloadFormCubit reloadFormCubit; setUpAll(() { HttpOverrides.global = null; registerFallbackValue(FakeAuthCubit()); registerFallbackValue(FakeReloadFormCubit()); registerFallbackValue(const LoginParams()); }); setUp(() async { TestWidgetsFlutterBinding.ensureInitialized(); PathProviderPlatform.instance = FakePathProvider(); await serviceLocator(isUnitTest: true, prefixBox: 'login_page_test_'); authCubit = MockAuthCubit(); reloadFormCubit = MockReloadFormCubit(); }); Widget rootWidget(Widget body, {bool isDarkTheme = false}) => MultiBlocProvider( providers: [ BlocProvider.value(value: authCubit), BlocProvider.value(value: reloadFormCubit), ], child: ScreenUtilInit( designSize: const Size(375, 667), minTextAdapt: true, splitScreenMode: true, builder: (_, _) => MaterialApp( localizationsDelegates: const [ Strings.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], locale: const Locale('en'), supportedLocales: L10n.all, theme: isDarkTheme ? themeDark(MockBuildContext()) : themeLight(MockBuildContext()), home: body, ), ), ); testWidgets('renders LoginPage for in Light and Dark Theme', (tester) async { when(() => authCubit.state).thenReturn(const AuthState.success(null)); when( () => reloadFormCubit.state, ).thenReturn(const ReloadFormState.initial()); await tester.pumpWidget(rootWidget(const LoginPage())); await tester.pumpAndSettle(); expect( find.byWidgetPredicate((widget) { if (widget is Image) { return widget.image == AssetImage(Images.icLauncher); } return false; }), findsOneWidget, ); /// change theme to dark await tester.pumpWidget(rootWidget(const LoginPage(), isDarkTheme: true)); await tester .pumpAndSettle(); // Verify that the dark theme image is displayed expect( find.byWidgetPredicate((widget) { if (widget is Image) { return widget.image == AssetImage(Images.icLauncherDark); } return false; }), findsOneWidget, ); /// the button should be disable expect(tester.widget