├── dart_test.yaml ├── ios ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── 16.png │ │ │ ├── 20.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ ├── 100.png │ │ │ ├── 1024.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ └── 512.png │ │ ├── AppIcon-dev.appiconset │ │ │ ├── 100.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 16.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 20.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 512.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ └── 1024.png │ │ ├── AppIcon-stg.appiconset │ │ │ ├── 100.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 128.png │ │ │ ├── 144.png │ │ │ ├── 152.png │ │ │ ├── 16.png │ │ │ ├── 167.png │ │ │ ├── 172.png │ │ │ ├── 180.png │ │ │ ├── 196.png │ │ │ ├── 20.png │ │ │ ├── 216.png │ │ │ ├── 256.png │ │ │ ├── 29.png │ │ │ ├── 32.png │ │ │ ├── 40.png │ │ │ ├── 48.png │ │ │ ├── 50.png │ │ │ ├── 512.png │ │ │ ├── 55.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 64.png │ │ │ ├── 72.png │ │ │ ├── 76.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ ├── 88.png │ │ │ └── 1024.png │ │ └── LaunchImage.imageset │ │ │ ├── LaunchImage@1x.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── production.xcscheme │ │ ├── staging.xcscheme │ │ ├── development.xcscheme │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── .gitignore └── Podfile ├── run_tests.sh ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ └── favicon.png └── manifest.json ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── values │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── xyz │ │ │ │ │ └── albertomontesdeoca │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── staging │ │ │ ├── ic_launcher-playstore.png │ │ │ └── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── values │ │ │ │ └── ic_launcher_background.xml │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ ├── development │ │ │ ├── ic_launcher-playstore.png │ │ │ └── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── values │ │ │ │ └── ic_launcher_background.xml │ │ │ │ └── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── CMakeLists.txt │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ └── win32_window.h ├── .gitignore ├── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugin_registrant.cc │ ├── generated_plugins.cmake │ └── CMakeLists.txt └── CMakeLists.txt ├── l10n.yaml ├── test ├── issues │ ├── presentation │ │ ├── detail │ │ │ ├── goldens │ │ │ │ ├── ci │ │ │ │ │ └── issue_chip_state_state.png │ │ │ │ └── macos │ │ │ │ │ └── issue_chip_state_state.png │ │ │ ├── issue_state_widget_test.dart │ │ │ ├── issue_title_widget_test.dart │ │ │ ├── issue_detail_navigate_button_test.dart │ │ │ └── issue_detail_page_test.dart │ │ └── list │ │ │ └── issues_list_page_test.dart │ └── domain │ │ ├── failures_test.dart │ │ ├── issues_navigation_test.dart │ │ ├── issue_test.dart │ │ └── issue_filter_test.dart ├── helpers │ ├── helpers.dart │ └── pump_app.dart ├── core │ ├── domain │ │ ├── failures_test.dart │ │ ├── graphq_failures_test.dart │ │ └── mm_response_test.dart │ └── infrastructure │ │ └── graphql_github_repository_test.dart ├── flutter_test_config.dart ├── settings │ ├── domain │ │ └── accessibility_settings_test.dart │ └── infrastructure │ │ └── accessibility_repository_test.dart └── app │ └── view │ └── app_test.dart ├── .github ├── dependabot.yaml ├── workflows │ └── main.yaml └── PULL_REQUEST_TEMPLATE.md ├── lib ├── issues │ ├── domain │ │ ├── models │ │ │ ├── failures.dart │ │ │ ├── issues_navigation.dart │ │ │ ├── issue.dart │ │ │ └── issue_filter.dart │ │ └── use_cases │ │ │ └── i_issues_repository.dart │ ├── application │ │ ├── filter │ │ │ ├── issues_filter_state.dart │ │ │ ├── issues_filter_event.dart │ │ │ └── issues_filter_bloc.dart │ │ └── list │ │ │ ├── issues_list_event.dart │ │ │ └── issues_list_state.dart │ ├── presentation │ │ ├── list │ │ │ ├── issues_list_page.dart │ │ │ └── widgets │ │ │ │ ├── issue_card_widget.dart │ │ │ │ └── issues_list_body.dart │ │ └── detail │ │ │ ├── issue_title_widget.dart │ │ │ ├── issue_state_widget.dart │ │ │ ├── issue_detail_navigate_button.dart │ │ │ ├── issue_detail_chip_state.dart │ │ │ └── issue_detail_page.dart │ └── infrastructure │ │ └── issues_repository.dart ├── app │ ├── app.dart │ └── view │ │ ├── app.dart │ │ └── app_theme.dart ├── core │ ├── domain │ │ ├── failures │ │ │ ├── graphql_failures.dart │ │ │ └── failures.dart │ │ ├── use_cases │ │ │ └── i_github_repository.dart │ │ └── models │ │ │ └── mm_reponse.dart │ └── infrastructure │ │ ├── app_graphql_client_module.dart │ │ └── graphql_github_repository.dart ├── injection │ ├── injection.dart │ └── injection.config.dart ├── settings │ ├── domain │ │ ├── usecases │ │ │ └── i_accessibility.dart │ │ └── models │ │ │ └── accessibility_settings.dart │ ├── application │ │ ├── settings_state.dart │ │ ├── settings_event.dart │ │ └── settings_bloc.dart │ ├── infrastructure │ │ └── accessibility_repository.dart │ └── presentation │ │ └── settings_dialog.dart ├── l10n │ ├── l10n.dart │ └── arb │ │ ├── app_en.arb │ │ └── app_es.arb ├── main_staging.dart ├── main_production.dart ├── main_development.dart ├── routes │ └── routes.dart └── bootstrap.dart ├── .vscode ├── extensions.json └── launch.json ├── .metadata ├── .idea └── runConfigurations │ ├── staging.xml │ ├── development.xml │ └── production.xml ├── run_coverge_tests.sh ├── pubspec.yaml ├── LICENSE ├── coverage_badge.svg ├── README.md └── .gitignore /dart_test.yaml: -------------------------------------------------------------------------------- 1 | tags: 2 | golden: -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /run_tests.sh: -------------------------------------------------------------------------------- 1 | very_good test -j 4 --optimization --coverage --test-randomize-ordering-seed random -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/web/icons/favicon.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /l10n.yaml: -------------------------------------------------------------------------------- 1 | arb-dir: lib/l10n/arb 2 | template-arb-file: app_en.arb 3 | output-localization-file: app_localizations.dart 4 | nullable-getter: false 5 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/staging/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png -------------------------------------------------------------------------------- /android/app/src/development/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/ic_launcher-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/88.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/100.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/114.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/120.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/128.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/144.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/152.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/16.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/167.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/172.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/172.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/180.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/196.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/20.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/216.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/256.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/29.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/32.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/40.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/48.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/50.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/55.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/57.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/58.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/60.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/72.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/76.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/80.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/87.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/88.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/88.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-dev.appiconset/1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/AppIcon-stg.appiconset/1024.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/development/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/staging/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/android/app/src/development/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /test/issues/presentation/detail/goldens/ci/issue_chip_state_state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/test/issues/presentation/detail/goldens/ci/issue_chip_state_state.png -------------------------------------------------------------------------------- /test/issues/presentation/detail/goldens/macos/issue_chip_state_state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamontes79/flutter_good_practices/HEAD/test/issues/presentation/detail/goldens/macos/issue_chip_state_state.png -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | - package-ecosystem: "pub" -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/xyz/albertomontesdeoca/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package xyz.albertomontesdeoca.flutter_good_practices 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /lib/issues/domain/models/failures.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_good_practices/core/domain/failures/failures.dart'; 2 | 3 | class IssuesFailure extends Failure { 4 | const IssuesFailure(); 5 | @override 6 | List get props => []; 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dart-code.dart-code", 6 | "dart-code.flutter", 7 | "felixangelov.bloc" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /lib/app/app.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | export 'view/app.dart'; 9 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip 7 | -------------------------------------------------------------------------------- /test/helpers/helpers.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | export 'pump_app.dart'; 9 | -------------------------------------------------------------------------------- /lib/core/domain/failures/graphql_failures.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_good_practices/core/domain/failures/failures.dart'; 2 | 3 | class GraphQLFailure extends Failure { 4 | const GraphQLFailure(this.message); 5 | final String message; 6 | @override 7 | List get props => [message]; 8 | } 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/core/domain/failures/failures.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | abstract class Failure extends Equatable { 4 | const Failure(); 5 | } 6 | 7 | class GenericFailure extends Failure { 8 | const GenericFailure(); 9 | 10 | @override 11 | List get props => []; 12 | } 13 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/staging/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/development/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9b2d32b605630f28625709ebd9d78ab3016b2bf6 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /lib/injection/injection.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_good_practices/injection/injection.config.dart'; 2 | import 'package:get_it/get_it.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | final GetIt getIt = GetIt.instance; 6 | 7 | @injectableInit 8 | void configureInjection(String environment) { 9 | $initGetIt(getIt, environment: environment); 10 | } 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/staging.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /lib/settings/domain/usecases/i_accessibility.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_good_practices/settings/domain/models/accessibility_settings.dart'; 3 | 4 | abstract class IAccessibility { 5 | Future isDarkTheme(); 6 | Future get(); 7 | Future save( 8 | AccessibilitySettings accessibilitySettings, 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/development.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/runConfigurations/production.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /run_coverge_tests.sh: -------------------------------------------------------------------------------- 1 | #fvm flutter format --set-exit-if-changed lib test 2 | #fvm flutter analyze lib test 3 | fvm flutter test --test-randomize-ordering-seed random --coverage 4 | fvm flutter pub run remove_from_coverage -f coverage/lcov.info -r '.freezed.dart$|.config.dart$|app_graphql_client_module.dart|\.g.dart$|routes.dart$|graphql_github_repository_test.dart|\test\b' 5 | genhtml coverage/lcov.info -o coverage/ -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/core/domain/use_cases/i_github_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_good_practices/core/domain/failures/graphql_failures.dart'; 3 | import 'package:flutter_good_practices/core/domain/models/mm_reponse.dart'; 4 | 5 | abstract class IGithubRepository { 6 | Future> performQuery( 7 | String query, { 8 | required Map variables, 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /lib/settings/application/settings_state.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | class SettingsState extends Equatable { 4 | const SettingsState({ 5 | required this.darkMode, 6 | }); 7 | 8 | final bool darkMode; 9 | 10 | @override 11 | List get props => [ 12 | darkMode, 13 | ]; 14 | 15 | SettingsState copyWith({ 16 | required bool darkMode, 17 | }) { 18 | return SettingsState( 19 | darkMode: darkMode, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/core/domain/failures_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/core/domain/failures/failures.dart'; 4 | 5 | void main() { 6 | test('Generic Failure is Equatable', () { 7 | const failure = GenericFailure(); 8 | expect( 9 | failure, 10 | isA(), 11 | ); 12 | expect( 13 | failure.props, 14 | [], 15 | ); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /test/issues/domain/failures_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/failures.dart'; 4 | 5 | void main() { 6 | test('IssuesFailure is Equatable', () { 7 | const failure = IssuesFailure(); 8 | expect( 9 | failure, 10 | isA(), 11 | ); 12 | expect( 13 | failure.props, 14 | [], 15 | ); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | // 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /lib/core/domain/models/mm_reponse.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class MMResponse extends Equatable { 4 | const MMResponse({ 5 | required this.correct, 6 | required this.response, 7 | this.errorMessage, 8 | }); 9 | 10 | final bool correct; 11 | final String? errorMessage; 12 | final Map response; 13 | 14 | @override 15 | List get props => [ 16 | correct, 17 | errorMessage, 18 | response, 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /lib/issues/application/filter/issues_filter_state.dart: -------------------------------------------------------------------------------- 1 | part of 'issues_filter_bloc.dart'; 2 | 3 | class IssuesFilterState extends Equatable { 4 | const IssuesFilterState({ 5 | required this.filter, 6 | }); 7 | 8 | final IssueFilter filter; 9 | 10 | IssuesFilterState copyWith({ 11 | required IssueFilter filter, 12 | }) { 13 | return IssuesFilterState( 14 | filter: filter, 15 | ); 16 | } 17 | 18 | @override 19 | List get props => [ 20 | filter, 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /lib/issues/domain/use_cases/i_issues_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_good_practices/core/domain/failures/failures.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue_filter.dart'; 4 | import 'package:flutter_good_practices/issues/domain/models/issues_navigation.dart'; 5 | 6 | enum OrderByDirection { asc, desc } 7 | 8 | abstract class IIssuesRepository { 9 | Future> get({ 10 | required IssueFilter filter, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /test/core/domain/graphq_failures_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/core/domain/failures/graphql_failures.dart'; 4 | 5 | void main() { 6 | test('GraphQLFailure is Equatable', () { 7 | const failure = GraphQLFailure('message'); 8 | expect( 9 | failure, 10 | isA(), 11 | ); 12 | expect( 13 | failure.props, 14 | [ 15 | 'message', 16 | ], 17 | ); 18 | }); 19 | } 20 | -------------------------------------------------------------------------------- /lib/settings/domain/models/accessibility_settings.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class AccessibilitySettings extends Equatable { 4 | const AccessibilitySettings({ 5 | this.darkMode = false, 6 | }); 7 | 8 | factory AccessibilitySettings.fromJson(Map json) { 9 | return AccessibilitySettings( 10 | darkMode: json['darkMode'] as bool, 11 | ); 12 | } 13 | 14 | final bool darkMode; 15 | 16 | @override 17 | List get props => [ 18 | darkMode, 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage@1x.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "filename" : "LaunchImage@2x.png", 10 | "idiom" : "universal", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "filename" : "LaunchImage@3x.png", 15 | "idiom" : "universal", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "author" : "xcode", 21 | "version" : 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/flutter_test_config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:alchemist/alchemist.dart'; 4 | 5 | //ignore_for_file: avoid_redundant_argument_values 6 | Future testExecutable(FutureOr Function() testMain) async { 7 | const isRunningInCi = bool.fromEnvironment('CI', defaultValue: true); 8 | 9 | return AlchemistConfig.runWithConfig( 10 | config: const AlchemistConfig( 11 | platformGoldensConfig: PlatformGoldensConfig( 12 | enabled: !isRunningInCi, 13 | ), 14 | ), 15 | run: testMain, 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/main.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_good_practices 2 | 3 | on: [pull_request, push] 4 | 5 | jobs: 6 | semantic-pull-request: 7 | uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 8 | 9 | build: 10 | uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 11 | with: 12 | coverage_excludes: "lib/core/infrastructure/app_graphql_client_module.dart lib/injection/injection.config.dart lib/routes/routes.dart" 13 | flutter_channel: stable 14 | flutter_version: 3.3.2 15 | -------------------------------------------------------------------------------- /lib/l10n/l10n.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter/widgets.dart'; 9 | import 'package:flutter_gen/gen_l10n/app_localizations.dart'; 10 | 11 | export 'package:flutter_gen/gen_l10n/app_localizations.dart'; 12 | 13 | extension AppLocalizationsX on BuildContext { 14 | AppLocalizations get l10n => AppLocalizations.of(this); 15 | } 16 | -------------------------------------------------------------------------------- /lib/issues/domain/models/issues_navigation.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 3 | 4 | class IssuesNavigation extends Equatable { 5 | const IssuesNavigation({ 6 | required this.issues, 7 | required this.hasNextPage, 8 | required this.endCursor, 9 | }); 10 | 11 | final List issues; 12 | final bool hasNextPage; 13 | final String endCursor; 14 | 15 | @override 16 | List get props => [ 17 | issues, 18 | hasNextPage, 19 | endCursor, 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void RegisterPlugins(flutter::PluginRegistry* registry) { 13 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 14 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 15 | UrlLauncherWindowsRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 17 | } 18 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /test/core/domain/mm_response_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_good_practices/core/domain/models/mm_reponse.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | void main() { 6 | test('MMResponse is Equatable', () { 7 | const response = MMResponse( 8 | correct: true, 9 | response: {'response': 'data'}, 10 | errorMessage: 'error', 11 | ); 12 | expect( 13 | response, 14 | isA(), 15 | ); 16 | expect( 17 | response.props, 18 | [ 19 | true, 20 | 'error', 21 | {'response': 'data'}, 22 | ], 23 | ); 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Flutter Good Practices", 3 | "short_name": "Flutter Good Practices", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Flutter Good Practices", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/settings/application/settings_event.dart: -------------------------------------------------------------------------------- 1 | part of 'settings_bloc.dart'; 2 | 3 | abstract class SettingsEvent extends Equatable { 4 | const SettingsEvent(); 5 | } 6 | 7 | class ChangeStyleEvent extends SettingsEvent { 8 | const ChangeStyleEvent({required this.darkMode}); 9 | final bool darkMode; 10 | @override 11 | List get props => [darkMode]; 12 | } 13 | 14 | class RequestAccessibilitySettings extends SettingsEvent { 15 | const RequestAccessibilitySettings(); 16 | @override 17 | List get props => []; 18 | } 19 | 20 | class SaveAccessibilitySettings extends SettingsEvent { 21 | const SaveAccessibilitySettings(); 22 | @override 23 | List get props => []; 24 | } 25 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /lib/core/infrastructure/app_graphql_client_module.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_flavor/flutter_flavor.dart'; 2 | import 'package:graphql_flutter/graphql_flutter.dart'; 3 | import 'package:injectable/injectable.dart'; 4 | 5 | @module 6 | abstract class AppGraphQLClientModule { 7 | @lazySingleton 8 | GraphQLClient get graphQLClient { 9 | final token = FlavorConfig.instance.variables['github_token'] as String; 10 | final link = HttpLink( 11 | 'https://api.github.com/graphql', 12 | defaultHeaders: { 13 | 'Authorization': 'bearer $token', 14 | }, 15 | ); 16 | return GraphQLClient( 17 | link: link, 18 | cache: GraphQLCache( 19 | store: InMemoryStore(), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | ## Description 10 | 11 | 12 | 13 | ## Type of Change 14 | 15 | 16 | 17 | - [ ] ✨ New feature (non-breaking change which adds functionality) 18 | - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) 19 | - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) 20 | - [ ] 🧹 Code refactor 21 | - [ ] ✅ Build configuration change 22 | - [ ] 📝 Documentation 23 | - [ ] 🗑️ Chore 24 | -------------------------------------------------------------------------------- /lib/issues/presentation/list/issues_list_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_good_practices/injection/injection.dart'; 4 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 5 | import 'package:flutter_good_practices/issues/presentation/list/widgets/issues_list_view.dart'; 6 | 7 | class IssuesListPage extends StatelessWidget { 8 | const IssuesListPage({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return BlocProvider( 13 | create: (context) => getIt() 14 | ..add( 15 | const LoadIssues(), 16 | ), 17 | child: const IssuesListView(), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/main_staging.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter_flavor/flutter_flavor.dart'; 9 | import 'package:injectable/injectable.dart'; 10 | import 'package:flutter_good_practices/app/app.dart'; 11 | import 'package:flutter_good_practices/bootstrap.dart'; 12 | import 'package:flutter_good_practices/injection/injection.dart'; 13 | 14 | void main() { 15 | configureInjection(Environment.prod); 16 | FlavorConfig( 17 | name: 'STAGING', 18 | variables: { 19 | 'github_token': '', 20 | }, 21 | ); 22 | bootstrap(() => const App()); 23 | } 24 | -------------------------------------------------------------------------------- /lib/main_production.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter_flavor/flutter_flavor.dart'; 9 | import 'package:injectable/injectable.dart'; 10 | import 'package:flutter_good_practices/app/app.dart'; 11 | import 'package:flutter_good_practices/bootstrap.dart'; 12 | import 'package:flutter_good_practices/injection/injection.dart'; 13 | 14 | void main() { 15 | configureInjection(Environment.prod); 16 | FlavorConfig( 17 | name: 'PRODUCTION', 18 | variables: { 19 | 'github_token': '', 20 | }, 21 | ); 22 | bootstrap(() => const App()); 23 | } 24 | -------------------------------------------------------------------------------- /test/settings/domain/accessibility_settings_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_good_practices/settings/domain/models/accessibility_settings.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test('AccessibilitySettings is Equatable', () { 6 | const accessibility = AccessibilitySettings(); 7 | expect( 8 | accessibility.props, 9 | [ 10 | accessibility.darkMode, 11 | ], 12 | ); 13 | }); 14 | 15 | test('AccessibilitySettings fromJson', () { 16 | const expected = AccessibilitySettings( 17 | darkMode: true, 18 | ); 19 | final json = { 20 | 'darkMode': true, 21 | }; 22 | final actual = AccessibilitySettings.fromJson(json); 23 | expect( 24 | actual, 25 | expected, 26 | ); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /lib/main_development.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter_flavor/flutter_flavor.dart'; 9 | import 'package:injectable/injectable.dart'; 10 | import 'package:flutter_good_practices/app/app.dart'; 11 | import 'package:flutter_good_practices/bootstrap.dart'; 12 | import 'package:flutter_good_practices/injection/injection.dart'; 13 | 14 | void main() { 15 | configureInjection(Environment.dev); 16 | FlavorConfig( 17 | name: 'DEVELOPMENT', 18 | variables: { 19 | 'github_token': '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', 20 | }, 21 | ); 22 | bootstrap(() => const App()); 23 | } 24 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | connectivity_plus_windows 7 | url_launcher_windows 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /lib/issues/application/list/issues_list_event.dart: -------------------------------------------------------------------------------- 1 | part of 'issues_list_bloc.dart'; 2 | 3 | abstract class IssuesListEvent extends Equatable { 4 | const IssuesListEvent(); 5 | } 6 | 7 | class LoadIssues extends IssuesListEvent { 8 | const LoadIssues(); 9 | 10 | @override 11 | List get props => []; 12 | } 13 | 14 | class LoadNextPageIssues extends IssuesListEvent { 15 | const LoadNextPageIssues(); 16 | 17 | @override 18 | List get props => []; 19 | } 20 | 21 | class MarkIssueAsVisited extends IssuesListEvent { 22 | const MarkIssueAsVisited({required this.issue}); 23 | final Issue issue; 24 | @override 25 | List get props => [ 26 | issue, 27 | ]; 28 | } 29 | 30 | class UpdateFilter extends IssuesListEvent { 31 | const UpdateFilter({required this.filter}); 32 | final IssueFilter filter; 33 | @override 34 | List get props => [ 35 | filter, 36 | ]; 37 | } 38 | -------------------------------------------------------------------------------- /lib/l10n/arb/app_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "@@locale": "en", 3 | 4 | "appBarTitle": "Challenge", 5 | 6 | "errorLoading": "An error has occurred", 7 | 8 | "emptyList": "No issues found with selected filters", 9 | 10 | "menuSettings" : "Settings", 11 | "menuOrderBy" : "Order Issues", 12 | "menuFilter" : "Filter Issues", 13 | 14 | "settingsText": "Settings", 15 | "settingsShortCuts": "Use keyboard", 16 | "settingsVoiceCommand": "Voice commands", 17 | "settingsDarkMode": "Dark mode", 18 | 19 | "issueDetailAppBarTitle": "Issue:", 20 | "issueTitle": "Title", 21 | "issueStatus": "Status", 22 | "issueNavigate": "See in GitHub", 23 | 24 | "oderByDialogTitle": "Order Issues", 25 | "createdAt": "Created At", 26 | "ascending_mode": "Ascending", 27 | "descending_mode": "Descending", 28 | 29 | "filterDialogTitle": "Filter Issues", 30 | "filter_by_open": "Open", 31 | "filter_by_closed": "Closed" 32 | } -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/issues/domain/issues_navigation_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 4 | import 'package:flutter_good_practices/issues/domain/models/issues_navigation.dart'; 5 | 6 | void main() { 7 | test('IssuesNavigation is Equatable', () { 8 | const issue = Issue( 9 | id: 'id', 10 | title: 'title', 11 | number: 1, 12 | state: 'state', 13 | url: 'url', 14 | ); 15 | const issuesNavigation = IssuesNavigation( 16 | issues: [ 17 | issue, 18 | ], 19 | hasNextPage: true, 20 | endCursor: '123456789', 21 | ); 22 | expect( 23 | issuesNavigation, 24 | isA(), 25 | ); 26 | expect( 27 | issuesNavigation.props, 28 | [ 29 | [ 30 | issue, 31 | ], 32 | true, 33 | '123456789', 34 | ], 35 | ); 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /lib/l10n/arb/app_es.arb: -------------------------------------------------------------------------------- 1 | { 2 | "@@locale": "es", 3 | 4 | "appBarTitle": "Challenge", 5 | 6 | "errorLoading": "Se ha producido un error", 7 | 8 | "emptyList": "No se han encontrado issues con los filtros seleccionados", 9 | 10 | "menuSettings" : "Configuración", 11 | "menuOrderBy" : "Ordenar Issues", 12 | "menuFilter" : "Filtrar Issues", 13 | 14 | "settingsText": "Configuración", 15 | "settingsShortCuts": "Usar teclado", 16 | "settingsVoiceCommand": "Comandos de voz", 17 | "settingsDarkMode": "Modo oscuro", 18 | 19 | "issueDetailAppBarTitle": "Issue:", 20 | "issueTitle": "Title", 21 | "issueStatus": "Status", 22 | "issueNavigate": "Ver en GitHub", 23 | 24 | "oderByDialogTitle": "Ordenar Issues", 25 | "createdAt": "Fecha de creación", 26 | "ascending_mode": "Ascendente", 27 | "descending_mode": "Descendente", 28 | 29 | "filterDialogTitle": "Filtrar Issues", 30 | "filter_by_open": "Open", 31 | "filter_by_closed": "Closed" 32 | 33 | } -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_good_practices 2 | description: Flutter Good Practices 3 | version: 1.0.0+1 4 | publish_to: none 5 | 6 | environment: 7 | sdk: ">=2.18.0 <3.0.0" 8 | flutter: 3.3.1 9 | 10 | dependencies: 11 | bloc: ^8.1.0 12 | dartz: ^0.10.1 13 | equatable: ^2.0.5 14 | flutter: 15 | sdk: flutter 16 | flutter_bloc: ^8.1.1 17 | flutter_flavor: ^3.1.1 18 | flutter_localizations: 19 | sdk: flutter 20 | gap: ^2.0.0 21 | get_it: ^7.2.0 22 | graphql_flutter: ^5.1.0 23 | http: ^0.13.5 24 | injectable: ^1.5.3 25 | intl: ^0.17.0 26 | shared_preferences: ^2.0.15 27 | url_launcher: ^6.1.5 28 | 29 | dev_dependencies: 30 | alchemist: ^0.5.0 31 | bloc_test: ^9.1.0 32 | build_runner: ^2.2.1 33 | flutter_test: 34 | sdk: flutter 35 | golden_toolkit: ^0.13.0 36 | injectable_generator: ^1.5.4 37 | mockingjay: ^0.3.0 38 | mocktail: ^0.3.0 39 | remove_from_coverage: ^2.0.0 40 | very_good_analysis: ^3.0.2 41 | 42 | flutter: 43 | uses-material-design: true 44 | generate: true 45 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch development", 9 | "request": "launch", 10 | "type": "dart", 11 | "program": "lib/main_development.dart", 12 | "args": [ 13 | "--flavor", 14 | "development", 15 | "--target", 16 | "lib/main_development.dart" 17 | ] 18 | }, 19 | { 20 | "name": "Launch staging", 21 | "request": "launch", 22 | "type": "dart", 23 | "program": "lib/main_staging.dart", 24 | "args": ["--flavor", "staging", "--target", "lib/main_staging.dart"] 25 | }, 26 | { 27 | "name": "Launch production", 28 | "request": "launch", 29 | "type": "dart", 30 | "program": "lib/main_production.dart", 31 | "args": ["--flavor", "production", "--target", "lib/main_production.dart"] 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /lib/issues/application/list/issues_list_state.dart: -------------------------------------------------------------------------------- 1 | part of 'issues_list_bloc.dart'; 2 | 3 | enum IssuesListStatus { 4 | initial, 5 | loading, 6 | loaded, 7 | updatingList, 8 | error, 9 | } 10 | 11 | class IssuesListState extends Equatable { 12 | const IssuesListState({ 13 | required this.status, 14 | required this.issues, 15 | required this.hasNextPage, 16 | required this.filter, 17 | }); 18 | final IssuesListStatus status; 19 | final List issues; 20 | final bool hasNextPage; 21 | final IssueFilter filter; 22 | 23 | IssuesListState copyWith({ 24 | IssuesListStatus? status, 25 | List? issues, 26 | bool? hasNextPage, 27 | IssueFilter? filter, 28 | }) { 29 | return IssuesListState( 30 | status: status ?? this.status, 31 | issues: issues ?? this.issues, 32 | hasNextPage: hasNextPage ?? this.hasNextPage, 33 | filter: filter ?? this.filter, 34 | ); 35 | } 36 | 37 | @override 38 | List get props => [ 39 | status, 40 | issues, 41 | hasNextPage, 42 | filter, 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Very Good Ventures 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /lib/issues/presentation/detail/issue_title_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gap/gap.dart'; 3 | import 'package:flutter_good_practices/l10n/l10n.dart'; 4 | 5 | class IssueTitle extends StatelessWidget { 6 | const IssueTitle({super.key, required this.title}); 7 | final String title; 8 | @override 9 | Widget build(BuildContext context) { 10 | final l10n = context.l10n; 11 | return Column( 12 | crossAxisAlignment: CrossAxisAlignment.start, 13 | children: [ 14 | Text( 15 | l10n.issueTitle, 16 | key: const Key('issue_detail_title_label'), 17 | style: Theme.of(context).textTheme.caption?.copyWith( 18 | fontSize: 24, 19 | fontWeight: FontWeight.w700, 20 | ), 21 | ), 22 | const Gap(10), 23 | Text( 24 | title, 25 | key: const Key('issue_detail_title_view'), 26 | textAlign: TextAlign.left, 27 | style: Theme.of(context).textTheme.caption?.copyWith( 28 | fontSize: 18, 29 | ), 30 | ), 31 | ], 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /coverage_badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | coverage 16 | coverage 17 | 100% 18 | 100% 19 | 20 | -------------------------------------------------------------------------------- /lib/issues/application/filter/issues_filter_event.dart: -------------------------------------------------------------------------------- 1 | part of 'issues_filter_bloc.dart'; 2 | 3 | abstract class IssuesFilterEvent extends Equatable { 4 | const IssuesFilterEvent(); 5 | } 6 | 7 | class InitFilter extends IssuesFilterEvent { 8 | const InitFilter({required this.filter}); 9 | final IssueFilter filter; 10 | @override 11 | List get props => [ 12 | filter, 13 | ]; 14 | } 15 | 16 | class ChangeOrderByMode extends IssuesFilterEvent { 17 | const ChangeOrderByMode({required this.ascending}); 18 | final bool ascending; 19 | @override 20 | List get props => [ 21 | ascending, 22 | ]; 23 | } 24 | 25 | class ChangeFilterByOpen extends IssuesFilterEvent { 26 | const ChangeFilterByOpen({required this.filterByOpen}); 27 | final bool filterByOpen; 28 | @override 29 | List get props => [ 30 | filterByOpen, 31 | ]; 32 | } 33 | 34 | class ChangeFilterByClosed extends IssuesFilterEvent { 35 | const ChangeFilterByClosed({required this.filterByClosed}); 36 | final bool filterByClosed; 37 | @override 38 | List get props => [ 39 | filterByClosed, 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /lib/issues/domain/models/issue.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class Issue extends Equatable { 4 | const Issue({ 5 | required this.id, 6 | required this.title, 7 | required this.number, 8 | required this.state, 9 | required this.url, 10 | this.visited = false, 11 | }); 12 | 13 | factory Issue.fromJSON(Map json) => Issue( 14 | id: json['id'] as String, 15 | title: json['title'] as String, 16 | number: json['number'] as int, 17 | state: json['state'] as String, 18 | url: json['url'] as String, 19 | ); 20 | 21 | Issue copyWith({required bool visited}) { 22 | return Issue( 23 | id: id, 24 | title: title, 25 | number: number, 26 | state: state, 27 | url: url, 28 | visited: visited, 29 | ); 30 | } 31 | 32 | final String id; 33 | final String title; 34 | final int number; 35 | final String state; 36 | final String url; 37 | final bool visited; 38 | 39 | @override 40 | List get props => [ 41 | id, 42 | title, 43 | number, 44 | state, 45 | url, 46 | visited, 47 | ]; 48 | } 49 | -------------------------------------------------------------------------------- /lib/issues/presentation/detail/issue_state_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gap/gap.dart'; 3 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_chip_state.dart'; 4 | import 'package:flutter_good_practices/l10n/l10n.dart'; 5 | 6 | class IssueState extends StatelessWidget { 7 | const IssueState({super.key, required this.state}); 8 | final String state; 9 | @override 10 | Widget build(BuildContext context) { 11 | final l10n = context.l10n; 12 | return Column( 13 | crossAxisAlignment: CrossAxisAlignment.start, 14 | children: [ 15 | Text( 16 | l10n.issueStatus, 17 | key: const Key('issue_detail_state_label'), 18 | style: Theme.of(context).textTheme.caption?.copyWith( 19 | fontSize: 24, 20 | fontWeight: FontWeight.w700, 21 | ), 22 | ), 23 | const Gap(10), 24 | Padding( 25 | padding: const EdgeInsets.only(left: 5), 26 | child: ChipState( 27 | key: const Key('issue_detail_chip_state'), 28 | state: state, 29 | ), 30 | ) 31 | ], 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/routes/routes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 3 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_page.dart'; 4 | import 'package:flutter_good_practices/issues/presentation/list/issues_list_page.dart'; 5 | 6 | class RouteGenerator { 7 | static const String issuesListPage = 'issues_list'; 8 | static const String issueDetailPage = 'issue_detail'; 9 | 10 | static Route> generateRoute( 11 | RouteSettings settings, 12 | ) { 13 | switch (settings.name) { 14 | case issuesListPage: 15 | return MaterialPageRoute( 16 | builder: (_) => const IssuesListPage( 17 | key: Key('issues_list_page'), 18 | ), 19 | ); 20 | case issueDetailPage: 21 | final arguments = settings.arguments!; 22 | return MaterialPageRoute( 23 | builder: (_) => IssueDetailPage( 24 | key: const Key('issue_detail_page'), 25 | issue: arguments as Issue, 26 | ), 27 | ); 28 | 29 | default: 30 | throw const FormatException('Route not found'); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/issues/presentation/detail/issue_detail_navigate_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_good_practices/l10n/l10n.dart'; 3 | import 'package:url_launcher/url_launcher.dart'; 4 | 5 | class IssueNavigateButton extends StatelessWidget { 6 | const IssueNavigateButton({super.key, required this.url}); 7 | final String url; 8 | @override 9 | Widget build(BuildContext context) { 10 | final l10n = context.l10n; 11 | return Row( 12 | children: [ 13 | Expanded( 14 | child: ElevatedButton( 15 | key: const Key('url_navigator'), 16 | onPressed: _launchUrl, 17 | style: ElevatedButton.styleFrom( 18 | backgroundColor: Colors.black, 19 | textStyle: const TextStyle( 20 | fontSize: 14, 21 | fontWeight: FontWeight.w700, 22 | ), 23 | ), 24 | child: Text( 25 | l10n.issueNavigate, 26 | key: const Key('url_navigator_text'), 27 | ), 28 | ), 29 | ), 30 | ], 31 | ); 32 | } 33 | 34 | Future _launchUrl() async { 35 | final uri = Uri.parse(url); 36 | await launchUrl(uri); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/settings/infrastructure/accessibility_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:flutter_good_practices/settings/domain/models/accessibility_settings.dart'; 4 | import 'package:flutter_good_practices/settings/domain/usecases/i_accessibility.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | 7 | @LazySingleton( 8 | as: IAccessibility, 9 | ) 10 | class AccessibilityRepository implements IAccessibility { 11 | AccessibilityRepository(); 12 | 13 | @override 14 | Future get() async { 15 | final prefs = await SharedPreferences.getInstance(); 16 | final darkMode = prefs.getBool('dark_mode') ?? false; 17 | 18 | return AccessibilitySettings(darkMode: darkMode); 19 | } 20 | 21 | @override 22 | Future save( 23 | AccessibilitySettings accessibilitySettings, 24 | ) async { 25 | final prefs = await SharedPreferences.getInstance(); 26 | await prefs.setBool('dark_mode', accessibilitySettings.darkMode); 27 | 28 | return unit; 29 | } 30 | 31 | @override 32 | Future isDarkTheme() async { 33 | final prefs = await SharedPreferences.getInstance(); 34 | return prefs.getBool('dark_mode') ?? false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/issues/domain/issue_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 4 | 5 | void main() { 6 | test('Issue is Equatable', () { 7 | const issue = Issue( 8 | id: 'id', 9 | title: 'title', 10 | number: 1, 11 | state: 'state', 12 | url: 'url', 13 | visited: true, 14 | ); 15 | expect( 16 | issue, 17 | isA(), 18 | ); 19 | expect( 20 | issue.props, 21 | [ 22 | 'id', 23 | 'title', 24 | 1, 25 | 'state', 26 | 'url', 27 | true, 28 | ], 29 | ); 30 | }); 31 | test( 32 | 'Issue fromJSON returns correct object', 33 | () { 34 | const issue = Issue( 35 | id: 'id', 36 | title: 'title', 37 | number: 1, 38 | state: 'state', 39 | url: 'url', 40 | ); 41 | expect( 42 | Issue.fromJSON( 43 | const { 44 | 'id': 'id', 45 | 'title': 'title', 46 | 'number': 1, 47 | 'state': 'state', 48 | 'url': 'url', 49 | }, 50 | ), 51 | issue, 52 | ); 53 | }, 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /lib/bootstrap.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'dart:async'; 9 | import 'dart:developer'; 10 | 11 | import 'package:bloc/bloc.dart'; 12 | import 'package:flutter/widgets.dart'; 13 | 14 | class AppBlocObserver extends BlocObserver { 15 | @override 16 | void onChange(BlocBase bloc, Change change) { 17 | super.onChange(bloc, change); 18 | log('onChange(${bloc.runtimeType}, $change)'); 19 | } 20 | 21 | @override 22 | void onError(BlocBase bloc, Object error, StackTrace stackTrace) { 23 | log('onError(${bloc.runtimeType}, $error, $stackTrace)'); 24 | super.onError(bloc, error, stackTrace); 25 | } 26 | } 27 | 28 | Future bootstrap(FutureOr Function() builder) async { 29 | FlutterError.onError = (details) { 30 | log(details.exceptionAsString(), stackTrace: details.stack); 31 | }; 32 | 33 | Bloc.observer = AppBlocObserver(); 34 | 35 | await runZonedGuarded( 36 | () async => runApp(await builder()), 37 | (error, stackTrace) => log(error.toString(), stackTrace: stackTrace), 38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /lib/issues/presentation/detail/issue_detail_chip_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ChipState extends StatelessWidget { 4 | const ChipState({ 5 | super.key, 6 | required this.state, 7 | }); 8 | 9 | final String state; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return DecoratedBox( 14 | decoration: BoxDecoration( 15 | border: Border.all( 16 | color: _stateColor(), 17 | ), 18 | borderRadius: const BorderRadius.all( 19 | Radius.circular(15), 20 | ), 21 | ), 22 | child: Padding( 23 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), 24 | child: Text( 25 | state, 26 | key: const Key('issue_detail_state_text'), 27 | style: Theme.of(context).textTheme.bodyText1?.copyWith( 28 | fontWeight: FontWeight.w400, 29 | color: _stateColor(), 30 | ), 31 | ), 32 | ), 33 | ); 34 | } 35 | 36 | MaterialColor _stateColor() { 37 | switch (state.toLowerCase()) { 38 | case 'open': 39 | return Colors.green; 40 | case 'closed': 41 | return Colors.red; 42 | default: 43 | return Colors.grey; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"Flutter Good Practices", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /test/app/view/app_test.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:bloc_test/bloc_test.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_flavor/flutter_flavor.dart'; 11 | import 'package:flutter_test/flutter_test.dart'; 12 | import 'package:injectable/injectable.dart'; 13 | import 'package:flutter_good_practices/app/app.dart'; 14 | import 'package:flutter_good_practices/injection/injection.dart'; 15 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 16 | import 'package:flutter_good_practices/issues/presentation/list/issues_list_page.dart'; 17 | 18 | class MockIssuesListBloc extends MockBloc 19 | implements IssuesListBloc {} 20 | 21 | void main() { 22 | setUpAll(() { 23 | configureInjection(Environment.test); 24 | WidgetController.hitTestWarningShouldBeFatal = true; 25 | WidgetsFlutterBinding.ensureInitialized(); 26 | }); 27 | tearDown(getIt.reset); 28 | setUp(() { 29 | FlavorConfig( 30 | name: 'TESTS', 31 | variables: { 32 | 'github_token': '', 33 | }, 34 | ); 35 | }); 36 | 37 | group('App', () { 38 | testWidgets('renders IssuesListPage', (tester) async { 39 | await tester.pumpWidget( 40 | const App(), 41 | ); 42 | expect(find.byType(IssuesListPage), findsOneWidget); 43 | }); 44 | }); 45 | } 46 | -------------------------------------------------------------------------------- /lib/issues/presentation/detail/issue_detail_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:gap/gap.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 4 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_navigate_button.dart'; 5 | import 'package:flutter_good_practices/issues/presentation/detail/issue_state_widget.dart'; 6 | import 'package:flutter_good_practices/issues/presentation/detail/issue_title_widget.dart'; 7 | import 'package:flutter_good_practices/l10n/l10n.dart'; 8 | 9 | class IssueDetailPage extends StatelessWidget { 10 | const IssueDetailPage({super.key, required this.issue}); 11 | final Issue issue; 12 | @override 13 | Widget build(BuildContext context) { 14 | final l10n = context.l10n; 15 | return Scaffold( 16 | appBar: AppBar( 17 | title: Text('${l10n.issueDetailAppBarTitle} ${issue.number}'), 18 | ), 19 | body: Padding( 20 | padding: const EdgeInsets.all(8), 21 | child: Column( 22 | crossAxisAlignment: CrossAxisAlignment.start, 23 | children: [ 24 | IssueTitle( 25 | key: const Key('issue_detail_title'), 26 | title: issue.title, 27 | ), 28 | const Gap(10), 29 | IssueState( 30 | key: const Key('issue_detail_state'), 31 | state: issue.state, 32 | ), 33 | const Gap(10), 34 | IssueNavigateButton( 35 | key: const Key('issue_detail_navigate'), 36 | url: issue.url, 37 | ), 38 | ], 39 | ), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/core/infrastructure/graphql_github_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:graphql/client.dart'; 3 | import 'package:graphql_flutter/graphql_flutter.dart'; 4 | import 'package:injectable/injectable.dart'; 5 | import 'package:flutter_good_practices/core/domain/failures/graphql_failures.dart'; 6 | import 'package:flutter_good_practices/core/domain/models/mm_reponse.dart'; 7 | import 'package:flutter_good_practices/core/domain/use_cases/i_github_repository.dart'; 8 | 9 | @LazySingleton( 10 | as: IGithubRepository, 11 | env: [ 12 | Environment.dev, 13 | Environment.prod, 14 | ], 15 | ) 16 | class GraphQLGithubRepository implements IGithubRepository { 17 | GraphQLGithubRepository(this.graphQLClient); 18 | 19 | final GraphQLClient graphQLClient; 20 | 21 | @override 22 | Future> performQuery( 23 | String query, { 24 | required Map variables, 25 | }) async { 26 | try { 27 | final options = QueryOptions( 28 | document: gql(query), 29 | variables: variables, 30 | ); 31 | 32 | final result = await graphQLClient.query(options); 33 | 34 | if (result.hasException) { 35 | return left( 36 | GraphQLFailure( 37 | result.exception.toString(), 38 | ), 39 | ); 40 | } else { 41 | return right( 42 | MMResponse( 43 | correct: true, 44 | response: result.data ?? {}, 45 | ), 46 | ); 47 | } 48 | } on Exception catch (_, e) { 49 | return left( 50 | GraphQLFailure( 51 | e.toString(), 52 | ), 53 | ); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/issues/presentation/detail/issue_state_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_chip_state.dart'; 4 | import 'package:flutter_good_practices/issues/presentation/detail/issue_state_widget.dart'; 5 | 6 | import '../../../helpers/helpers.dart'; 7 | 8 | void main() { 9 | const labelKey = Key('issue_detail_state_label'); 10 | const chipKey = Key('issue_detail_chip_state'); 11 | 12 | group('render', () { 13 | testWidgets('IssueState has correct title', (tester) async { 14 | await tester.pumpApp( 15 | const Material( 16 | child: IssueState( 17 | state: 'OPEN', 18 | ), 19 | ), 20 | ); 21 | final widgetFinder = find.byKey(labelKey); 22 | expect( 23 | widgetFinder, 24 | findsOneWidget, 25 | ); 26 | final widgetTesting = tester.widget(widgetFinder); 27 | expect( 28 | widgetTesting, 29 | isA(), 30 | ); 31 | expect( 32 | (widgetTesting as Text).data, 33 | 'Status', 34 | ); 35 | }); 36 | testWidgets('IssueState has correct component', (tester) async { 37 | await tester.pumpApp( 38 | const Material( 39 | child: IssueState( 40 | state: 'OPEN', 41 | ), 42 | ), 43 | ); 44 | final widgetFinder = find.byKey(chipKey); 45 | expect( 46 | widgetFinder, 47 | findsOneWidget, 48 | ); 49 | final widgetTesting = tester.widget(widgetFinder); 50 | expect( 51 | widgetTesting, 52 | isA(), 53 | ); 54 | }); 55 | }); 56 | } 57 | -------------------------------------------------------------------------------- /test/issues/presentation/detail/issue_title_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_good_practices/issues/presentation/detail/issue_title_widget.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | 5 | import '../../../helpers/helpers.dart'; 6 | 7 | void main() { 8 | const labelKey = Key('issue_detail_title_label'); 9 | const valueKey = Key('issue_detail_title_view'); 10 | 11 | group('render', () { 12 | testWidgets('IssueTitle has correct title', (tester) async { 13 | await tester.pumpApp( 14 | const Material( 15 | child: IssueTitle( 16 | title: 'issue title', 17 | ), 18 | ), 19 | ); 20 | final widgetFinder = find.byKey(labelKey); 21 | expect( 22 | widgetFinder, 23 | findsOneWidget, 24 | ); 25 | final widgetTesting = tester.widget(widgetFinder); 26 | expect( 27 | widgetTesting, 28 | isA(), 29 | ); 30 | expect( 31 | (widgetTesting as Text).data, 32 | 'Title', 33 | ); 34 | }); 35 | testWidgets('IssueTitle has correct value', (tester) async { 36 | await tester.pumpApp( 37 | const Material( 38 | child: IssueTitle( 39 | title: 'issue title', 40 | ), 41 | ), 42 | ); 43 | final widgetFinder = find.byKey(valueKey); 44 | expect( 45 | widgetFinder, 46 | findsOneWidget, 47 | ); 48 | final widgetTesting = tester.widget(widgetFinder); 49 | expect( 50 | widgetTesting, 51 | isA(), 52 | ); 53 | expect( 54 | (widgetTesting as Text).data, 55 | 'issue title', 56 | ); 57 | }); 58 | }); 59 | } 60 | -------------------------------------------------------------------------------- /lib/app/view/app.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_bloc/flutter_bloc.dart'; 10 | import 'package:flutter_localizations/flutter_localizations.dart'; 11 | import 'package:flutter_good_practices/app/view/app_theme.dart'; 12 | import 'package:flutter_good_practices/injection/injection.dart'; 13 | import 'package:flutter_good_practices/l10n/l10n.dart'; 14 | import 'package:flutter_good_practices/routes/routes.dart'; 15 | import 'package:flutter_good_practices/settings/application/settings_bloc.dart'; 16 | 17 | class App extends StatelessWidget { 18 | const App({super.key}); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return BlocProvider( 23 | create: (_) => getIt() 24 | ..add( 25 | const RequestAccessibilitySettings(), 26 | ), 27 | child: BlocBuilder( 28 | builder: (context, state) { 29 | return MaterialApp( 30 | theme: AppTheme().lightTheme(), 31 | darkTheme: AppTheme().darkTheme(), 32 | themeMode: state.darkMode ? ThemeMode.dark : ThemeMode.light, 33 | debugShowCheckedModeBanner: false, 34 | localizationsDelegates: const [ 35 | AppLocalizations.delegate, 36 | GlobalMaterialLocalizations.delegate, 37 | GlobalCupertinoLocalizations.delegate 38 | ], 39 | supportedLocales: AppLocalizations.supportedLocales, 40 | initialRoute: RouteGenerator.issuesListPage, 41 | onGenerateRoute: RouteGenerator.generateRoute, 42 | ); 43 | }, 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /lib/settings/application/settings_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | import 'package:flutter_good_practices/settings/domain/models/accessibility_settings.dart'; 7 | import 'package:flutter_good_practices/settings/domain/usecases/i_accessibility.dart'; 8 | 9 | part 'settings_event.dart'; 10 | part 'settings_state.dart'; 11 | 12 | @injectable 13 | class SettingsBloc extends Bloc { 14 | SettingsBloc(this._accessibility) 15 | : super( 16 | const SettingsState( 17 | darkMode: false, 18 | ), 19 | ) { 20 | on(_onChangeStyleEvent); 21 | on(_onRequestAccessibilitySettings); 22 | on(_onSaveAccessibilitySettings); 23 | } 24 | final IAccessibility _accessibility; 25 | 26 | Future> _onChangeStyleEvent( 27 | ChangeStyleEvent event, 28 | Emitter emit, 29 | ) async { 30 | await _accessibility.save( 31 | AccessibilitySettings( 32 | darkMode: event.darkMode, 33 | ), 34 | ); 35 | 36 | emit( 37 | state.copyWith(darkMode: event.darkMode), 38 | ); 39 | } 40 | 41 | Future _onRequestAccessibilitySettings( 42 | RequestAccessibilitySettings event, 43 | Emitter emit, 44 | ) async { 45 | final accessibility = await _accessibility.get(); 46 | emit( 47 | state.copyWith( 48 | darkMode: accessibility.darkMode, 49 | ), 50 | ); 51 | } 52 | 53 | Future> _onSaveAccessibilitySettings( 54 | SaveAccessibilitySettings event, 55 | Emitter emit, 56 | ) async { 57 | await _accessibility.save( 58 | AccessibilitySettings( 59 | darkMode: state.darkMode, 60 | ), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/issues/domain/models/issue_filter.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_good_practices/issues/domain/use_cases/i_issues_repository.dart'; 3 | 4 | class IssueFilter extends Equatable { 5 | const IssueFilter._({ 6 | required this.afterRecord, 7 | required this.orderByDirection, 8 | required this.filterByOpen, 9 | required this.filterByClosed, 10 | }); 11 | 12 | factory IssueFilter.initial() => const IssueFilter._( 13 | afterRecord: '', 14 | orderByDirection: OrderByDirection.desc, 15 | filterByClosed: true, 16 | filterByOpen: true, 17 | ); 18 | final String afterRecord; 19 | final OrderByDirection orderByDirection; 20 | final bool filterByOpen; 21 | final bool filterByClosed; 22 | 23 | IssueFilter copyWith({ 24 | String? afterRecord, 25 | OrderByDirection? orderByDirection, 26 | bool? filterByOpen, 27 | bool? filterByClosed, 28 | }) { 29 | return IssueFilter._( 30 | afterRecord: afterRecord ?? this.afterRecord, 31 | orderByDirection: orderByDirection ?? this.orderByDirection, 32 | filterByClosed: filterByClosed ?? this.filterByClosed, 33 | filterByOpen: filterByOpen ?? this.filterByOpen, 34 | ); 35 | } 36 | 37 | Map toJSON() { 38 | final states = []; 39 | if (filterByOpen) { 40 | states.add('OPEN'); 41 | } 42 | if (filterByClosed) { 43 | states.add('CLOSED'); 44 | } 45 | final json = { 46 | 'orderBy': orderByDirection == OrderByDirection.asc ? 'ASC' : 'DESC', 47 | 'states': states 48 | }; 49 | if (afterRecord.isNotEmpty) { 50 | json.addAll( 51 | {'after': afterRecord}, 52 | ); 53 | } 54 | return json; 55 | } 56 | 57 | @override 58 | List get props => [ 59 | afterRecord, 60 | orderByDirection, 61 | filterByOpen, 62 | filterByClosed, 63 | ]; 64 | } 65 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleLocalizations 6 | 7 | en 8 | es 9 | 10 | CFBundleDevelopmentRegion 11 | $(DEVELOPMENT_LANGUAGE) 12 | CFBundleDisplayName 13 | $(FLAVOR_APP_NAME) 14 | CFBundleExecutable 15 | $(EXECUTABLE_NAME) 16 | CFBundleIdentifier 17 | $(PRODUCT_BUNDLE_IDENTIFIER) 18 | CFBundleInfoDictionaryVersion 19 | 6.0 20 | CFBundleName 21 | Flutter Good Practices 22 | CFBundlePackageType 23 | APPL 24 | CFBundleShortVersionString 25 | $(FLUTTER_BUILD_NAME) 26 | CFBundleSignature 27 | ???? 28 | CFBundleVersion 29 | $(FLUTTER_BUILD_NUMBER) 30 | LSRequiresIPhoneOS 31 | 32 | UILaunchStoryboardName 33 | LaunchScreen 34 | UIMainStoryboardFile 35 | Main 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UIViewControllerBasedStatusBarAppearance 50 | 51 | CADisableMinimumFrameDurationOnPhone 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 20 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /lib/app/view/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AppTheme { 4 | static const appBarColorLight = Color(0xFF134B9F); 5 | static const accentColorLight = Color(0xFF13B9FF); 6 | static const accentColorDark = Color(0xFFA51716); 7 | static const primaryColorLight = Colors.red; 8 | static const primaryColorDark = Colors.red; 9 | ThemeData lightTheme() { 10 | return ThemeData( 11 | brightness: Brightness.light, 12 | primaryColor: primaryColorLight, 13 | appBarTheme: const AppBarTheme( 14 | color: primaryColorLight, 15 | ), 16 | colorScheme: const ColorScheme.light( 17 | primary: primaryColorLight, 18 | secondary: Color(0xFF134B9F), 19 | tertiary: Color.fromARGB(255, 109, 184, 246), 20 | ), 21 | outlinedButtonTheme: OutlinedButtonThemeData( 22 | style: OutlinedButton.styleFrom( 23 | foregroundColor: Colors.white, 24 | side: const BorderSide( 25 | color: Colors.white, 26 | ), 27 | ), 28 | ), 29 | ); 30 | } 31 | 32 | ThemeData darkTheme() { 33 | return ThemeData( 34 | brightness: Brightness.dark, 35 | primaryColor: primaryColorLight, 36 | inputDecorationTheme: const InputDecorationTheme( 37 | floatingLabelStyle: TextStyle(color: Colors.white), 38 | hintStyle: TextStyle(color: Colors.white), 39 | ), 40 | appBarTheme: const AppBarTheme( 41 | color: Colors.red, 42 | ), 43 | colorScheme: const ColorScheme.dark( 44 | primary: Colors.white, 45 | secondary: accentColorDark, 46 | tertiary: primaryColorDark, 47 | ), 48 | outlinedButtonTheme: OutlinedButtonThemeData( 49 | style: OutlinedButton.styleFrom( 50 | foregroundColor: Colors.white, 51 | side: const BorderSide( 52 | color: Colors.white, 53 | ), 54 | ), 55 | ), 56 | listTileTheme: const ListTileThemeData( 57 | textColor: Colors.black, 58 | ), 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Good Practices 2 | 3 | ![coverage][coverage_badge] 4 | [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] 5 | [![License: MIT][license_badge]][license_link] 6 | 7 | Generated by the [Very Good CLI][very_good_cli_link] 🤖 8 | 9 | Flutter Good Practices 10 | 11 | --- 12 | 13 | ## Getting Started 🚀 14 | 15 | This project is a sample Flutter project applying good practices: 16 | 17 | - SOLID Principles 18 | - Clean Architecture 19 | - Clean Code 20 | - Testing 21 | 22 | To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands: 23 | 24 | ```sh 25 | # Development 26 | $ flutter run --flavor development --target lib/main_development.dart 27 | 28 | # Staging 29 | $ flutter run --flavor staging --target lib/main_staging.dart 30 | 31 | # Production 32 | $ flutter run --flavor production --target lib/main_production.dart 33 | ``` 34 | 35 | _\*Flutter Good Practices works on iOS, Android, Web, and Windows._ 36 | 37 | --- 38 | 39 | ## Running Tests 🧪 40 | 41 | To run all unit and widget tests use the following command: 42 | 43 | ```sh 44 | $ flutter test --coverage --test-randomize-ordering-seed random 45 | ``` 46 | 47 | To view the generated coverage report you can use [lcov](https://github.com/linux-test-project/lcov). 48 | 49 | ```sh 50 | # Generate Coverage Report 51 | $ genhtml coverage/lcov.info -o coverage/ 52 | 53 | # Open Coverage Report 54 | $ open coverage/index.html 55 | ``` 56 | 57 | --- 58 | 59 | 60 | [coverage_badge]: coverage_badge.svg 61 | [flutter_localizations_link]: https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html 62 | [internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization 63 | [license_badge]: https://img.shields.io/badge/license-MIT-blue.svg 64 | [license_link]: https://opensource.org/licenses/MIT 65 | [very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg 66 | [very_good_analysis_link]: https://pub.dev/packages/very_good_analysis 67 | [very_good_cli_link]: https://github.com/VeryGoodOpenSource/very_good_cli 68 | -------------------------------------------------------------------------------- /lib/issues/application/filter/issues_filter_bloc.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:bloc/bloc.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:flutter_good_practices/issues/domain/models/issue_filter.dart'; 6 | import 'package:flutter_good_practices/issues/domain/use_cases/i_issues_repository.dart'; 7 | import 'package:injectable/injectable.dart'; 8 | 9 | part 'issues_filter_event.dart'; 10 | part 'issues_filter_state.dart'; 11 | 12 | @injectable 13 | class IssuesFilterBloc extends Bloc { 14 | IssuesFilterBloc() 15 | : super( 16 | IssuesFilterState( 17 | filter: IssueFilter.initial(), 18 | ), 19 | ) { 20 | on(_onInitFilter); 21 | on(_onChangeOrderByMode); 22 | on(_onChangeFilterByOpen); 23 | on(_onChangeFilterByClosed); 24 | } 25 | 26 | FutureOr _onChangeOrderByMode( 27 | ChangeOrderByMode event, 28 | Emitter emit, 29 | ) { 30 | emit( 31 | state.copyWith( 32 | filter: state.filter.copyWith( 33 | orderByDirection: 34 | event.ascending ? OrderByDirection.asc : OrderByDirection.desc, 35 | ), 36 | ), 37 | ); 38 | } 39 | 40 | FutureOr _onChangeFilterByOpen( 41 | ChangeFilterByOpen event, 42 | Emitter emit, 43 | ) { 44 | emit( 45 | state.copyWith( 46 | filter: state.filter.copyWith( 47 | filterByOpen: event.filterByOpen, 48 | ), 49 | ), 50 | ); 51 | } 52 | 53 | FutureOr _onChangeFilterByClosed( 54 | ChangeFilterByClosed event, 55 | Emitter emit, 56 | ) { 57 | emit( 58 | state.copyWith( 59 | filter: state.filter.copyWith( 60 | filterByClosed: event.filterByClosed, 61 | ), 62 | ), 63 | ); 64 | } 65 | 66 | FutureOr _onInitFilter( 67 | InitFilter event, 68 | Emitter emit, 69 | ) { 70 | emit( 71 | state.copyWith( 72 | filter: event.filter, 73 | ), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /test/issues/presentation/detail/issue_detail_navigate_button_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_navigate_button.dart'; 4 | 5 | import '../../../helpers/helpers.dart'; 6 | 7 | void main() { 8 | const buttonKey = Key('url_navigator'); 9 | const titleKey = Key('url_navigator_text'); 10 | 11 | group('render', () { 12 | testWidgets('IssueNavigateButton has correct component', (tester) async { 13 | await tester.pumpApp( 14 | const Material( 15 | child: IssueNavigateButton( 16 | url: 'link', 17 | ), 18 | ), 19 | ); 20 | final widgetFinder = find.byKey(buttonKey); 21 | expect( 22 | widgetFinder, 23 | findsOneWidget, 24 | ); 25 | final widgetTesting = tester.widget(widgetFinder); 26 | expect( 27 | widgetTesting, 28 | isA(), 29 | ); 30 | }); 31 | testWidgets('IssueNavigateButton has correct text', (tester) async { 32 | await tester.pumpApp( 33 | const Material( 34 | child: IssueNavigateButton( 35 | url: 'link', 36 | ), 37 | ), 38 | ); 39 | final widgetFinder = find.descendant( 40 | of: find.byKey(buttonKey), 41 | matching: find.byKey(titleKey), 42 | ); 43 | expect( 44 | widgetFinder, 45 | findsOneWidget, 46 | ); 47 | final widgetTesting = tester.widget(widgetFinder); 48 | expect( 49 | widgetTesting, 50 | isA(), 51 | ); 52 | expect( 53 | (widgetTesting as Text).data, 54 | 'See in GitHub', 55 | ); 56 | }); 57 | }); 58 | group('Events', () { 59 | testWidgets('IssueNavigateButton has correct text', (tester) async { 60 | await tester.pumpApp( 61 | const Material( 62 | child: IssueNavigateButton( 63 | url: 'https://google.es', 64 | ), 65 | ), 66 | ); 67 | final widgetFinder = find.byKey(buttonKey); 68 | await tester.tap(widgetFinder); 69 | }); 70 | }); 71 | } 72 | -------------------------------------------------------------------------------- /lib/issues/presentation/list/widgets/issue_card_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 4 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 5 | import 'package:flutter_good_practices/routes/routes.dart'; 6 | 7 | class IssueCard extends StatelessWidget { 8 | const IssueCard({super.key, required this.issue}); 9 | 10 | final Issue issue; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Padding( 15 | padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), 16 | child: InkWell( 17 | onTap: () { 18 | context.read().add( 19 | MarkIssueAsVisited( 20 | issue: issue, 21 | ), 22 | ); 23 | Navigator.pushNamed( 24 | context, 25 | RouteGenerator.issueDetailPage, 26 | arguments: issue, 27 | ); 28 | }, 29 | child: BlocBuilder( 30 | builder: (context, state) { 31 | return Card( 32 | key: const Key('issue_card'), 33 | color: issue.visited ? Colors.grey : Colors.white, 34 | child: Padding( 35 | padding: const EdgeInsets.only( 36 | top: 20, 37 | left: 20, 38 | bottom: 20, 39 | ), 40 | child: ListTile( 41 | title: Text( 42 | issue.title, 43 | key: const Key('issue_title'), 44 | style: Theme.of(context).textTheme.bodyText1?.copyWith( 45 | color: Colors.black, 46 | ), 47 | ), 48 | subtitle: Text( 49 | issue.state, 50 | key: const Key('issue_state'), 51 | ), 52 | trailing: const Icon( 53 | Icons.arrow_forward_ios_sharp, 54 | key: Key('issue_trailing'), 55 | color: Colors.black, 56 | ), 57 | ), 58 | ), 59 | ); 60 | }, 61 | ), 62 | ), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /test/issues/presentation/list/issues_list_page_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:bloc_test/bloc_test.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_bloc/flutter_bloc.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | import 'package:injectable/injectable.dart'; 6 | import 'package:flutter_good_practices/injection/injection.dart'; 7 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 8 | import 'package:flutter_good_practices/issues/domain/models/issue_filter.dart'; 9 | import 'package:flutter_good_practices/issues/domain/use_cases/i_issues_repository.dart'; 10 | import 'package:flutter_good_practices/issues/presentation/list/widgets/issues_list_view.dart'; 11 | import 'package:mocktail/mocktail.dart'; 12 | 13 | import '../../../helpers/helpers.dart'; 14 | 15 | class MockIssuesListBloc extends MockBloc 16 | implements IssuesListBloc {} 17 | 18 | void main() { 19 | late IssuesListBloc mockBloc; 20 | 21 | setUpAll(() async { 22 | WidgetController.hitTestWarningShouldBeFatal = true; 23 | WidgetsFlutterBinding.ensureInitialized(); 24 | }); 25 | tearDown(getIt.reset); 26 | setUp(() { 27 | configureInjection(Environment.test); 28 | mockBloc = MockIssuesListBloc(); 29 | 30 | when(() => mockBloc.state).thenReturn( 31 | IssuesListState( 32 | status: IssuesListStatus.initial, 33 | issues: const [], 34 | hasNextPage: true, 35 | filter: IssueFilter.initial().copyWith( 36 | afterRecord: '', 37 | orderByDirection: OrderByDirection.asc, 38 | filterByClosed: true, 39 | filterByOpen: true, 40 | ), 41 | ), 42 | ); 43 | }); 44 | 45 | group('render', () { 46 | testWidgets('When page is render IssuesListView is displayed ', 47 | (tester) async { 48 | when(() => mockBloc.state).thenReturn( 49 | IssuesListState( 50 | status: IssuesListStatus.initial, 51 | issues: const [], 52 | hasNextPage: true, 53 | filter: IssueFilter.initial(), 54 | ), 55 | ); 56 | await tester.pumpApp( 57 | BlocProvider.value( 58 | value: mockBloc, 59 | child: const IssuesListView(), 60 | ), 61 | ); 62 | 63 | expect( 64 | find.byType(IssuesListView), 65 | findsOneWidget, 66 | ); 67 | }); 68 | }); 69 | } 70 | -------------------------------------------------------------------------------- /test/helpers/pump_app.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, Very Good Ventures 2 | // https://verygood.ventures 3 | // 4 | // Use of this source code is governed by an MIT-style 5 | // license that can be found in the LICENSE file or at 6 | // https://opensource.org/licenses/MIT. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_bloc/flutter_bloc.dart'; 10 | import 'package:flutter_localizations/flutter_localizations.dart'; 11 | import 'package:flutter_test/flutter_test.dart'; 12 | import 'package:flutter_good_practices/injection/injection.dart'; 13 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 14 | import 'package:flutter_good_practices/l10n/l10n.dart'; 15 | import 'package:flutter_good_practices/settings/application/settings_bloc.dart'; 16 | 17 | extension PumpApp on WidgetTester { 18 | Future pumpApp(Widget widget) { 19 | return pumpWidget( 20 | MaterialApp( 21 | localizationsDelegates: const [ 22 | AppLocalizations.delegate, 23 | GlobalMaterialLocalizations.delegate, 24 | ], 25 | supportedLocales: AppLocalizations.supportedLocales, 26 | home: widget, 27 | ), 28 | ); 29 | } 30 | 31 | Future pumpAppWithSettings(Widget widget) { 32 | return pumpWidget( 33 | BlocProvider( 34 | create: (context) => getIt(), 35 | child: MaterialApp( 36 | localizationsDelegates: const [ 37 | AppLocalizations.delegate, 38 | GlobalMaterialLocalizations.delegate, 39 | ], 40 | supportedLocales: AppLocalizations.supportedLocales, 41 | home: widget, 42 | ), 43 | ), 44 | ); 45 | } 46 | 47 | Future pumpAppWithSettingsAndIssues(Widget widget) { 48 | return pumpWidget( 49 | MultiBlocProvider( 50 | providers: [ 51 | BlocProvider( 52 | create: (context) => getIt(), 53 | ), 54 | BlocProvider( 55 | create: (context) => getIt() 56 | ..add( 57 | const LoadIssues(), 58 | ), 59 | ), 60 | ], 61 | child: MaterialApp( 62 | localizationsDelegates: const [ 63 | AppLocalizations.delegate, 64 | GlobalMaterialLocalizations.delegate, 65 | ], 66 | supportedLocales: AppLocalizations.supportedLocales, 67 | home: widget, 68 | ), 69 | ), 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /test/settings/infrastructure/accessibility_repository_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/settings/domain/models/accessibility_settings.dart'; 4 | import 'package:flutter_good_practices/settings/infrastructure/accessibility_repository.dart'; 5 | import 'package:shared_preferences/shared_preferences.dart'; 6 | 7 | void main() { 8 | late AccessibilityRepository accessibilityRepository; 9 | 10 | setUp(() { 11 | accessibilityRepository = AccessibilityRepository(); 12 | }); 13 | group('isDartTheme', () { 14 | test('isDarkTheme returns correct value', () async { 15 | SharedPreferences.setMockInitialValues({'dark_mode': true}); 16 | 17 | final isDarkTheme = await accessibilityRepository.isDarkTheme(); 18 | 19 | expect(isDarkTheme, true); 20 | }); 21 | }); 22 | group('save', () { 23 | test('save method returns unit', () async { 24 | SharedPreferences.setMockInitialValues({}); 25 | 26 | final result = await accessibilityRepository.save( 27 | const AccessibilitySettings( 28 | darkMode: true, 29 | ), 30 | ); 31 | 32 | expect( 33 | result, 34 | unit, 35 | ); 36 | }); 37 | test('save method store dark mode into sharedPreferences', () async { 38 | SharedPreferences.setMockInitialValues({}); 39 | final prefs = await SharedPreferences.getInstance(); 40 | await accessibilityRepository.save( 41 | const AccessibilitySettings( 42 | darkMode: true, 43 | ), 44 | ); 45 | 46 | expect( 47 | prefs.containsKey('dark_mode'), 48 | true, 49 | ); 50 | expect( 51 | prefs.getBool('dark_mode'), 52 | true, 53 | ); 54 | }); 55 | }); 56 | group('Get', () { 57 | test( 58 | 'when previous accessibility settings are ' 59 | 'saved correct object is returned', () async { 60 | SharedPreferences.setMockInitialValues({'dark_mode': true}); 61 | 62 | final settings = await accessibilityRepository.get(); 63 | 64 | expect( 65 | settings, 66 | const AccessibilitySettings( 67 | darkMode: true, 68 | ), 69 | ); 70 | }); 71 | test( 72 | 'when no previous accessibility settings are ' 73 | 'saved default object is returned', () async { 74 | SharedPreferences.setMockInitialValues({}); 75 | 76 | final settings = await accessibilityRepository.get(); 77 | 78 | expect( 79 | settings, 80 | const AccessibilitySettings(), 81 | ); 82 | }); 83 | }); 84 | } 85 | -------------------------------------------------------------------------------- /lib/issues/infrastructure/issues_repository.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:injectable/injectable.dart'; 3 | import 'package:flutter_good_practices/core/domain/failures/failures.dart'; 4 | import 'package:flutter_good_practices/core/domain/use_cases/i_github_repository.dart'; 5 | import 'package:flutter_good_practices/issues/domain/models/failures.dart'; 6 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 7 | import 'package:flutter_good_practices/issues/domain/models/issue_filter.dart'; 8 | import 'package:flutter_good_practices/issues/domain/models/issues_navigation.dart'; 9 | import 'package:flutter_good_practices/issues/domain/use_cases/i_issues_repository.dart'; 10 | 11 | @LazySingleton( 12 | as: IIssuesRepository, 13 | ) 14 | class IssuesRepository implements IIssuesRepository { 15 | IssuesRepository(this._repository); 16 | 17 | final IGithubRepository _repository; 18 | @override 19 | Future> get({ 20 | required IssueFilter filter, 21 | }) async { 22 | const query = r''' 23 | query ($after: String, $orderBy: OrderDirection!,$states: [IssueState!] 24 | ){ 25 | repository(owner:"flutter", name:"flutter") { 26 | issues( 27 | first:30, states:$states, after: $after, 28 | orderBy: {field: CREATED_AT, direction: $orderBy} 29 | ) { 30 | pageInfo { 31 | hasNextPage 32 | endCursor 33 | } 34 | edges { 35 | cursor 36 | node { 37 | id 38 | title 39 | url 40 | number 41 | state 42 | author { 43 | url 44 | } 45 | } 46 | } 47 | } 48 | } 49 | } 50 | '''; 51 | 52 | final response = await _repository.performQuery( 53 | query, 54 | variables: filter.toJSON(), 55 | ); 56 | 57 | return response.fold( 58 | (l) => left( 59 | const IssuesFailure(), 60 | ), 61 | (r) { 62 | final repository = r.response['repository'] as Map; 63 | final issues = repository['issues'] as Map; 64 | final pageInfo = issues['pageInfo'] as Map; 65 | final edges = issues['edges'] as List; 66 | final issuesList = edges.map((e) { 67 | final json = e as Map; 68 | final node = json['node']; 69 | 70 | return Issue.fromJSON( 71 | node as Map, 72 | ); 73 | }).toList(); 74 | 75 | final issuesNavigation = IssuesNavigation( 76 | issues: issuesList, 77 | hasNextPage: pageInfo['hasNextPage'] as bool, 78 | endCursor: (pageInfo['endCursor'] as String?) ?? '', 79 | ); 80 | return right( 81 | issuesNavigation, 82 | ); 83 | }, 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/injection/injection.config.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | // ************************************************************************** 4 | // InjectableConfigGenerator 5 | // ************************************************************************** 6 | 7 | // ignore_for_file: no_leading_underscores_for_library_prefixes 8 | import 'package:get_it/get_it.dart' as _i1; 9 | import 'package:graphql/client.dart' as _i9; 10 | import 'package:graphql_flutter/graphql_flutter.dart' as _i3; 11 | import 'package:injectable/injectable.dart' as _i2; 12 | 13 | import '../core/domain/use_cases/i_github_repository.dart' as _i6; 14 | import '../core/infrastructure/app_graphql_client_module.dart' as _i15; 15 | import '../core/infrastructure/graphql_github_repository.dart' as _i8; 16 | import '../core/infrastructure/test/graphql_github_repository_test.dart' as _i7; 17 | import '../issues/application/filter/issues_filter_bloc.dart' as _i12; 18 | import '../issues/application/list/issues_list_bloc.dart' as _i13; 19 | import '../issues/domain/use_cases/i_issues_repository.dart' as _i10; 20 | import '../issues/infrastructure/issues_repository.dart' as _i11; 21 | import '../settings/application/settings_bloc.dart' as _i14; 22 | import '../settings/domain/usecases/i_accessibility.dart' as _i4; 23 | import '../settings/infrastructure/accessibility_repository.dart' as _i5; 24 | 25 | const String _test = 'test'; 26 | const String _dev = 'dev'; 27 | const String _prod = 'prod'; 28 | // ignore_for_file: unnecessary_lambdas 29 | // ignore_for_file: lines_longer_than_80_chars 30 | /// initializes the registration of provided dependencies inside of [GetIt] 31 | _i1.GetIt $initGetIt( 32 | _i1.GetIt get, { 33 | String? environment, 34 | _i2.EnvironmentFilter? environmentFilter, 35 | }) { 36 | final gh = _i2.GetItHelper( 37 | get, 38 | environment, 39 | environmentFilter, 40 | ); 41 | final appGraphQLClientModule = _$AppGraphQLClientModule(); 42 | gh.lazySingleton<_i3.GraphQLClient>( 43 | () => appGraphQLClientModule.graphQLClient); 44 | gh.lazySingleton<_i4.IAccessibility>(() => _i5.AccessibilityRepository()); 45 | gh.lazySingleton<_i6.IGithubRepository>( 46 | () => _i7.FakeGraphQLGithubRepository(), 47 | registerFor: {_test}, 48 | ); 49 | gh.lazySingleton<_i6.IGithubRepository>( 50 | () => _i8.GraphQLGithubRepository(get<_i9.GraphQLClient>()), 51 | registerFor: { 52 | _dev, 53 | _prod, 54 | }, 55 | ); 56 | gh.lazySingleton<_i10.IIssuesRepository>( 57 | () => _i11.IssuesRepository(get<_i6.IGithubRepository>())); 58 | gh.factory<_i12.IssuesFilterBloc>(() => _i12.IssuesFilterBloc()); 59 | gh.factory<_i13.IssuesListBloc>( 60 | () => _i13.IssuesListBloc(get<_i10.IIssuesRepository>())); 61 | gh.factory<_i14.SettingsBloc>( 62 | () => _i14.SettingsBloc(get<_i4.IAccessibility>())); 63 | return get; 64 | } 65 | 66 | class _$AppGraphQLClientModule extends _i15.AppGraphQLClientModule {} 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/* 18 | 19 | # Visual Studio Code related 20 | .classpath 21 | .project 22 | .settings/ 23 | .vscode/* 24 | 25 | # Flutter repo-specific 26 | /bin/cache/ 27 | /bin/mingit/ 28 | /dev/benchmarks/mega_gallery/ 29 | /dev/bots/.recipe_deps 30 | /dev/bots/android_tools/ 31 | /dev/docs/doc/ 32 | /dev/docs/flutter.docs.zip 33 | /dev/docs/lib/ 34 | /dev/docs/pubspec.yaml 35 | /dev/integration_tests/**/xcuserdata 36 | /dev/integration_tests/**/Pods 37 | /packages/flutter/coverage/ 38 | version 39 | 40 | # packages file containing multi-root paths 41 | .packages.generated 42 | 43 | # Flutter/Dart/Pub related 44 | **/doc/api/ 45 | **/ios/Flutter/.last_build_id 46 | .dart_tool/ 47 | .flutter-plugins 48 | .flutter-plugins-dependencies 49 | .packages 50 | .pub-cache/ 51 | .pub/ 52 | build/ 53 | flutter_*.png 54 | linked_*.ds 55 | unlinked.ds 56 | unlinked_spec.ds 57 | .fvm/ 58 | 59 | # Android related 60 | **/android/**/gradle-wrapper.jar 61 | **/android/.gradle 62 | **/android/captures/ 63 | **/android/gradlew 64 | **/android/gradlew.bat 65 | **/android/local.properties 66 | **/android/**/GeneratedPluginRegistrant.java 67 | **/android/key.properties 68 | **/android/.idea/ 69 | *.jks 70 | 71 | # iOS/XCode related 72 | **/ios/**/*.mode1v3 73 | **/ios/**/*.mode2v3 74 | **/ios/**/*.moved-aside 75 | **/ios/**/*.pbxuser 76 | **/ios/**/*.perspectivev3 77 | **/ios/**/*sync/ 78 | **/ios/**/.sconsign.dblite 79 | **/ios/**/.tags* 80 | **/ios/**/.vagrant/ 81 | **/ios/**/DerivedData/ 82 | **/ios/**/Icon? 83 | **/ios/**/Pods/ 84 | **/ios/**/.symlinks/ 85 | **/ios/**/profile 86 | **/ios/**/xcuserdata 87 | **/ios/.generated/ 88 | **/ios/Flutter/App.framework 89 | **/ios/Flutter/Flutter.framework 90 | **/ios/Flutter/Flutter.podspec 91 | **/ios/Flutter/Generated.xcconfig 92 | **/ios/Flutter/app.flx 93 | **/ios/Flutter/app.zip 94 | **/ios/Flutter/.last_build_id 95 | **/ios/Flutter/flutter_assets/ 96 | **/ios/Flutter/flutter_export_environment.sh 97 | **/ios/ServiceDefinitions.json 98 | **/ios/Runner/GeneratedPluginRegistrant.* 99 | 100 | # Coverage 101 | coverage/ 102 | 103 | # Submodules 104 | !pubspec.lock 105 | packages/**/pubspec.lock 106 | 107 | # Web related 108 | lib/generated_plugin_registrant.dart 109 | 110 | # Symbolication related 111 | app.*.symbols 112 | 113 | # Obfuscation related 114 | app.*.map.json 115 | 116 | # Exceptions to the above rules. 117 | !**/ios/**/default.mode1v3 118 | !**/ios/**/default.mode2v3 119 | !**/ios/**/default.pbxuser 120 | !**/ios/**/default.perspectivev3 121 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 122 | !/dev/ci/**/Gemfile.lock 123 | !.vscode/extensions.json 124 | !.vscode/launch.json 125 | !.idea/codeStyles/ 126 | !.idea/dictionaries/ 127 | !.idea/runConfigurations/ 128 | -------------------------------------------------------------------------------- /test/issues/presentation/detail/issue_detail_page_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue.dart'; 4 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_navigate_button.dart'; 5 | import 'package:flutter_good_practices/issues/presentation/detail/issue_detail_page.dart'; 6 | import 'package:flutter_good_practices/issues/presentation/detail/issue_state_widget.dart'; 7 | import 'package:flutter_good_practices/issues/presentation/detail/issue_title_widget.dart'; 8 | 9 | import '../../../helpers/helpers.dart'; 10 | 11 | void main() { 12 | const titleKey = Key('issue_detail_title'); 13 | const stateKey = Key('issue_detail_state'); 14 | const navigateKey = Key('issue_detail_navigate'); 15 | const issue = Issue( 16 | id: 'id1', 17 | title: 'title', 18 | number: 1, 19 | state: 'state', 20 | url: 'url', 21 | ); 22 | group('render', () { 23 | testWidgets('IssueDetailPage has correct title', (tester) async { 24 | await tester.pumpApp( 25 | const Material( 26 | child: IssueDetailPage( 27 | issue: issue, 28 | ), 29 | ), 30 | ); 31 | final widgetFinder = find.byKey(titleKey); 32 | expect( 33 | widgetFinder, 34 | findsOneWidget, 35 | ); 36 | final widgetTesting = tester.widget(widgetFinder); 37 | expect( 38 | widgetTesting, 39 | isA(), 40 | ); 41 | expect( 42 | (widgetTesting as IssueTitle).title, 43 | issue.title, 44 | ); 45 | }); 46 | testWidgets('IssueDetailPage has correct state', (tester) async { 47 | await tester.pumpApp( 48 | const Material( 49 | child: IssueDetailPage( 50 | issue: issue, 51 | ), 52 | ), 53 | ); 54 | final widgetFinder = find.byKey(stateKey); 55 | expect( 56 | widgetFinder, 57 | findsOneWidget, 58 | ); 59 | final widgetTesting = tester.widget(widgetFinder); 60 | expect( 61 | widgetTesting, 62 | isA(), 63 | ); 64 | expect( 65 | (widgetTesting as IssueState).state, 66 | issue.state, 67 | ); 68 | }); 69 | testWidgets('IssueDetailPage has correct navigator', (tester) async { 70 | await tester.pumpApp( 71 | const Material( 72 | child: IssueDetailPage( 73 | issue: issue, 74 | ), 75 | ), 76 | ); 77 | final widgetFinder = find.byKey(navigateKey); 78 | expect( 79 | widgetFinder, 80 | findsOneWidget, 81 | ); 82 | final widgetTesting = tester.widget(widgetFinder); 83 | expect( 84 | widgetTesting, 85 | isA(), 86 | ); 87 | expect( 88 | (widgetTesting as IssueNavigateButton).url, 89 | issue.url, 90 | ); 91 | }); 92 | }); 93 | } 94 | -------------------------------------------------------------------------------- /test/issues/domain/issue_filter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_good_practices/issues/domain/models/issue_filter.dart'; 4 | import 'package:flutter_good_practices/issues/domain/use_cases/i_issues_repository.dart'; 5 | 6 | void main() { 7 | test('IssueFilter is Equatable', () { 8 | final filter = IssueFilter.initial().copyWith( 9 | afterRecord: '', 10 | orderByDirection: OrderByDirection.desc, 11 | filterByOpen: true, 12 | filterByClosed: true, 13 | ); 14 | expect( 15 | filter, 16 | isA(), 17 | ); 18 | expect( 19 | filter.props, 20 | [ 21 | '', 22 | OrderByDirection.desc, 23 | true, 24 | true, 25 | ], 26 | ); 27 | }); 28 | test( 29 | 'IssueFilter toJSON returns correct object when afterRecord is empty', 30 | () { 31 | final filter = IssueFilter.initial().copyWith( 32 | afterRecord: '', 33 | orderByDirection: OrderByDirection.desc, 34 | filterByOpen: true, 35 | filterByClosed: true, 36 | ); 37 | expect( 38 | filter.toJSON(), 39 | { 40 | 'orderBy': 'DESC', 41 | 'states': ['OPEN', 'CLOSED'], 42 | }, 43 | ); 44 | }, 45 | ); 46 | test( 47 | 'IssueFilter toJSON returns correct object when afterRecord is NOT empty', 48 | () { 49 | final filter = IssueFilter.initial().copyWith( 50 | afterRecord: '1234567890', 51 | orderByDirection: OrderByDirection.desc, 52 | filterByOpen: true, 53 | filterByClosed: true, 54 | ); 55 | expect( 56 | filter.toJSON(), 57 | { 58 | 'orderBy': 'DESC', 59 | 'states': ['OPEN', 'CLOSED'], 60 | 'after': '1234567890' 61 | }, 62 | ); 63 | }, 64 | ); 65 | test( 66 | 'IssueFilter toJSON returns correct object when only filter by closed', 67 | () { 68 | final filter = IssueFilter.initial().copyWith( 69 | afterRecord: '1234567890', 70 | orderByDirection: OrderByDirection.desc, 71 | filterByOpen: false, 72 | filterByClosed: true, 73 | ); 74 | expect( 75 | filter.toJSON(), 76 | { 77 | 'orderBy': 'DESC', 78 | 'states': ['CLOSED'], 79 | 'after': '1234567890' 80 | }, 81 | ); 82 | }, 83 | ); 84 | test( 85 | 'IssueFilter toJSON returns correct object when only filter by open', 86 | () { 87 | final filter = IssueFilter.initial().copyWith( 88 | afterRecord: '1234567890', 89 | orderByDirection: OrderByDirection.desc, 90 | filterByOpen: true, 91 | filterByClosed: false, 92 | ); 93 | expect( 94 | filter.toJSON(), 95 | { 96 | 'orderBy': 'DESC', 97 | 'states': ['OPEN'], 98 | 'after': '1234567890' 99 | }, 100 | ); 101 | }, 102 | ); 103 | } 104 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/development.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "xyz.albertomontesdeoca.flutter-good-practices" "\0" 93 | VALUE "FileDescription", "flutter_good_practices" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "flutter_good_practices" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 xyz.albertomontesdeoca.flutter-good-practices. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "flutter_good_practices.exe" "\0" 98 | VALUE "ProductName", "Flutter Good Practices" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /lib/issues/presentation/list/widgets/issues_list_body.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_good_practices/issues/application/list/issues_list_bloc.dart'; 4 | import 'package:flutter_good_practices/issues/presentation/list/widgets/issue_card_widget.dart'; 5 | import 'package:flutter_good_practices/l10n/l10n.dart'; 6 | 7 | class IssuesListBody extends StatelessWidget { 8 | const IssuesListBody({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final l10n = context.l10n; 13 | return BlocBuilder( 14 | builder: (context, state) { 15 | final scrollController = ScrollController(); 16 | scrollController.addListener(() { 17 | final triggerFetchMoreSize = 18 | 0.9 * scrollController.position.maxScrollExtent; 19 | 20 | if (scrollController.position.pixels > triggerFetchMoreSize) { 21 | context.read().add( 22 | const LoadNextPageIssues(), 23 | ); 24 | } 25 | }); 26 | if (state.status == IssuesListStatus.loading || 27 | state.status == IssuesListStatus.initial) { 28 | return const Center( 29 | child: CircularProgressIndicator(), 30 | ); 31 | } else if (state.status == IssuesListStatus.error) { 32 | return Center( 33 | child: Text( 34 | l10n.errorLoading, 35 | style: Theme.of(context).textTheme.bodyText1?.copyWith( 36 | color: Colors.red, 37 | fontSize: 20, 38 | fontWeight: FontWeight.w700, 39 | ), 40 | ), 41 | ); 42 | } else { 43 | if (state.issues.isEmpty) { 44 | return Padding( 45 | padding: const EdgeInsets.all(8), 46 | child: Center( 47 | child: Text( 48 | l10n.emptyList, 49 | textAlign: TextAlign.center, 50 | style: Theme.of(context).textTheme.bodyText1?.copyWith( 51 | fontSize: 20, 52 | fontWeight: FontWeight.w700, 53 | ), 54 | ), 55 | ), 56 | ); 57 | } 58 | return RefreshIndicator( 59 | key: const Key('issues_refresh_list'), 60 | onRefresh: () { 61 | context.read().add( 62 | const LoadIssues(), 63 | ); 64 | return Future.value(); 65 | }, 66 | child: ListView.builder( 67 | key: const Key('issues_list'), 68 | physics: const AlwaysScrollableScrollPhysics(), 69 | controller: scrollController, 70 | itemCount: state.status == IssuesListStatus.updatingList 71 | ? state.issues.length + 1 72 | : state.issues.length, 73 | itemBuilder: (BuildContext context, int index) { 74 | if (index == state.issues.length) { 75 | return Center( 76 | child: CircularProgressIndicator( 77 | color: Theme.of(context).primaryColor, 78 | ), 79 | ); 80 | } 81 | return IssueCard( 82 | key: Key('issue_$index'), 83 | issue: state.issues[index], 84 | ); 85 | }, 86 | ), 87 | ); 88 | } 89 | }, 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(flutter_good_practices LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "flutter_good_practices") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /test/core/infrastructure/graphql_github_repository_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_good_practices/core/domain/failures/graphql_failures.dart'; 2 | import 'package:flutter_good_practices/core/domain/models/mm_reponse.dart'; 3 | import 'package:flutter_good_practices/core/infrastructure/graphql_github_repository.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | import 'package:graphql_flutter/graphql_flutter.dart'; 6 | import 'package:mocktail/mocktail.dart'; 7 | 8 | class MockGraphQLClient extends Mock implements GraphQLClient {} 9 | 10 | void main() { 11 | late GraphQLGithubRepository repository; 12 | late GraphQLClient mockGraphQLClient; 13 | const query = r''' 14 | query ($after: String, $orderBy: OrderDirection!){ 15 | repository(owner:"flutter", name:"flutter") { 16 | issues( 17 | first:30, states:[OPEN, CLOSED], after: $after, 18 | orderBy: {field: CREATED_AT, direction: $orderBy} 19 | ) { 20 | pageInfo { 21 | hasNextPage 22 | endCursor 23 | } 24 | edges { 25 | cursor 26 | node { 27 | id 28 | title 29 | url 30 | number 31 | state 32 | author { 33 | url 34 | } 35 | } 36 | } 37 | } 38 | } 39 | } 40 | '''; 41 | setUp(() { 42 | mockGraphQLClient = MockGraphQLClient(); 43 | repository = GraphQLGithubRepository(mockGraphQLClient); 44 | }); 45 | test( 46 | 'performQuery returns left with failure when client throws exception', 47 | () async { 48 | final options = QueryOptions( 49 | document: gql(query), 50 | ); 51 | when( 52 | () => mockGraphQLClient.query(options), 53 | ).thenThrow( 54 | Exception('message'), 55 | ); 56 | final failureOrResponse = await repository.performQuery( 57 | query, 58 | variables: {}, 59 | ); 60 | failureOrResponse.fold( 61 | (l) => expect( 62 | l, 63 | isA(), 64 | ), 65 | (r) => expect(true, false, reason: 'Expecting left side'), 66 | ); 67 | }, 68 | ); 69 | test( 70 | 'performQuery returns right with MMResponse failure when ' 71 | 'client has exception in result', 72 | () async { 73 | final options = QueryOptions( 74 | document: gql(query), 75 | ); 76 | when( 77 | () => mockGraphQLClient.query(options), 78 | ).thenAnswer( 79 | (_) async => QueryResult( 80 | options: options, 81 | source: QueryResultSource.cache, 82 | exception: OperationException(), 83 | ), 84 | ); 85 | final failureOrResponse = await repository.performQuery( 86 | query, 87 | variables: {}, 88 | ); 89 | failureOrResponse.fold( 90 | (l) => expect( 91 | l, 92 | isA(), 93 | ), 94 | (r) => expect(true, false, reason: 'Expecting left side'), 95 | ); 96 | }, 97 | ); 98 | test( 99 | 'performQuery returns right with MMResponse correct when ' 100 | 'client returns correct response', 101 | () async { 102 | final options = QueryOptions( 103 | document: gql(query), 104 | ); 105 | when( 106 | () => mockGraphQLClient.query(options), 107 | ).thenAnswer( 108 | (_) async => QueryResult( 109 | options: options, 110 | source: QueryResultSource.cache, 111 | data: {'key': 'value'}, 112 | ), 113 | ); 114 | final failureOrResponse = await repository.performQuery( 115 | query, 116 | variables: {}, 117 | ); 118 | failureOrResponse.fold( 119 | (l) => expect(true, false, reason: 'Expecting right side'), 120 | (r) => expect( 121 | r, 122 | const MMResponse( 123 | correct: true, 124 | response: {'key': 'value'}, 125 | ), 126 | ), 127 | ); 128 | }, 129 | ); 130 | } 131 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | def keystoreProperties = new Properties() 25 | def keystorePropertiesFile = rootProject.file('key.properties') 26 | if (keystorePropertiesFile.exists()) { 27 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 28 | } 29 | 30 | apply plugin: 'com.android.application' 31 | apply plugin: 'kotlin-android' 32 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 33 | 34 | android { 35 | compileSdkVersion flutter.compileSdkVersion 36 | 37 | compileOptions { 38 | sourceCompatibility JavaVersion.VERSION_1_8 39 | targetCompatibility JavaVersion.VERSION_1_8 40 | } 41 | 42 | kotlinOptions { 43 | jvmTarget = '1.8' 44 | } 45 | 46 | sourceSets { 47 | main.java.srcDirs += 'src/main/kotlin' 48 | } 49 | 50 | defaultConfig { 51 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 52 | applicationId "xyz.albertomontesdeoca.flutter_good_practices" 53 | minSdkVersion flutter.minSdkVersion 54 | targetSdkVersion flutter.targetSdkVersion 55 | versionCode flutterVersionCode.toInteger() 56 | versionName flutterVersionName 57 | } 58 | 59 | signingConfigs { 60 | if (System.getenv("ANDROID_KEYSTORE_PATH")) { 61 | release { 62 | storeFile file(System.getenv("ANDROID_KEYSTORE_PATH")) 63 | keyAlias System.getenv("ANDROID_KEYSTORE_ALIAS") 64 | keyPassword System.getenv("ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD") 65 | storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD") 66 | } 67 | } else { 68 | release { 69 | keyAlias keystoreProperties['keyAlias'] 70 | keyPassword keystoreProperties['keyPassword'] 71 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 72 | storePassword keystoreProperties['storePassword'] 73 | } 74 | } 75 | } 76 | 77 | flavorDimensions "default" 78 | productFlavors { 79 | production { 80 | dimension "default" 81 | applicationIdSuffix "" 82 | manifestPlaceholders = [appName: "Flutter Good Practices"] 83 | } 84 | staging { 85 | dimension "default" 86 | applicationIdSuffix ".stg" 87 | manifestPlaceholders = [appName: "[STG] Flutter Good Practices"] 88 | } 89 | development { 90 | dimension "default" 91 | applicationIdSuffix ".dev" 92 | manifestPlaceholders = [appName: "[DEV] Flutter Good Practices"] 93 | } 94 | } 95 | 96 | buildTypes { 97 | release { 98 | signingConfig signingConfigs.release 99 | minifyEnabled true 100 | proguardFiles getDefaultProguardFile('proguard-android.txt') 101 | } 102 | debug { 103 | signingConfig signingConfigs.debug 104 | } 105 | } 106 | } 107 | 108 | flutter { 109 | source '../..' 110 | } 111 | 112 | dependencies { 113 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 114 | } 115 | -------------------------------------------------------------------------------- /lib/settings/presentation/settings_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | import 'package:flutter_good_practices/l10n/l10n.dart'; 4 | import 'package:flutter_good_practices/settings/application/settings_bloc.dart'; 5 | 6 | class SettingsDialog extends StatelessWidget { 7 | const SettingsDialog({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return _buildDialog(context); 12 | } 13 | 14 | AlertDialog _buildDialog(BuildContext context) { 15 | final l10n = context.l10n; 16 | return AlertDialog( 17 | shape: _defaultShape(), 18 | insetPadding: const EdgeInsets.all(8), 19 | elevation: 10, 20 | titlePadding: EdgeInsets.zero, 21 | title: Row( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | children: [ 24 | Padding( 25 | padding: const EdgeInsets.fromLTRB(25, 30, 0, 0), 26 | child: Text( 27 | l10n.settingsText, 28 | key: const Key('accessibility_dialog_title'), 29 | style: Theme.of(context).textTheme.headline6?.copyWith( 30 | color: Theme.of(context).brightness == Brightness.light 31 | ? Colors.black 32 | : Colors.white, 33 | ), 34 | ), 35 | ), 36 | _getCloseButton(context), 37 | ], 38 | ), 39 | content: BlocBuilder( 40 | builder: (context, state) { 41 | return Column( 42 | mainAxisSize: MainAxisSize.min, 43 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 44 | crossAxisAlignment: CrossAxisAlignment.start, 45 | children: [ 46 | Row( 47 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 48 | children: [ 49 | Text( 50 | l10n.settingsDarkMode, 51 | key: const Key('accessibility_dialog_darkmode_text'), 52 | style: Theme.of(context).textTheme.bodyText1?.copyWith( 53 | color: 54 | Theme.of(context).brightness == Brightness.light 55 | ? Colors.black 56 | : Colors.white, 57 | ), 58 | ), 59 | Switch( 60 | key: const Key('accessibility_dialog_darkmode_switch'), 61 | onChanged: (bool value) { 62 | context 63 | .read() 64 | .add(ChangeStyleEvent(darkMode: value)); 65 | }, 66 | value: state.darkMode, 67 | ), 68 | ], 69 | ), 70 | const SizedBox( 71 | height: 30, 72 | ), 73 | ], 74 | ); 75 | }, 76 | ), 77 | ); 78 | } 79 | 80 | // Returns alert default border style 81 | ShapeBorder _defaultShape() { 82 | return RoundedRectangleBorder( 83 | borderRadius: BorderRadius.circular(10), 84 | side: const BorderSide( 85 | color: Colors.white, 86 | ), 87 | ); 88 | } 89 | 90 | Widget _getCloseButton(BuildContext context) { 91 | return Padding( 92 | key: const Key('accessibility_dialog_close_button'), 93 | padding: const EdgeInsets.fromLTRB(0, 10, 10, 30), 94 | child: GestureDetector( 95 | child: Container( 96 | alignment: FractionalOffset.topRight, 97 | child: InkWell( 98 | child: Icon( 99 | Icons.clear, 100 | key: const Key('accessibility_dialog_close_icon'), 101 | color: Theme.of(context).colorScheme.secondary, 102 | ), 103 | onTap: () { 104 | Navigator.pop(context); 105 | }, 106 | ), 107 | ), 108 | ), 109 | ); 110 | } 111 | } 112 | --------------------------------------------------------------------------------