diff --git a/apps/wyatt_app_template/brickgen.yaml b/apps/wyatt_app_template/brickgen.yaml index 7ee4e4f..e5a5666 100644 --- a/apps/wyatt_app_template/brickgen.yaml +++ b/apps/wyatt_app_template/brickgen.yaml @@ -17,7 +17,7 @@ name: wyatt_app_template description: New app template for Wyatt Studio projects. -version: 0.1.2 +version: 0.2.0 vars: display_name: diff --git a/apps/wyatt_app_template/hooks/post_gen.dart b/apps/wyatt_app_template/hooks/post_gen.dart index 398a858..d9aa04f 100644 --- a/apps/wyatt_app_template/hooks/post_gen.dart +++ b/apps/wyatt_app_template/hooks/post_gen.dart @@ -35,5 +35,38 @@ void removeGitKeepFiles(String targetPath) { Future run(HookContext context) async { final workingDirectory = Directory.current.path; + + /// Remove .gitkeep files + print('Removing .gitkeep files'); removeGitKeepFiles(workingDirectory); + + /// dart pub get + print('Running `dart pub get`'); + await Process.run('dart', ['pub', 'get'], runInShell: true); + + /// dart format . --fix && dart fix . --apply + print('Running `dart format . --fix && dart fix . --apply`'); + await Process.run('dart', ['format', '.', '--fix'], runInShell: true); + await Process.run('dart', ['fix', '.', '--apply'], runInShell: true); + + final bundleId = context.vars['bundle_id'] as String?; + final appName = bundleId?.split('.').last; + final org = bundleId?.replaceAll('.$appName', ''); + + /// flutter create --platforms android,ios --org com.example --project-name example . + print( + 'Running `flutter create --platforms android,ios --org $org --project-name $appName .`'); + await Process.run( + 'flutter', + [ + 'create', + '--platforms', + 'android,ios', + '--org', + org ?? 'com.example', + '--project-name', + appName ?? 'example', + '.' + ], + runInShell: true); } diff --git a/apps/wyatt_app_template/starting_template/.gitignore b/apps/wyatt_app_template/starting_template/.gitignore index 9e1210f..325bd7c 100644 --- a/apps/wyatt_app_template/starting_template/.gitignore +++ b/apps/wyatt_app_template/starting_template/.gitignore @@ -47,8 +47,17 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release -.mason/ +# Custom +.mason/ .env !.env.example -node_modules/ \ No newline at end of file +node_modules/ +lib/gen/ +**/*.g.dart +**/*.freezed.dart +android/fastlane/report.xml +pubspec_overrides.yaml +.fvm/flutter_sdk +*.apk +*.apks diff --git a/apps/wyatt_app_template/starting_template/.vscode/launch.json b/apps/wyatt_app_template/starting_template/.vscode/launch.json index 3e84edd..0ab67b1 100644 --- a/apps/wyatt_app_template/starting_template/.vscode/launch.json +++ b/apps/wyatt_app_template/starting_template/.vscode/launch.json @@ -5,36 +5,12 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch development/debug:mocks", + "name": "Launch development/debug", "request": "launch", "type": "dart", "program": "lib/main_development.dart", "args": [ - "--dart-define=dev_mode=mock", - "--target", - "lib/main_development.dart" - ], - "flutterMode": "debug" - }, - { - "name": "Launch development/debug:emulator", - "request": "launch", - "type": "dart", - "program": "lib/main_development.dart", - "args": [ - "--dart-define=dev_mode=emulator", - "--target", - "lib/main_development.dart" - ], - "flutterMode": "debug" - }, - { - "name": "Launch development/debug:real", - "request": "launch", - "type": "dart", - "program": "lib/main_development.dart", - "args": [ - "--dart-define=dev_mode=real", + "--dart-define-from-file=config.dev.json", "--target", "lib/main_development.dart" ], @@ -46,6 +22,7 @@ "type": "dart", "program": "lib/main_staging.dart", "args": [ + "--dart-define-from-file=config.staging.json", "--target", "lib/main_staging.dart" ], @@ -55,8 +32,9 @@ "name": "Launch production/debug", "request": "launch", "type": "dart", - "program": "lib/main_production.dart", + "program": "lib/main_produdction.dart", "args": [ + "--dart-define-from-file=config.prod.json", "--target", "lib/main_production.dart" ], @@ -66,12 +44,13 @@ "name": "Launch production/release", "request": "launch", "type": "dart", - "program": "lib/main_production.dart", + "program": "lib/main_produdction.dart", "args": [ + "--dart-define-from-file=config.prod.json", "--target", "lib/main_production.dart" ], "flutterMode": "release" }, ] -} \ No newline at end of file +} diff --git a/apps/wyatt_app_template/starting_template/README.md b/apps/wyatt_app_template/starting_template/README.md index 334a6ea..bb9ecbd 100644 --- a/apps/wyatt_app_template/starting_template/README.md +++ b/apps/wyatt_app_template/starting_template/README.md @@ -7,47 +7,82 @@ A short project description * Flutter * Taskfile -### Configuration +> **Warning** Before anything, you need to generate some files -At the build time, the app will read the environment variables from `config.json` file. +```sh +task bootstrap # to bootstrap the project +``` -The important variable is `DEV_MODE` which can be `mock` , `local` or `real` . +## Configuration + +### Environment variables + +```sh +cp .env.example .env +``` + +This file contains the secrets variables. You need to fill them. + +At the build time, the app will read the environment variables from `config..json` file. + +You can enable/disable some features ```json { - "DEV_MODE": "local" + "FEATURE_FLAGS": "logger" // Separated by comma "," } ``` -> **Note** `local` can refer to a local server or a local emulator. +You can also customize data source -### Taskfile +```json +{ + "DATA_SOURCE": "mock" // Or "api" for example +} +``` -Available tasks: +### Splash and icons -| Commande | Description | Alias | -| --- | --- | --- | -| clean | Nettoie l'environnement de travail | cl | -| format | Formate le code | fmt | -| help | Affiche la boîte de dialogue d'aide | h, default | -| lint | Vérifie la qualité du code | l | -| start-emulators | Démarre les émulateurs nécessaires | emu | -| build:android | Construit le fichier APK pour Android | build:a | -| build:ios | Construit le fichier IPA pour iOS | build:i | -| gen:build | Exécute le générateur de build | gen:b | -| gen:build-delete | Exécute le générateur de build et supprime les sorties en conflit | gen:d | -| gen:clean | Nettoie le générateur de build | gen:c | -| gen:intl | Génère un fichier d'internationalisation | gen:i | -| gen:watch | Exécute le générateur de build en mode surveillance | gen:w | -| pub:get | Obtient les dernières dépendances | pub:g | -| pub:outdated | Vérifie les dépendances obsolètes | pub:o | -| pub:upgrade | Met à jour les dépendances | pub:u | -| pub:upgrade-major | Met à jour les dépendances majeures | pub:um | -| pub:validate | Exécute le validateur de dépendances | pub:v | -| run:dev | Lance l'application en environnement de développement | run:d | -| run:logs | Affiche la sortie de journalisation pour les applications Flutter en cours d'exécution | run:l | -| run:prod | Lance l'application en environnement de production | run:p | -| run:staging | Lance l'application en environnement de pré-production | run:s | +To generate splash screen and icons, you need to run the following command: + +```sh +task gen:splash # to generate splash screen +task gen:icons # to generate icons +``` + +## Taskfile + +### Commands + +
+ To display available commands run task help + +| Commande | Description | Aliases | +|---------------------------|---------------------------------------------------------------|--------------------------------| +| `bootstrap` | Bootstraps the project. | `bs` | +| `clean` | Cleans the environment. | `cl` | +| `decrypt-android-keys` | Decrypt Android keys | `dak` | +| `encrypt-android-keys` | Encrypt Android keys | `eak` | +| `format` | Formats the code. | `fmt` | +| `help` | Help dialog. | `h` , `default` | +| `lint` | Lints the code. | `l` | +| `build:android` | Building Android AAB | `build:a` | +| `build:ios` | Building iOS IPA | `build:i` | +| `gen:build` | Running build runner | `gen:b` | +| `gen:build-delete` | Running build runner with deletion of conflicting outputs | `gen:d` | +| `gen:clean` | Cleaning build runner | `gen:c` | +| `gen:intl` | Generating internationalization file | `gen:i` | +| `pub:get` | Getting latest dependencies | `pub:g` | +| `pub:outdated` | Checking for outdated dependencies | `pub:o` | +| `pub:upgrade` | Upgrading dependencies | `pub:u` | +| `pub:upgrade-major` | Upgrading dependencies | `pub:um` | +| `pub:validate` | Running dependency validator | `pub:v` | +| `run:dev` | Run app in development environment | `run:d` | +| `run:logs` | Show log output for running Flutter apps | `run:l` | +| `run:prod` | Run app in production environment | `run:p` | +| `run:staging` | Run app in staging environment | `run:s` | + +
### Parameters @@ -58,3 +93,13 @@ task run:staging -- -d chrome ``` > **Note** The `--` is required to pass options to the command. + +### Secrets + +Use: + +```sh +task decrypt-android-keys +``` + +to decrypt the android keys (this assumes you have the passphrase in your .env file). diff --git a/apps/wyatt_app_template/starting_template/Taskfile.yml b/apps/wyatt_app_template/starting_template/Taskfile.yml index 43888b9..1ab5e44 100644 --- a/apps/wyatt_app_template/starting_template/Taskfile.yml +++ b/apps/wyatt_app_template/starting_template/Taskfile.yml @@ -25,14 +25,14 @@ tasks: desc: Cleans the environment. aliases: [cl] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Cleaning the project...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Cleaning the project...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter clean format: desc: Formats the code. aliases: [fmt] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Formatting the code...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Formatting the code...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter format --fix - dart fix --apply @@ -40,12 +40,34 @@ tasks: desc: Lints the code. aliases: [l] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Verifying code...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Verifying code...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - dart analyze . || (echo "Error in project"; exit 1) - start-emulators: - desc: Start needed emulators. - aliases: [emu] + bootstrap: + desc: Bootstraps the project. + aliases: [bs] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Start Firebase emulators...{{.COLOROFF}}" - - firebase emulators:start --only auth,functions,firestore,storage --import=./functions/saved-data --export-on-exit=./functions/saved-data + - melos bs || true + - flutter pub get + - dart run build_runner build --delete-conflicting-outputs + - flutter gen-l10n + - fluttergen || true + + encrypt-android-keys: + desc: Encrypt Android keys + aliases: [eak] + cmds: + - cd android && jar cfvM android_keys.zip android_keys + - source '.env' && gpg --quiet --batch --yes --symmetric --passphrase=$ANDROID_KEYS_SECRET_PASSPHRASE --output android/android_keys.zip.gpg android/android_keys.zip + - rm -rf android/android_keys + - rm android/android_keys.zip + + decrypt-android-keys: + desc: Decrypt Android keys + aliases: [dak] + cmds: + - source '.env' && gpg --quiet --batch --yes --decrypt --passphrase=$ANDROID_KEYS_SECRET_PASSPHRASE --output android/android_keys.zip android/android_keys.zip.gpg + - cd android && jar xvf android_keys.zip + - mv android/android_keys/* android/ + - rm -rf android/android_keys + - rm android/android_keys.zip diff --git a/apps/wyatt_app_template/starting_template/analysis_options.yaml b/apps/wyatt_app_template/starting_template/analysis_options.yaml index 96780ca..91179f1 100644 --- a/apps/wyatt_app_template/starting_template/analysis_options.yaml +++ b/apps/wyatt_app_template/starting_template/analysis_options.yaml @@ -11,8 +11,8 @@ dart_code_metrics: metrics: cyclomatic-complexity: 20 maximum-nesting-level: 5 - number-of-parameters: 5 - source-lines-of-code: 250 + number-of-parameters: 10 + source-lines-of-code: 400 metrics-exclude: - test/** rules: diff --git a/apps/wyatt_app_template/starting_template/android/.gitignore b/apps/wyatt_app_template/starting_template/android/.gitignore deleted file mode 100644 index 6f56801..0000000 --- a/apps/wyatt_app_template/starting_template/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/apps/wyatt_app_template/starting_template/android/app/build.gradle b/apps/wyatt_app_template/starting_template/android/app/build.gradle deleted file mode 100644 index a391659..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "io.wyattapp.start" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/apps/wyatt_app_template/starting_template/android/app/src/debug/AndroidManifest.xml b/apps/wyatt_app_template/starting_template/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 90c5a3d..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/AndroidManifest.xml b/apps/wyatt_app_template/starting_template/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 353f1ab..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt b/apps/wyatt_app_template/starting_template/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt deleted file mode 100644 index 894a9e7..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.wyattapp.start - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable-v21/launch_background.xml b/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable/launch_background.xml b/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/apps/wyatt_app_template/starting_template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/values-night/styles.xml b/apps/wyatt_app_template/starting_template/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/main/res/values/styles.xml b/apps/wyatt_app_template/starting_template/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef88..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/android/app/src/profile/AndroidManifest.xml b/apps/wyatt_app_template/starting_template/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 90c5a3d..0000000 --- a/apps/wyatt_app_template/starting_template/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/apps/wyatt_app_template/starting_template/android/build.gradle b/apps/wyatt_app_template/starting_template/android/build.gradle deleted file mode 100644 index 83ae220..0000000 --- a/apps/wyatt_app_template/starting_template/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/apps/wyatt_app_template/starting_template/android/gradle.properties b/apps/wyatt_app_template/starting_template/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/apps/wyatt_app_template/starting_template/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/apps/wyatt_app_template/starting_template/android/gradle/wrapper/gradle-wrapper.properties b/apps/wyatt_app_template/starting_template/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index cb24abd..0000000 --- a/apps/wyatt_app_template/starting_template/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/apps/wyatt_app_template/starting_template/android/settings.gradle b/apps/wyatt_app_template/starting_template/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/apps/wyatt_app_template/starting_template/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/apps/wyatt_app_template/starting_template/assets/fonts/.gitkeep b/apps/wyatt_app_template/starting_template/assets/fonts/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/assets/fonts/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/automation/build.yml b/apps/wyatt_app_template/starting_template/automation/build.yml index 21e22ca..9a7b6cd 100644 --- a/apps/wyatt_app_template/starting_template/automation/build.yml +++ b/apps/wyatt_app_template/starting_template/automation/build.yml @@ -22,17 +22,19 @@ tasks: - flutter pub get android: - desc: Building Android APK + desc: Building Android AAB deps: [clean, get] aliases: [a] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Building Android APK...{{.COLOROFF}}" - - flutter build apk --target=lib/main_production --no-pub --no-shrink - + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Building Android AAB...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter build appbundle lib/main_production.dart --dart-define-from-file=config.prod.json --no-pub --obfuscate --split-debug-info="./build/app/outputs/bundle/release/" {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} + - open ./build/app/outputs/bundle/release/ + ios: desc: Building iOS IPA deps: [clean, get] aliases: [i] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Building iOS IPA...{{.COLOROFF}}" - - flutter build ipa --target=lib/main_production --no-pub + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Building iOS IPA...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter build ipa lib/main_production.dart --dart-define-from-file=config.prod.json --no-pub --obfuscate --split-debug-info="./build/ios/archive" {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} + - find "./build/ios/archive" -name "*.xcarchive" -exec open {} \; diff --git a/apps/wyatt_app_template/starting_template/automation/generator.yml b/apps/wyatt_app_template/starting_template/automation/generator.yml index 6c86a1a..69bc76b 100644 --- a/apps/wyatt_app_template/starting_template/automation/generator.yml +++ b/apps/wyatt_app_template/starting_template/automation/generator.yml @@ -13,7 +13,7 @@ tasks: internal: true desc: Gets dependencies. cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Getting the dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Getting the dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub get build: @@ -21,7 +21,7 @@ tasks: deps: [get] aliases: [b] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running build runner...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner build intl: @@ -29,28 +29,36 @@ tasks: deps: [get] aliases: [i] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running intl generation...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running intl generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter gen-l10n + + splash: + desc: Generating splash screen + deps: [get] + aliases: [s] + cmds: + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running splash screen generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - dart run flutter_native_splash:create + + icons: + desc: Generating icons + deps: [get] + aliases: [ic] + cmds: + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running icon generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - dart run flutter_launcher_icons build-delete: desc: Running build runner with deletion of conflicting outputs deps: [get] aliases: [d] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner with deletion of conflicting outputs...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running build runner with deletion of conflicting outputs...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner build --delete-conflicting-outputs clean: desc: Cleaning build runner aliases: [c] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Cleaning build runner...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Cleaning build runner...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner clean - - watch: - desc: Running build runner in watch mode - deps: [get] - aliases: [w] - cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner in watch mode...{{.COLOROFF}}" - - flutter pub run build_runner watch diff --git a/apps/wyatt_app_template/starting_template/automation/pub.yml b/apps/wyatt_app_template/starting_template/automation/pub.yml index fe49212..035d6d1 100644 --- a/apps/wyatt_app_template/starting_template/automation/pub.yml +++ b/apps/wyatt_app_template/starting_template/automation/pub.yml @@ -13,21 +13,21 @@ tasks: desc: Getting latest dependencies aliases: [g] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Getting latest dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Getting latest dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub get upgrade: desc: Upgrading dependencies aliases: [u] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Upgrading dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade upgrade-major: desc: Upgrading dependencies aliases: [um] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies --major-versions...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Upgrading dependencies --major-versions...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade --major-versions outdated: @@ -35,13 +35,5 @@ tasks: deps: [upgrade] aliases: [o] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Checking for outdated dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Checking for outdated dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade - - validate: - desc: Running dependency validator - deps: [get] - aliases: [v] - cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Validating dependencies...{{.COLOROFF}}" - - flutter pub run dependency_validator diff --git a/apps/wyatt_app_template/starting_template/automation/run.yml b/apps/wyatt_app_template/starting_template/automation/run.yml index 0ddc9c4..0290f77 100644 --- a/apps/wyatt_app_template/starting_template/automation/run.yml +++ b/apps/wyatt_app_template/starting_template/automation/run.yml @@ -13,26 +13,26 @@ tasks: desc: Show log output for running Flutter apps aliases: [l] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Showing log output for running Flutter apps...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Showing log output for running Flutter apps...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter logs dev: desc: Run app in development environment aliases: [d] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (development)...{{.COLOROFF}}" - - flutter run --target lib/main_development.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (development)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_development.dart --dart-define-from-file=config.dev.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} staging: desc: Run app in staging environment aliases: [s] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (staging)...{{.COLOROFF}}" - - flutter run --target lib/main_staging.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (staging)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_staging.dart --dart-define-from-file=config.staging.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} prod: desc: Run app in production environment aliases: [p] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (production)...{{.COLOROFF}}" - - flutter run --target lib/main_production.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (production)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_production.dart --dart-define-from-file=config.prod.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} diff --git a/apps/wyatt_app_template/starting_template/config.dev.json b/apps/wyatt_app_template/starting_template/config.dev.json new file mode 100644 index 0000000..9e07da1 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/config.dev.json @@ -0,0 +1,6 @@ +{ + "ENV_NAME": "dev", + "DATA_SOURCE": "api", + "LOGGER_LEVEL": "debug", + "FEATURE_FLAGS": "logger" +} diff --git a/apps/wyatt_app_template/starting_template/config.json b/apps/wyatt_app_template/starting_template/config.json deleted file mode 100644 index 356801b..0000000 --- a/apps/wyatt_app_template/starting_template/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "FIREBASE_EMULATOR_CLOUD_FUNCTION_PORT": 5001, - "FIREBASE_EMULATOR_FIRESTORE_PORT": 8080, - "FIREBASE_EMULATOR_AUTH_PORT": 9099, - "FIREBASE_EMULATOR_STORAGE_PORT": 919911, - "FIREBASE_EMULATOR_HOST": "localhost", - "DEV_MODE": "local" -} diff --git a/apps/wyatt_app_template/starting_template/config.prod.json b/apps/wyatt_app_template/starting_template/config.prod.json new file mode 100644 index 0000000..38e0b4a --- /dev/null +++ b/apps/wyatt_app_template/starting_template/config.prod.json @@ -0,0 +1,4 @@ +{ + "ENV_NAME": "prod", + "DATA_SOURCE": "api" +} diff --git a/apps/wyatt_app_template/starting_template/config.staging.json b/apps/wyatt_app_template/starting_template/config.staging.json new file mode 100644 index 0000000..f926b98 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/config.staging.json @@ -0,0 +1,5 @@ +{ + "ENV_NAME": "staging", + "DATA_SOURCE": "api", + "FEATURE_FLAGS": "logger" +} diff --git a/apps/wyatt_app_template/starting_template/ios/.gitignore b/apps/wyatt_app_template/starting_template/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/apps/wyatt_app_template/starting_template/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/apps/wyatt_app_template/starting_template/ios/Flutter/AppFrameworkInfo.plist b/apps/wyatt_app_template/starting_template/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9625e10..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/apps/wyatt_app_template/starting_template/ios/Flutter/Debug.xcconfig b/apps/wyatt_app_template/starting_template/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/apps/wyatt_app_template/starting_template/ios/Flutter/Release.xcconfig b/apps/wyatt_app_template/starting_template/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bf..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/apps/wyatt_app_template/starting_template/ios/Podfile b/apps/wyatt_app_template/starting_template/ios/Podfile deleted file mode 100644 index 88359b2..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Podfile +++ /dev/null @@ -1,41 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/apps/wyatt_app_template/starting_template/ios/Podfile.lock b/apps/wyatt_app_template/starting_template/ios/Podfile.lock deleted file mode 100644 index cf0efe4..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Podfile.lock +++ /dev/null @@ -1,28 +0,0 @@ -PODS: - - Flutter (1.0.0) - - flutter_native_splash (0.0.1): - - Flutter - - url_launcher_ios (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - flutter_native_splash: - :path: ".symlinks/plugins/flutter_native_splash/ios" - url_launcher_ios: - :path: ".symlinks/plugins/url_launcher_ios/ios" - -SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2 - -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 - -COCOAPODS: 1.11.3 diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.pbxproj b/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index f386268..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,556 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 50F1D9CF301DADBFF7F91098 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 01240B090F6ECE02483CB484 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 18B4FB2B44E101F10AB8D41B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EA780011634A6BC46817CBE0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 50F1D9CF301DADBFF7F91098 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 10872F84FB14C7DD915284C6 /* Pods */ = { - isa = PBXGroup; - children = ( - 18B4FB2B44E101F10AB8D41B /* Pods-Runner.debug.xcconfig */, - 01240B090F6ECE02483CB484 /* Pods-Runner.release.xcconfig */, - EA780011634A6BC46817CBE0 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - 4204558B17A62367423769E8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 10872F84FB14C7DD915284C6 /* Pods */, - 4204558B17A62367423769E8 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - B0C681F6443208846EBFB7D2 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - CF936C6216E6F00FB5F73F4C /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - B0C681F6443208846EBFB7D2 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - CF936C6216E6F00FB5F73F4C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.start; - PRODUCT_NAME = "Display Name"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.start; - PRODUCT_NAME = "Display Name"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.start; - PRODUCT_NAME = "Display Name"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index c87d15a..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/contents.xcworkspacedata b/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc1..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/AppDelegate.swift b/apps/wyatt_app_template/starting_template/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -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. \ No newline at end of file diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/LaunchScreen.storyboard b/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/Main.storyboard b/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Info.plist b/apps/wyatt_app_template/starting_template/ios/Runner/Info.plist deleted file mode 100644 index 69cdb0e..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Display Name - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Display Name - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - \ No newline at end of file diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Runner-Bridging-Header.h b/apps/wyatt_app_template/starting_template/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a5..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/apps/wyatt_app_template/starting_template/ios/Runner/Runner.entitlements b/apps/wyatt_app_template/starting_template/ios/Runner/Runner.entitlements deleted file mode 100644 index 74c85d2..0000000 --- a/apps/wyatt_app_template/starting_template/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - aps-environment - development - - \ No newline at end of file diff --git a/apps/wyatt_app_template/starting_template/l10n.yaml b/apps/wyatt_app_template/starting_template/l10n.yaml index aeed2b1..ad731f3 100644 --- a/apps/wyatt_app_template/starting_template/l10n.yaml +++ b/apps/wyatt_app_template/starting_template/l10n.yaml @@ -5,4 +5,5 @@ output-dir: lib/gen/ nullable-getter: false use-deferred-loading: true synthetic-package: false -header: "/// Display Name, localized files. Automatically generated with `task gen:intl`." \ No newline at end of file +use-escaping: false +header: "/// Display Name, localized files. Automatically generated with `task gen:intl`." diff --git a/apps/wyatt_app_template/starting_template/lib/bootstrap.dart b/apps/wyatt_app_template/starting_template/lib/bootstrap.dart index e8a35ff..3905dd8 100644 --- a/apps/wyatt_app_template/starting_template/lib/bootstrap.dart +++ b/apps/wyatt_app_template/starting_template/lib/bootstrap.dart @@ -2,18 +2,44 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:logging/logging.dart'; import 'package:starting_template/core/dependency_injection/get_it.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; +import 'package:starting_template/core/enums/feature_flag.dart'; +import 'package:starting_template/core/logger/app_logger.dart'; +import 'package:starting_template/core/logger/simple_log_printer.dart'; import 'package:starting_template/core/utils/app_bloc_observer.dart'; +import 'package:starting_template/core/utils/env.dart'; Future bootstrap(FutureOr Function() builder) async { - WidgetsFlutterBinding.ensureInitialized(); + // Initialize logging + final logger = AppLogger(); - Bloc.observer = AppBlocObserver(); + await runZonedGuarded( + () async { + WidgetsFlutterBinding.ensureInitialized(); - debugPrint('${Flavor.instance}'); + // Verify that we have the correct environment + Env.verify(); - await GetItInitializer.init(); + if (Env.isFeatureEnabled(FeatureFlag.logger)) { + logger + ..level = Env.loggerLevel + ..addPlugin(const SimpleLogPrinter()); + } else { + logger.level = Level.OFF; + } - runApp(await builder()); + debugPrint(Env.summary); // Print even if logger is disabled + + Bloc.observer = AppBlocObserver(); + + // Intialize dependencies injection + await GetItInitializer.init(); + + runApp(await builder()); + }, + (error, stackTrace) { + logger.error(error.toString(), stackTrace); + }, + ); } diff --git a/apps/wyatt_app_template/starting_template/lib/core/constants/build_config_key.dart b/apps/wyatt_app_template/starting_template/lib/core/constants/build_config_key.dart new file mode 100644 index 0000000..f726479 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/constants/build_config_key.dart @@ -0,0 +1,163 @@ +const String _envName = 'ENV_NAME'; +const String _dataSource = 'DATA_SOURCE'; +const String _loggerLevel = 'LOGGER_LEVEL'; +const String _featureFlags = 'FEATURE_FLAGS'; + +enum BuildConfigKey { + envName(_envName, isRequired: true), + dataSource(_dataSource, isRequired: true), + loggerLevel(_loggerLevel), + featureFlags(_featureFlags); + + const BuildConfigKey(this.key, {this.isRequired = false}); + + final String key; + final bool isRequired; + + /// Returns true if the environment variable is defined + /// + /// Cannot use `const bool.hasEnvironment(key)` because it is not a + /// constant expression. This is why we need to use a switch statement. + bool get isDefined => switch (this) { + BuildConfigKey.envName => const bool.hasEnvironment(_envName), + BuildConfigKey.dataSource => const bool.hasEnvironment(_dataSource), + BuildConfigKey.loggerLevel => const bool.hasEnvironment(_loggerLevel), + BuildConfigKey.featureFlags => const bool.hasEnvironment(_featureFlags), + }; + + /// Returns the value of the environment variable + /// + /// Cannot use `const String.fromEnvironment(key)` because it is not a + /// constant expression. This is why we need to use a switch statement. + String get stringFromEnv => switch (this) { + BuildConfigKey.envName => const String.fromEnvironment(_envName), + BuildConfigKey.dataSource => const String.fromEnvironment(_dataSource), + BuildConfigKey.loggerLevel => + const String.fromEnvironment(_loggerLevel), + BuildConfigKey.featureFlags => + const String.fromEnvironment(_featureFlags), + }; + + /// Returns the values of the environment variables + static String get summary { + final summary = StringBuffer(); + for (final key in BuildConfigKey.values) { + if (key.isRequired && !key.isDefined) { + summary.writeln('${key.key} is not defined (required)'); + continue; + } + if (key.isDefined) { + summary.writeln('${key.key}: ${key.stringFromEnv}'); + continue; + } + } + + return summary.toString(); + } + + /// Returns the value of the environment variable + /// + /// If the environment variable is not defined, returns null + T? getOrNull() { + try { + return get(); + } catch (_) { + return null; + } + } + + /// Returns the value of the environment variable + /// + /// If the environment variable is not defined, returns the value of [or] + T getOr(T Function() or) { + switch (T) { + case String: + return _getStringOr(or as String Function()) as T; + case int: + return _getIntOr(or as int Function()) as T; + case double: + return _getDoubleOr(or as double Function()) as T; + case bool: + return _getBool() as T; + default: + throw Exception('Type $T is not supported'); + } + } + + /// Returns the value of the environment variable + /// + /// Throws an exception if the environment variable is not defined + T get() { + switch (T) { + case String: + return _getString() as T; + case int: + return _getInt() as T; + case double: + return _getDouble() as T; + case bool: + return _getBool() as T; + default: + throw Exception('Type $T is not supported'); + } + } + + String _getString() { + final value = stringFromEnv; + if (value.isEmpty) { + throw Exception('$key is not defined'); + } + + return value; + } + + int _getInt() { + // Use int.tryParse instead int.fromEnvironment because we want to + // support 0 as a value too. + final value = int.tryParse(stringFromEnv); + if (value == null) { + throw Exception('$key is not defined'); + } + + return value; + } + + double _getDouble() { + final value = double.tryParse(stringFromEnv); + if (value == null) { + throw Exception('$key is not defined'); + } + + return value; + } + + bool _getBool() { + final value = stringFromEnv.toLowerCase(); + + return value == 'true' || value == '1'; + } + + double _getDoubleOr(double Function() or) { + try { + return _getDouble(); + } catch (_) { + return or(); + } + } + + String _getStringOr(String Function() or) { + try { + return _getString(); + } catch (_) { + return or(); + } + } + + int _getIntOr(int Function() or) { + try { + return _getInt(); + } catch (_) { + return or(); + } + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/constants/constants.dart b/apps/wyatt_app_template/starting_template/lib/core/constants/constants.dart new file mode 100644 index 0000000..5ca88f8 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/constants/constants.dart @@ -0,0 +1 @@ +const int kBlocObserverMessageLength = 100; diff --git a/apps/wyatt_app_template/starting_template/lib/core/constants/emulator.dart b/apps/wyatt_app_template/starting_template/lib/core/constants/emulator.dart deleted file mode 100644 index 0097c95..0000000 --- a/apps/wyatt_app_template/starting_template/lib/core/constants/emulator.dart +++ /dev/null @@ -1,18 +0,0 @@ -/// Firebase Emulator constants. -/// -/// If you don't use Firebase, it can be safely deleted. -abstract class Emulator { - static const String firebaseCloudFunctionEnvKey = - 'FIREBASE_EMULATOR_CLOUD_FUNCTION_PORT'; - static const String firebaseFirestoreEnvKey = - 'FIREBASE_EMULATOR_FIRESTORE_PORT'; - static const String firebaseAuthEnvKey = 'FIREBASE_EMULATOR_AUTH_PORT'; - static const String firebaseStorageEnvKey = 'FIREBASE_EMULATOR_STORAGE_PORT'; - static const String hostEnvKey = 'FIREBASE_EMULATOR_HOST'; - - static const int defaultFirebaseCloudFunctionPort = 5001; - static const int defaultFirebaseFirestorePort = 8080; - static const int defaultFirebaseAuthPort = 9099; - static const int defaultFirebaseStoragePort = 9199; - static const defaultHost = 'localhost'; -} diff --git a/apps/wyatt_app_template/starting_template/lib/core/dependency_injection/get_it.dart b/apps/wyatt_app_template/starting_template/lib/core/dependency_injection/get_it.dart index ea82681..8ab88a0 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/dependency_injection/get_it.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/dependency_injection/get_it.dart @@ -1,52 +1,56 @@ import 'dart:async'; -import 'package:flutter/foundation.dart'; import 'package:get_it/get_it.dart'; -import 'package:starting_template/core/enums/dev_mode.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; -import 'package:starting_template/core/utils/firebase_emulator.dart'; +import 'package:starting_template/core/enums/data_source_type.dart'; +import 'package:starting_template/core/logger/app_logger.dart'; +import 'package:starting_template/core/utils/env.dart'; final getIt = GetIt.I; /// Service and Data Source locator abstract class GetItInitializer { + static AppLogger get logger => AppLogger('GetItInitializer'); + static FutureOr _initCommon() async { - // TODO(wyatt): Initialize common sources/services + logger.info('Initializing common sources/services'); } static FutureOr _initMock() async { - // TODO(wyatt): Initialize mocked sources/services. + logger.info('Initializing mock sources'); } - static FutureOr _initLocal() async { - // TODO(wyatt): Initialize local sources/services. - final emulator = FirebaseEmulator.fromEnv(); - debugPrint('Firebase Emulator: $emulator'); + static FutureOr _initApi() async { + logger.info('Initializing API sources'); } - static FutureOr _initReal() async { - // TODO(wyatt): Initialize real sources/services + static FutureOr _initRepositories() async { + logger.info('Initializing repositories'); + } + + static FutureOr _initUseCases() async { + logger.info('Initializing use cases'); } static FutureOr init() async { // Initialize common sources/services await _initCommon(); - // Initialize sources/services based on flavor - switch (Flavor.instance.devMode) { - case DevMode.mock: + // Initialize sources/services based on data source type + switch (Env.dataSource) { + case DataSourceType.mock: await _initMock(); break; - case DevMode.local: - await _initLocal(); + case DataSourceType.api: + await _initApi(); break; - case DevMode.real: - await _initReal(); - break; - case null: - throw Exception('DevMode not initialized!'); } + // Initialize repositories + await _initRepositories(); + + // Initialize use cases + await _initUseCases(); + await getIt.allReady(); } } diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/build_mode.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/build_mode.dart deleted file mode 100644 index 0aa4421..0000000 --- a/apps/wyatt_app_template/starting_template/lib/core/enums/build_mode.dart +++ /dev/null @@ -1,31 +0,0 @@ -enum BuildMode { - /// Debug build mode. Pass `--debug` to `flutter run` or `flutter build` to - /// use this mode. - debug, - - /// Release build mode. Pass `--profile` to `flutter run` or `flutter build` - /// to use this mode. - profile, - - /// Release build mode. Pass `--release` to `flutter run` or `flutter build` - /// to use this mode. - release; - - @override - String toString() => name; - - /// Tries to parse String and returns mode. Fallback is returned if there - /// is an error during parsing. - static BuildMode fromString( - String? mode, { - BuildMode fallback = BuildMode.debug, - }) { - for (final m in values) { - if (m.name == mode) { - return m; - } - } - - return fallback; - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/data_source_type.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/data_source_type.dart new file mode 100644 index 0000000..b5905c8 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/enums/data_source_type.dart @@ -0,0 +1,16 @@ +enum DataSourceType { + mock, + api; + + static DataSourceType fromString(String value) => DataSourceType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + + static DataSourceType? fromStringOr(String value, {DataSourceType? or}) { + try { + return DataSourceType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/dev_mode.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/dev_mode.dart deleted file mode 100644 index 3a628f9..0000000 --- a/apps/wyatt_app_template/starting_template/lib/core/enums/dev_mode.dart +++ /dev/null @@ -1,25 +0,0 @@ -enum DevMode { - /// Mocked data sources and services - mock, - - /// Local data sources and services, like local database, or firebase emulator - local, - - /// Real data sources and services, like firebase or other cloud services - real; - - @override - String toString() => name; - - /// Tries to parse String and returns mode. Fallback is returned if there - /// is an error during parsing. - static DevMode fromString(String? mode, {DevMode fallback = DevMode.mock}) { - for (final m in values) { - if (m.name == mode) { - return m; - } - } - - return fallback; - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/env_type.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/env_type.dart new file mode 100644 index 0000000..5e676f0 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/enums/env_type.dart @@ -0,0 +1,17 @@ +enum EnvType { + dev, + staging, + prod; + + static EnvType fromString(String value) => + EnvType.values.firstWhere((e) => e.name == value.toLowerCase().trim()); + + static EnvType? fromStringOr(String value, {EnvType? or}) { + try { + return EnvType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/feature_flag.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/feature_flag.dart new file mode 100644 index 0000000..bfbed60 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/enums/feature_flag.dart @@ -0,0 +1,18 @@ +enum FeatureFlag { + logger; + + static FeatureFlag fromString(String value) => FeatureFlag.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + + static FeatureFlag? fromStringOr(String value, {FeatureFlag? or}) { + try { + return FeatureFlag.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } + + @override + String toString() => name; +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/enums/page_protection.dart b/apps/wyatt_app_template/starting_template/lib/core/enums/page_protection.dart index 63a846d..4d63018 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/enums/page_protection.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/enums/page_protection.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - enum PageProtection { /// The page can be accessed without authentication. public, diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/build_context_extension.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/build_context_extension.dart index 1eabb49..711321d 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/extensions/build_context_extension.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/build_context_extension.dart @@ -2,5 +2,6 @@ import 'package:flutter/widgets.dart'; import 'package:starting_template/gen/app_localizations.dart'; extension BuildContextExtension on BuildContext { + /// Returns the [AppLocalizations] instance AppLocalizations get l10n => AppLocalizations.of(this); } diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/debuggable_bloc.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/debuggable_bloc.dart new file mode 100644 index 0000000..433bf09 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/debuggable_bloc.dart @@ -0,0 +1,19 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; + +extension DebuggableBloc on BlocBase { + static final _showInObserver = Expando(); + + bool get showInObserver => _showInObserver[this] ?? true; + + set showInObserver(bool value) => _showInObserver[this] = value; + + /// Show the bloc in the observer + void show() { + showInObserver = true; + } + + /// Hide the bloc from the observer + void hide() { + showInObserver = false; + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/get_it_extension.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/get_it_extension.dart new file mode 100644 index 0000000..692a4bf --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/get_it_extension.dart @@ -0,0 +1,26 @@ +import 'package:get_it/get_it.dart'; + +extension GetItExtension on GetIt { + void injectInterface( + T instanceToInject, { + String? instanceName, + }) { + registerSingleton(instanceToInject, instanceName: instanceName); + } + + void injectRepository(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectDataSource(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectUseCase(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectBloc(FactoryFunc func) { + registerFactory(func); + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_extension.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_guard.dart similarity index 63% rename from apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_extension.dart rename to apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_guard.dart index b5ec8f3..c9148d1 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_extension.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_guard.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'package:go_router/go_router.dart'; import 'package:starting_template/core/enums/page_protection.dart'; diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_list_extension.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_list_extension.dart new file mode 100644 index 0000000..b7a9fd6 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/go_route_list_extension.dart @@ -0,0 +1,21 @@ +import 'package:go_router/go_router.dart'; +import 'package:starting_template/core/extensions/go_route_guard.dart'; + +extension GoRouteListExtension on Iterable { + /// Returns a list of public routes. + List get publicRoutes => + where((route) => route.isPublic).toList(growable: false); + + /// Returns a list of protected routes. + List get protectedRoutes => + where((route) => route.isProtected).toList(growable: false); + + /// Returns a list of routes that are neither public nor protected. + List get noneRoutes => + where((route) => route.isNone).toList(growable: false); + + GoRoute fromName(String name) => firstWhere((route) => route.name == name); + GoRoute fromPath(String path) => firstWhere((route) => route.path == path); + + GoRoute operator [](String name) => fromName(name); +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/extensions/route_base_extension.dart b/apps/wyatt_app_template/starting_template/lib/core/extensions/route_base_extension.dart new file mode 100644 index 0000000..9866537 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/extensions/route_base_extension.dart @@ -0,0 +1,20 @@ +import 'package:go_router/go_router.dart'; + +/// Flatten the [GoRoute] tree. +extension RouteBaseExtension on RouteBase { + List flatten() { + final List routes = []; + if (this is GoRoute) { + routes.add(this as GoRoute); + } else if (this is ShellRoute) { + routes.addAll( + (this as ShellRoute) + .routes + .map((route) => route.flatten()) + .expand((routeList) => routeList), + ); + } + + return routes; + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/flavors/flavor.dart b/apps/wyatt_app_template/starting_template/lib/core/flavors/flavor.dart deleted file mode 100644 index 0207819..0000000 --- a/apps/wyatt_app_template/starting_template/lib/core/flavors/flavor.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:starting_template/core/enums/build_mode.dart'; -import 'package:starting_template/core/enums/dev_mode.dart'; - -class Flavor { - Flavor._({ - this.flavorName, - this.bannerColor, - }) { - // Determine build mode - buildMode = kReleaseMode - ? BuildMode.release - : kProfileMode - ? BuildMode.profile - : BuildMode.debug; - - // Retrieve dev mode, fallback to mock - devMode = DevMode.fromString( - const String.fromEnvironment('DEV_MODE', defaultValue: 'mock'), - ); - - _instance = this; - } - - static Flavor? _instance; - - final String? flavorName; - final Color? bannerColor; - - late final DevMode? devMode; - late final BuildMode? buildMode; - - /// Returns [Flavor] instance. - static Flavor get instance { - if (_instance == null) { - throw Exception('Flavor not initialized!'); - } - - return _instance!; - } - - String get name => flavorName ?? 'Unknown'; - Color get color => bannerColor ?? Colors.grey; - - static bool shouldShowBanner() => instance.buildMode != BuildMode.release; - - @override - String toString() => - 'Flavor: $flavorName, DevMode: $devMode, BuildMode: $buildMode'; -} - -class DevelopmentFlavor extends Flavor { - DevelopmentFlavor() - : super._(flavorName: 'Development', bannerColor: Colors.red); -} - -class StagingFlavor extends Flavor { - StagingFlavor() : super._(flavorName: 'Staging', bannerColor: Colors.orange); -} - -class ProductionFlavor extends Flavor { - ProductionFlavor() - : super._(flavorName: 'Production', bannerColor: Colors.green); -} diff --git a/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger.dart b/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger.dart new file mode 100644 index 0000000..8e8088f --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger.dart @@ -0,0 +1,81 @@ +import 'package:logging/logging.dart'; +import 'package:starting_template/core/logger/app_logger_plugin.dart'; +import 'package:starting_template/core/logger/log_level.dart'; +import 'package:starting_template/core/mixins/debuggable.dart'; + +class AppLogger with Debuggable { + /// Creates a top-level [AppLogger]. + factory AppLogger([String namespace = rootNamespace]) { + if (!namespace.startsWith(rootNamespace)) { + namespace = '$rootNamespace.$namespace'; + } + + return AppLogger.activeLoggers[namespace] ??= AppLogger._(namespace); + } + + AppLogger._(String namespace) : _logger = Logger(namespace); + + /// The root namespace for all [AppLogger]s. + static const rootNamespace = 'StartingTemplate'; + + static final Map activeLoggers = {}; + + String get namespace => _logger.fullName; + + final Logger _logger; + + AppLogger createChild(String name) { + assert(name.isNotEmpty, 'Name should not be empty'); + + return AppLogger('$namespace.$name'); + } + + Level get level => _logger.level; + + set level(Level level) { + hierarchicalLoggingEnabled = true; + _logger.level = level; + } + + void addPlugin(AppLoggerPlugin plugin) { + _logger.onRecord.listen(plugin.handleLogRecord); + } + + /// Logs a [message] at the given [level]. + void log( + Level level, + String message, [ + Object? error, + StackTrace? stackTrace, + ]) { + _logger.log(level, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.verbose]. + void verbose(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.verbose, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.debug]. + void debug(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.debug, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.info]. + void info(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.info, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.warn]. + void warn(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.warn, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.error]. + void error(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.error, message, error, stackTrace); + } + + @override + String get debugName => 'AppLogger'; +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger_plugin.dart b/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger_plugin.dart new file mode 100644 index 0000000..67c2961 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/logger/app_logger_plugin.dart @@ -0,0 +1,7 @@ +import 'package:logging/logging.dart'; + +abstract class AppLoggerPlugin { + const AppLoggerPlugin(); + + void handleLogRecord(LogRecord record); +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/logger/log_level.dart b/apps/wyatt_app_template/starting_template/lib/core/logger/log_level.dart new file mode 100644 index 0000000..9dea729 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/logger/log_level.dart @@ -0,0 +1,20 @@ +import 'package:logging/logging.dart'; + +abstract class LogLevel { + static const Level verbose = Level('VERBOSE', 300); + static const Level bloc = Level('BLOC', 450); + static const Level debug = Level('DEBUG', 500); + static const Level info = Level.INFO; + static const Level warn = Level.WARNING; + static const Level error = Level('ERROR', 1000); + + static Level fromString(String value) => switch (value.toLowerCase()) { + 'verbose' => verbose, + 'bloc' => bloc, + 'debug' => debug, + 'info' => info, + 'warn' || 'warning' => warn, + 'error' || 'fail' || 'failure' => error, + _ => throw Exception('Unknown log level: $value'), + }; +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/logger/simple_log_printer.dart b/apps/wyatt_app_template/starting_template/lib/core/logger/simple_log_printer.dart new file mode 100644 index 0000000..8bc5714 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/logger/simple_log_printer.dart @@ -0,0 +1,40 @@ +import 'package:logging/logging.dart'; +import 'package:starting_template/core/logger/app_logger_plugin.dart'; + +class SimpleLogPrinter implements AppLoggerPlugin { + const SimpleLogPrinter(); + + /// Formats [LogRecord] using level, namespace, and message components. + static String formatLogRecord(LogRecord record) { + final buffer = StringBuffer() + ..write(record.level.name.toUpperCase()) + ..write(' | '); + + final namespace = record.loggerName.split('.').lastOrNull; + if (namespace != null && namespace.isNotEmpty) { + buffer + ..write(namespace) + ..write(' | '); + } + + buffer.write(record.message); + final error = record.error; + if (error != null) { + buffer + ..write(': ') + ..writeln(error); + } + final stackTrace = record.stackTrace; + if (stackTrace != null) { + buffer.writeln(stackTrace); + } + + return buffer.toString(); + } + + @override + void handleLogRecord(LogRecord record) { + // ignore: avoid_print + print(formatLogRecord(record)); + } +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/mixins/debuggable.dart b/apps/wyatt_app_template/starting_template/lib/core/mixins/debuggable.dart new file mode 100644 index 0000000..a3f7e4b --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/mixins/debuggable.dart @@ -0,0 +1,3 @@ +mixin Debuggable { + String get debugName; +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/mixins/loggable.dart b/apps/wyatt_app_template/starting_template/lib/core/mixins/loggable.dart new file mode 100644 index 0000000..bb8268d --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/mixins/loggable.dart @@ -0,0 +1,6 @@ +import 'package:starting_template/core/logger/app_logger.dart'; +import 'package:starting_template/core/mixins/debuggable.dart'; + +mixin Loggable on Debuggable { + AppLogger get logger => AppLogger().createChild(debugName); +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/routes/router.dart b/apps/wyatt_app_template/starting_template/lib/core/routes/app_router.dart similarity index 51% rename from apps/wyatt_app_template/starting_template/lib/core/routes/router.dart rename to apps/wyatt_app_template/starting_template/lib/core/routes/app_router.dart index da9eada..63b0ae8 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/routes/router.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/routes/app_router.dart @@ -1,7 +1,8 @@ import 'package:flutter/cupertino.dart'; import 'package:go_router/go_router.dart'; import 'package:starting_template/core/enums/page_protection.dart'; -import 'package:starting_template/core/extensions/go_route_extension.dart'; +import 'package:starting_template/core/extensions/go_route_guard.dart'; +import 'package:starting_template/core/extensions/route_base_extension.dart'; import 'package:starting_template/core/routes/go_router_refresh_stream.dart'; import 'package:starting_template/presentation/features/home/home.dart'; @@ -32,11 +33,20 @@ abstract class AppRouter { )..setPublic(), ]; + /// Singleton instance of [GoRouter] + static GoRouter? _router; + + /// Navigator key for the root navigator + static final GlobalKey rootNavigatorKey = + GlobalKey(); + /// Router - static GoRouter routerOf(BuildContext context) => GoRouter( + static GoRouter routerOf(BuildContext context) => _router ??= GoRouter( initialLocation: '/', routes: AppRouter.routes, + navigatorKey: rootNavigatorKey, debugLogDiagnostics: true, + refreshListenable: GoRouterRefreshStream(const Stream.empty()), // TODO(wyatt): Add authentication logic redirect: (context, state) { /// Define the default guard @@ -44,17 +54,34 @@ abstract class AppRouter { /// does not have a guard set. (It is set to [PageProtection.none]) const defaultGuard = PageProtection.protected; - // Compute current route - // Compute current route - final currentRoute = AppRouter.routes.firstWhere( - (route) => route.path == state.location, - ); + /// Recursively get all routes and subroutes in a one-dimensional list + /// This will work for any level of nesting + final routes = + AppRouter.routes.map((route) => route.flatten()).expand( + (routeList) => routeList, + ); - // Get the guard of the current route - final guard = currentRoute.guard; + /// Matches is a list of all routes that match the current uri + final matches = _router?.configuration + .findMatch( + state.uri.toString(), + ) + .routes + .map((route) => route.flatten()) + .expand( + (routeList) => routeList, + ) ?? + routes; + + /// Get the current route + final currentRoute = matches.last; + + /// Get the guard of the current route + final guard = (currentRoute.guard == PageProtection.none) + ? defaultGuard + : currentRoute.guard; return null; }, - refreshListenable: GoRouterRefreshStream(const Stream.empty()), ); } diff --git a/apps/wyatt_app_template/starting_template/lib/core/routes/go_router_refresh_stream.dart b/apps/wyatt_app_template/starting_template/lib/core/routes/go_router_refresh_stream.dart index b37ca83..269555c 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/routes/go_router_refresh_stream.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/routes/go_router_refresh_stream.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'dart:async'; import 'package:flutter/foundation.dart'; diff --git a/apps/wyatt_app_template/starting_template/lib/core/utils/app_bloc_observer.dart b/apps/wyatt_app_template/starting_template/lib/core/utils/app_bloc_observer.dart index 92be592..a72e9da 100644 --- a/apps/wyatt_app_template/starting_template/lib/core/utils/app_bloc_observer.dart +++ b/apps/wyatt_app_template/starting_template/lib/core/utils/app_bloc_observer.dart @@ -1,9 +1,11 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:starting_template/core/constants/constants.dart'; +import 'package:starting_template/core/extensions/debuggable_bloc.dart'; +import 'package:starting_template/core/logger/log_level.dart'; +import 'package:starting_template/core/mixins/debuggable.dart'; +import 'package:starting_template/core/mixins/loggable.dart'; -const _messageLength = 100; - -class AppBlocObserver extends BlocObserver { +class AppBlocObserver extends BlocObserver with Debuggable, Loggable { AppBlocObserver({ this.printEvent = true, this.printError = true, @@ -18,6 +20,9 @@ class AppBlocObserver extends BlocObserver { final bool printTransition; final bool fullPrint; + @override + String get debugName => 'AppBlocObserver'; + String sanitize(Object? object) { final message = object.toString(); @@ -25,25 +30,33 @@ class AppBlocObserver extends BlocObserver { ? message : message.substring( 0, - message.length < _messageLength ? message.length : _messageLength, + message.length < kBlocObserverMessageLength + ? message.length + : kBlocObserverMessageLength, ); } @override void onEvent(Bloc bloc, Object? event) { super.onEvent(bloc, event); - if (printEvent) { - debugPrint('onEvent: ${bloc.runtimeType}\n' - '> event: ${sanitize(event)}'); + if (printEvent && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonEvent: ${bloc.runtimeType}\n' + '> event: ${sanitize(event)}', + ); } } @override void onError(BlocBase bloc, Object error, StackTrace stackTrace) { - if (printError) { - debugPrint('onError: ${bloc.runtimeType}\n' - '> error: ${sanitize(error)}\n' - '$stackTrace'); + if (printError && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonError: ${bloc.runtimeType}\n' + '> error: ${sanitize(error)}\n' + '$stackTrace', + ); } super.onError(bloc, error, stackTrace); } @@ -51,10 +64,13 @@ class AppBlocObserver extends BlocObserver { @override void onChange(BlocBase bloc, Change change) { super.onChange(bloc, change); - if (printChange) { - debugPrint('onChange: ${bloc.runtimeType}\n' - '> currentState: ${sanitize(change.currentState)}\n' - '> nextState: ${sanitize(change.nextState)}'); + if (printChange && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonChange: ${bloc.runtimeType}\n' + '> currentState: ${sanitize(change.currentState)}\n' + '> nextState: ${sanitize(change.nextState)}', + ); } } @@ -64,11 +80,14 @@ class AppBlocObserver extends BlocObserver { Transition transition, ) { super.onTransition(bloc, transition); - if (printTransition) { - debugPrint('onTransition: ${bloc.runtimeType}\n' - '> currentState: ${sanitize(transition.currentState)}\n' - '> event: ${sanitize(transition.event)}\n' - '> nextState: ${sanitize(transition.nextState)}'); + if (printTransition && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonTransition: ${bloc.runtimeType}\n' + '> currentState: ${sanitize(transition.currentState)}\n' + '> event: ${sanitize(transition.event)}\n' + '> nextState: ${sanitize(transition.nextState)}', + ); } } } diff --git a/apps/wyatt_app_template/starting_template/lib/core/utils/env.dart b/apps/wyatt_app_template/starting_template/lib/core/utils/env.dart new file mode 100644 index 0000000..e9c6c03 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/core/utils/env.dart @@ -0,0 +1,116 @@ +import 'package:logging/logging.dart'; +import 'package:starting_template/core/constants/build_config_key.dart'; +import 'package:starting_template/core/enums/data_source_type.dart'; +import 'package:starting_template/core/enums/env_type.dart'; +import 'package:starting_template/core/enums/feature_flag.dart'; +import 'package:starting_template/core/logger/log_level.dart'; + +abstract class Env { + /// Check if all **required** environment variables are defined, and throw + /// an exception if not + static void verify() { + final List missingKeys = []; + + // Check required environment variables + for (final key in BuildConfigKey.values) { + if (key.isRequired && !key.isDefined) { + missingKeys.add(key); + } + } + + if (missingKeys.isNotEmpty) { + throw Exception( + 'Missing environment variables: ' + '${missingKeys.map((e) => e.key).join(', ')}', + ); + } + + // Check optional environment variables + // TODO(Wyatt): Check optional environment variables, for example: + // if DataSource is API, then check for API base URL. + } + + // REQUIRED ENVIRONMENT VARIABLES + + /// Returns environment type + static EnvType get type => EnvType.fromString(BuildConfigKey.envName.get()); + + /// Returns the data source type + static DataSourceType get dataSource => + DataSourceType.fromString(BuildConfigKey.dataSource.get()); + + // OPTIONAL ENVIRONMENT VARIABLES (can be null or have a default value) + + /// Returns the logger level + static Level get loggerLevel => + LogLevel.fromString(BuildConfigKey.loggerLevel.getOr(() => 'info')); + + /// Returns the feature flags + static List get featureFlags { + final flags = BuildConfigKey.featureFlags.getOr(() => ''); + if (flags.isEmpty) { + return []; + } + + return flags + .split(',') + .map(FeatureFlag.fromString) + .whereType() + .toList(); + } + + // TODO(Wyatt): Add more environment variables here + + // HELPER METHODS + + /// Returns true if the environment is production + static bool get isProduction => type == EnvType.prod; + + /// Returns true if the environment is staging + static bool get isStaging => type == EnvType.staging; + + /// Returns true if the environment is development + static bool get isDevelopment => type == EnvType.dev; + + /// Returns true if the data source is API + static bool get dataSourceIsApi => dataSource == DataSourceType.api; + + /// Returns true if the data source is mock + static bool get dataSourceIsMock => dataSource == DataSourceType.mock; + + /// Retourns true if a feature is enabled + static bool isFeatureEnabled(FeatureFlag feature) => + featureFlags.contains(feature); + + /// Returns true if a feature is disabled + static bool isFeatureDisabled(FeatureFlag feature) => + !isFeatureEnabled(feature); + + /// Returns true if a list of features is enabled + static bool areFeaturesEnabled(List features) { + for (final feature in features) { + if (!isFeatureEnabled(feature)) { + return false; + } + } + + return true; + } + + /// Returns true if a list of features is disabled + static bool areFeaturesDisabled(List features) { + for (final feature in features) { + if (isFeatureEnabled(feature)) { + return false; + } + } + + return true; + } + + /// Returns environment name + static String get name => type.name; + + /// Returns environment summary + static String get summary => BuildConfigKey.summary; +} diff --git a/apps/wyatt_app_template/starting_template/lib/core/utils/firebase_emulator.dart b/apps/wyatt_app_template/starting_template/lib/core/utils/firebase_emulator.dart deleted file mode 100644 index 9b9f828..0000000 --- a/apps/wyatt_app_template/starting_template/lib/core/utils/firebase_emulator.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:starting_template/core/constants/emulator.dart'; - -class FirebaseEmulator { - const FirebaseEmulator._({ - required this.cloudFunctionPort, - required this.firestorePort, - required this.authPort, - required this.storagePort, - required this.host, - }); - - factory FirebaseEmulator.fromEnv() => const FirebaseEmulator._( - cloudFunctionPort: int.fromEnvironment( - Emulator.firebaseCloudFunctionEnvKey, - defaultValue: Emulator.defaultFirebaseCloudFunctionPort, - ), - firestorePort: int.fromEnvironment( - Emulator.firebaseFirestoreEnvKey, - defaultValue: Emulator.defaultFirebaseFirestorePort, - ), - authPort: int.fromEnvironment( - Emulator.firebaseAuthEnvKey, - defaultValue: Emulator.defaultFirebaseAuthPort, - ), - storagePort: int.fromEnvironment( - Emulator.firebaseStorageEnvKey, - defaultValue: Emulator.defaultFirebaseStoragePort, - ), - host: String.fromEnvironment( - Emulator.hostEnvKey, - defaultValue: Emulator.defaultHost, - ), - ); - - final int cloudFunctionPort; - final int firestorePort; - final int authPort; - final int storagePort; - final String host; - - @override - String toString() => 'FirebaseEmulator(cloudFunctionPort: ' - '$cloudFunctionPort, firestorePort: $firestorePort, authPort: $authPort, ' - 'storagePort: $storagePort, host: $host)'; -} diff --git a/apps/wyatt_app_template/starting_template/lib/data/data_sources/remote/.gitkeep b/apps/wyatt_app_template/starting_template/lib/data/data_sources/.gitkeep similarity index 100% rename from apps/wyatt_app_template/starting_template/lib/data/data_sources/remote/.gitkeep rename to apps/wyatt_app_template/starting_template/lib/data/data_sources/.gitkeep diff --git a/apps/wyatt_app_template/starting_template/lib/data/data_sources/local/counter_data_source_impl.dart b/apps/wyatt_app_template/starting_template/lib/data/data_sources/local/counter_data_source_impl.dart deleted file mode 100644 index 85cdfe0..0000000 --- a/apps/wyatt_app_template/starting_template/lib/data/data_sources/local/counter_data_source_impl.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'dart:convert'; - -import 'package:starting_template/data/models/integer_model.dart'; -import 'package:starting_template/domain/data_sources/local/counter_data_source.dart'; -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class CounterDataSourceImpl extends CounterDataSource { - // Simulate external data processing - String actual = '{"value": 0}'; - - @override - Future decrement(Integer value) async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - final newValue = current.value - value.value; - if (newValue < 0) { - throw ClientException("Counter can't be negative!"); - } - - final newInteger = IntegerModel(value: newValue); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } - - @override - Future increment(Integer value) async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - final newValue = current.value + value.value; - if (newValue < 0) { - throw ClientException("Counter can't be negative!"); - } - - final newInteger = IntegerModel(value: newValue); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } - - @override - Future getCurrent() async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - return current; - } - - @override - Future reset() async { - const newInteger = IntegerModel(value: 0); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/data/models/.gitkeep b/apps/wyatt_app_template/starting_template/lib/data/models/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/data/models/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.dart b/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.dart deleted file mode 100644 index fc1cad0..0000000 --- a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:starting_template/domain/entities/integer.dart'; - -part 'integer_model.freezed.dart'; -part 'integer_model.g.dart'; - -@freezed -class IntegerModel extends Integer with _$IntegerModel { - const factory IntegerModel({ - required int value, - }) = _IntegerModel; - - factory IntegerModel.fromJson(Map json) => - _$IntegerModelFromJson(json); -} diff --git a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.freezed.dart b/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.freezed.dart deleted file mode 100644 index 2fbb008..0000000 --- a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.freezed.dart +++ /dev/null @@ -1,146 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'integer_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -IntegerModel _$IntegerModelFromJson(Map json) { - return _IntegerModel.fromJson(json); -} - -/// @nodoc -mixin _$IntegerModel { - int get value => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $IntegerModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $IntegerModelCopyWith<$Res> { - factory $IntegerModelCopyWith( - IntegerModel value, $Res Function(IntegerModel) then) = - _$IntegerModelCopyWithImpl<$Res, IntegerModel>; - @useResult - $Res call({int value}); -} - -/// @nodoc -class _$IntegerModelCopyWithImpl<$Res, $Val extends IntegerModel> - implements $IntegerModelCopyWith<$Res> { - _$IntegerModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? value = null, - }) { - return _then(_value.copyWith( - value: null == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$_IntegerModelCopyWith<$Res> - implements $IntegerModelCopyWith<$Res> { - factory _$$_IntegerModelCopyWith( - _$_IntegerModel value, $Res Function(_$_IntegerModel) then) = - __$$_IntegerModelCopyWithImpl<$Res>; - @override - @useResult - $Res call({int value}); -} - -/// @nodoc -class __$$_IntegerModelCopyWithImpl<$Res> - extends _$IntegerModelCopyWithImpl<$Res, _$_IntegerModel> - implements _$$_IntegerModelCopyWith<$Res> { - __$$_IntegerModelCopyWithImpl( - _$_IntegerModel _value, $Res Function(_$_IntegerModel) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? value = null, - }) { - return _then(_$_IntegerModel( - value: null == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$_IntegerModel implements _IntegerModel { - const _$_IntegerModel({required this.value}); - - factory _$_IntegerModel.fromJson(Map json) => - _$$_IntegerModelFromJson(json); - - @override - final int value; - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$_IntegerModel && - (identical(other.value, value) || other.value == value)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, value); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$_IntegerModelCopyWith<_$_IntegerModel> get copyWith => - __$$_IntegerModelCopyWithImpl<_$_IntegerModel>(this, _$identity); - - @override - Map toJson() { - return _$$_IntegerModelToJson( - this, - ); - } -} - -abstract class _IntegerModel implements IntegerModel { - const factory _IntegerModel({required final int value}) = _$_IntegerModel; - - factory _IntegerModel.fromJson(Map json) = - _$_IntegerModel.fromJson; - - @override - int get value; - @override - @JsonKey(ignore: true) - _$$_IntegerModelCopyWith<_$_IntegerModel> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.g.dart b/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.g.dart deleted file mode 100644 index 291e5cf..0000000 --- a/apps/wyatt_app_template/starting_template/lib/data/models/integer_model.g.dart +++ /dev/null @@ -1,17 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'integer_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$_IntegerModel _$$_IntegerModelFromJson(Map json) => - _$_IntegerModel( - value: json['value'] as int, - ); - -Map _$$_IntegerModelToJson(_$_IntegerModel instance) => - { - 'value': instance.value, - }; diff --git a/apps/wyatt_app_template/starting_template/lib/data/repositories/.gitkeep b/apps/wyatt_app_template/starting_template/lib/data/repositories/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/data/repositories/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/lib/data/repositories/counter_repository_impl.dart b/apps/wyatt_app_template/starting_template/lib/data/repositories/counter_repository_impl.dart deleted file mode 100644 index a18a5a5..0000000 --- a/apps/wyatt_app_template/starting_template/lib/data/repositories/counter_repository_impl.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:starting_template/domain/data_sources/local/counter_data_source.dart'; -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_type_utils/wyatt_type_utils.dart'; - -class CounterRepositoryImpl extends CounterRepository { - CounterRepositoryImpl({ - required CounterDataSource counterDataSource, - }) : _counterDataSource = counterDataSource; - - final CounterDataSource _counterDataSource; - - @override - FutureOrResult decrement({Integer by = const Integer(1)}) => - Result.tryCatchAsync( - () async => _counterDataSource.decrement(by), - (error) => error, - ); - - @override - FutureOrResult increment({Integer by = const Integer(1)}) => - Result.tryCatchAsync( - () async => _counterDataSource.increment(by), - (error) => error, - ); - - @override - FutureOrResult getCurrent() => - Result.tryCatchAsync( - () async => _counterDataSource.getCurrent(), - (error) => error, - ); - - @override - FutureOrResult reset() => - Result.tryCatchAsync( - () async => _counterDataSource.reset(), - (error) => error, - ); -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/data_sources/local/counter_data_source.dart b/apps/wyatt_app_template/starting_template/lib/domain/data_sources/local/counter_data_source.dart deleted file mode 100644 index 0481ba4..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/data_sources/local/counter_data_source.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -abstract class CounterDataSource extends BaseDataSource { - Future decrement(Integer value); - Future increment(Integer value); - Future getCurrent(); - Future reset(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/entities/.gitkeep b/apps/wyatt_app_template/starting_template/lib/domain/entities/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/domain/entities/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/lib/domain/entities/integer.dart b/apps/wyatt_app_template/starting_template/lib/domain/entities/integer.dart deleted file mode 100644 index aea24f1..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/entities/integer.dart +++ /dev/null @@ -1,11 +0,0 @@ -// ignore_for_file: public_member_api_docs, sort_constructors_first -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Integer extends Entity { - const Integer(this.value); - - final int value; - - @override - String toString() => 'Integer(value: $value)'; -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/repositories/.gitkeep b/apps/wyatt_app_template/starting_template/lib/domain/repositories/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/domain/repositories/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/lib/domain/repositories/counter_repository.dart b/apps/wyatt_app_template/starting_template/lib/domain/repositories/counter_repository.dart deleted file mode 100644 index fb75048..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/repositories/counter_repository.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -abstract class CounterRepository extends BaseRepository { - FutureOrResult decrement({Integer by = const Integer(1)}); - FutureOrResult increment({Integer by = const Integer(1)}); - FutureOrResult getCurrent(); - FutureOrResult reset(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/usecases/.gitkeep b/apps/wyatt_app_template/starting_template/lib/domain/usecases/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/apps/wyatt_app_template/starting_template/lib/domain/usecases/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/decrement.dart b/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/decrement.dart deleted file mode 100644 index d240827..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/decrement.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Decrement extends AsyncUseCase { - Decrement({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(int? params) async { - final step = Integer(params ?? 1); - - return _counterRepository.decrement(by: step); - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/get_current.dart b/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/get_current.dart deleted file mode 100644 index fd05c71..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/get_current.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class GetCurrent extends AsyncUseCase { - GetCurrent({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(void params) async => - _counterRepository.getCurrent(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/increment.dart b/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/increment.dart deleted file mode 100644 index 2dd418a..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/increment.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Increment extends AsyncUseCase { - Increment({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(int? params) async { - final step = Integer(params ?? 1); - - return _counterRepository.increment(by: step); - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/reset.dart b/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/reset.dart deleted file mode 100644 index a7d950e..0000000 --- a/apps/wyatt_app_template/starting_template/lib/domain/usecases/counter/reset.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:starting_template/domain/entities/integer.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Reset extends AsyncUseCase { - Reset({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(void params) async => - _counterRepository.reset(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/main_development.dart b/apps/wyatt_app_template/starting_template/lib/main_development.dart index bf803a1..ac2a934 100644 --- a/apps/wyatt_app_template/starting_template/lib/main_development.dart +++ b/apps/wyatt_app_template/starting_template/lib/main_development.dart @@ -1,11 +1,7 @@ import 'package:starting_template/bootstrap.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; import 'package:starting_template/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - DevelopmentFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/apps/wyatt_app_template/starting_template/lib/main_production.dart b/apps/wyatt_app_template/starting_template/lib/main_production.dart index b622fd6..ac2a934 100644 --- a/apps/wyatt_app_template/starting_template/lib/main_production.dart +++ b/apps/wyatt_app_template/starting_template/lib/main_production.dart @@ -1,11 +1,7 @@ import 'package:starting_template/bootstrap.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; import 'package:starting_template/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - ProductionFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/apps/wyatt_app_template/starting_template/lib/main_staging.dart b/apps/wyatt_app_template/starting_template/lib/main_staging.dart index a406f42..ac2a934 100644 --- a/apps/wyatt_app_template/starting_template/lib/main_staging.dart +++ b/apps/wyatt_app_template/starting_template/lib/main_staging.dart @@ -1,11 +1,7 @@ import 'package:starting_template/bootstrap.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; import 'package:starting_template/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - StagingFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/app/app.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/app/app.dart index 0d859ad..3b61423 100644 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/app/app.dart +++ b/apps/wyatt_app_template/starting_template/lib/presentation/features/app/app.dart @@ -1,12 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:starting_template/core/dependency_injection/get_it.dart'; -import 'package:starting_template/core/routes/router.dart'; -import 'package:starting_template/data/repositories/counter_repository_impl.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; +import 'package:starting_template/core/routes/app_router.dart'; import 'package:starting_template/gen/app_localizations.dart'; -import 'package:starting_template/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart'; import 'package:starting_template/presentation/shared/widgets/flavor_banner.dart'; import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; @@ -15,16 +10,7 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) => MultiProvider( - repositoryProviders: [ - RepositoryProvider( - create: (_) => CounterRepositoryImpl(counterDataSource: getIt()), - ), - ], - blocProviders: [ - BlocProvider( - create: (_) => CounterBloc(), - ), - ], + // TODO(Wyatt): add global bloc providers here child: FlavorBanner( child: MaterialApp.router( title: 'Display Name', diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart deleted file mode 100644 index cd0683d..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'dart:async'; - -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; - -part 'counter_event.dart'; -part 'counter_state.dart'; - -/// {@template counter_bloc} -/// CounterBloc description -/// {@endtemplate} -class CounterBloc extends Bloc { - /// {@macro counter_bloc} - CounterBloc() : super(const CounterInitial()) { - on(_onCustomCounterEvent); - } - - FutureOr _onCustomCounterEvent( - CustomCounterEvent event, - Emitter emit, - ) async { - // TODO(wyatt): Add custom UI logic - const _ = 1 + 1; - - return; - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart deleted file mode 100644 index 49c34d2..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart +++ /dev/null @@ -1,20 +0,0 @@ -part of 'counter_bloc.dart'; - -/// {@template counter_event} -/// CounterEvent description -/// {@endtemplate} -abstract class CounterEvent extends Equatable { - /// {@macro counter_event} - const CounterEvent(); -} - -/// {@template custom_counter_event} -/// Event added when some custom logic happens -/// {@endtemplate} -class CustomCounterEvent extends CounterEvent { - /// {@macro custom_counter_event} - const CustomCounterEvent(); - - @override - List get props => []; -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart deleted file mode 100644 index 79dfd2f..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart +++ /dev/null @@ -1,20 +0,0 @@ -part of 'counter_bloc.dart'; - -/// {@template counter_state} -/// CounterState description -/// {@endtemplate} -abstract class CounterState extends Equatable { - /// {@macro counter_state} - const CounterState(); -} - -/// {@template counter_initial} -/// The initial state of CounterState -/// {@endtemplate} -class CounterInitial extends CounterState { - /// {@macro counter_initial} - const CounterInitial(); - - @override - List get props => []; -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart deleted file mode 100644 index 2d00531..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart +++ /dev/null @@ -1,86 +0,0 @@ -import 'dart:async'; - -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:starting_template/domain/usecases/counter/decrement.dart'; -import 'package:starting_template/domain/usecases/counter/get_current.dart'; -import 'package:starting_template/domain/usecases/counter/increment.dart'; -import 'package:starting_template/domain/usecases/counter/reset.dart'; - -part 'counter_state.dart'; - -/// {@template counter_cubit} -/// CounterCubit manages UI depending on counter state. -/// {@endtemplate} -class CounterCubit extends Cubit { - /// {@macro counter_cubit} - CounterCubit({ - required Decrement decrement, - required Increment increment, - required GetCurrent getCurrent, - required Reset reset, - }) : _decrement = decrement, - _increment = increment, - _getCurrent = getCurrent, - _reset = reset, - super(const CounterState(0)); - - final Decrement _decrement; - final Increment _increment; - final GetCurrent _getCurrent; - final Reset _reset; - - /// Decrement counter. - FutureOr decrement([int by = 1]) async { - final result = await _decrement.call(by); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Increment counter. - FutureOr increment([int by = 1]) async { - final result = await _increment.call(by); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Get current counter state. - FutureOr getCurrent() async { - final result = await _getCurrent.call(null); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Reset counter state. - FutureOr reset() async { - final result = await _reset.call(null); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - @override - void onError(Object error, StackTrace stackTrace) { - emit(state); - super.onError(error, stackTrace); - } -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart deleted file mode 100644 index 50132cd..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart +++ /dev/null @@ -1,14 +0,0 @@ -part of 'counter_cubit.dart'; - -/// {@template counter_state} -/// CounterState containing counter value -/// {@endtemplate} -class CounterState extends Equatable { - /// {@macro counter_state} - const CounterState(this.value); - - final int value; - - @override - List get props => [value]; -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/counter.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/counter.dart deleted file mode 100644 index e110659..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/counter.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:starting_template/presentation/features/counter/screens/counter_provider.dart'; - -class Counter extends StatelessWidget { - const Counter({super.key}); - - static const String pageName = 'counterPage'; - - @override - Widget build(BuildContext context) => const CounterProvider(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/counter_provider.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/counter_provider.dart deleted file mode 100644 index bbcd05a..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/counter_provider.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:starting_template/core/extensions/build_context_extension.dart'; -import 'package:starting_template/domain/repositories/counter_repository.dart'; -import 'package:starting_template/domain/usecases/counter/decrement.dart'; -import 'package:starting_template/domain/usecases/counter/get_current.dart'; -import 'package:starting_template/domain/usecases/counter/increment.dart'; -import 'package:starting_template/domain/usecases/counter/reset.dart'; -import 'package:starting_template/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart'; -import 'package:starting_template/presentation/features/counter/screens/widgets/counter_consumer_widget.dart'; -import 'package:starting_template/presentation/shared/layouts/starting_template_scaffold.dart'; -import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; - -/// {@template counter_provider} -/// CounterProvider provides bloc to his children. -/// {@endtemplate} -class CounterProvider extends CubitProviderScreen { - /// {@macro counter_provider} - const CounterProvider({super.key}); - - @override - CounterCubit create(BuildContext context) => CounterCubit( - decrement: Decrement( - counterRepository: repo(context), - ), - increment: Increment( - counterRepository: repo(context), - ), - getCurrent: GetCurrent( - counterRepository: repo(context), - ), - reset: Reset( - counterRepository: repo(context), - ), - ); - - @override - CounterCubit init(BuildContext context, CounterCubit bloc) => - bloc..getCurrent(); - - @override - Widget builder(BuildContext context) => StartingTemplateScaffold( - title: Text(context.l10n.counterAppBarTitle), - body: const CounterConsumerWidget(), - fabChildren: [ - FloatingActionButton( - heroTag: 'increment_tag', - onPressed: () => bloc(context).increment(), - child: const Icon(Icons.add), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'increment_10_tag', - onPressed: () => bloc(context).increment(10), - child: const Text('+10'), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'decrement_tag', - onPressed: () => bloc(context).decrement(), - child: const Icon(Icons.remove), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'decrement_10_tag', - onPressed: () => bloc(context).decrement(10), - child: const Text('-10'), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'reset_tag', - onPressed: () => bloc(context).reset(), - child: const Icon(Icons.refresh), - ), - ], - ); -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart deleted file mode 100644 index 0add799..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:starting_template/core/extensions/build_context_extension.dart'; -import 'package:starting_template/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart'; -import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; - -/// {@template counter_consumer_widget} -/// CounterConsumerWidget is a stateful widget. Aware of state changes. -/// {@endtemplate} -class CounterConsumerWidget - extends CubitConsumerScreen { - /// {@macro counter_consumer_widget} - const CounterConsumerWidget({super.key}); - - @override - Widget onBuild(BuildContext context, CounterState state) => Text( - context.l10n.youHavePushed(state.value), - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline3, - ); -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/stateless/counter_widget.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/stateless/counter_widget.dart deleted file mode 100644 index 32a7619..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/counter/stateless/counter_widget.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:flutter/material.dart'; - -/// {@template counter_widget} -/// CounterWidget is a stateless widget. (Not aware of cubit or bloc states) -/// {@endtemplate} -class CounterWidget extends StatelessWidget { - /// {@macro counter_widget} - const CounterWidget({super.key}); - - @override - Widget build(BuildContext context) => Container(); -} diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/features/home/home.dart b/apps/wyatt_app_template/starting_template/lib/presentation/features/home/home.dart index d32ea92..ee150a4 100644 --- a/apps/wyatt_app_template/starting_template/lib/presentation/features/home/home.dart +++ b/apps/wyatt_app_template/starting_template/lib/presentation/features/home/home.dart @@ -1,9 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:gap/gap.dart'; -import 'package:go_router/go_router.dart'; -import 'package:starting_template/core/extensions/build_context_extension.dart'; import 'package:starting_template/gen/assets.gen.dart'; -import 'package:starting_template/presentation/features/counter/counter.dart'; import 'package:starting_template/presentation/shared/layouts/starting_template_scaffold.dart'; class Home extends StatelessWidget { @@ -17,11 +13,6 @@ class Home extends StatelessWidget { child: Column( children: [ Assets.images.wyattLogo.image(width: 150), - const Gap(30), - ElevatedButton( - child: Text(context.l10n.goToCounter), - onPressed: () => context.pushNamed(Counter.pageName), - ), ], ), ), diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/.gitkeep b/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/.gitkeep deleted file mode 100644 index f94cb6f..0000000 --- a/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# just to keep empty folder in brick generation \ No newline at end of file diff --git a/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/flavor_banner.dart b/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/flavor_banner.dart index 1c62fc0..31d4496 100644 --- a/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/flavor_banner.dart +++ b/apps/wyatt_app_template/starting_template/lib/presentation/shared/widgets/flavor_banner.dart @@ -1,27 +1,11 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'package:flutter/material.dart'; -import 'package:starting_template/core/flavors/flavor.dart'; +import 'package:starting_template/core/utils/env.dart'; /// {@template flavor_banner} /// A banner that displays the current flavor. /// This is useful for quickly identifying which flavor is currently running. /// -/// When [Flavor.shouldShowBanner] is `false`, this widget will return [child]. +/// When [Env.isProduction] is `true`, this widget will return [child]. /// You can also override this behavior by setting [visible] to `true`. /// /// Wrap your [MaterialApp] with this widget to display the banner. @@ -30,7 +14,7 @@ import 'package:starting_template/core/flavors/flavor.dart'; /// /// ```dart /// FlavorBanner( -/// visible: true, // or null to use Flavor.shouldShowBanner() +/// visible: true, // or null to use !Env.isProduction /// child: const MaterialApp( /// title: 'Starting Template', /// ... @@ -47,25 +31,23 @@ class FlavorBanner extends StatelessWidget { final Widget? child; - /// Defaults to [Flavor.shouldShowBanner]. + /// Defaults to `!Env.isProduction`. final bool? visible; @override Widget build(BuildContext context) { - final visible = this.visible ?? Flavor.shouldShowBanner(); + final visible = this.visible ?? !Env.isProduction; if (!visible) { return child ?? const SizedBox.shrink(); } - final flavor = Flavor.instance; - return Directionality( textDirection: TextDirection.ltr, child: Banner( location: BannerLocation.topEnd, - message: flavor.name, - color: flavor.color, + message: Env.name, + color: Color((Env.type.index+1) * 0x33FFFFFF), child: child, ), ); diff --git a/apps/wyatt_app_template/starting_template/pubspec.yaml b/apps/wyatt_app_template/starting_template/pubspec.yaml index dc7f50f..668d174 100644 --- a/apps/wyatt_app_template/starting_template/pubspec.yaml +++ b/apps/wyatt_app_template/starting_template/pubspec.yaml @@ -2,80 +2,87 @@ name: starting_template version: 1.0.0+1 publish_to: none description: A short project description -environment: - sdk: '>=2.18.0 <3.0.0' - flutter: '>=3.0.0' -dependencies: - cupertino_icons: ^1.0.5 + +environment: + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.0.0" + +dependencies: + cupertino_icons: ^1.0.6 equatable: ^2.0.5 - flutter_bloc: ^8.1.1 - flutter_native_splash: ^2.2.15 - freezed_annotation: ^2.2.0 - gap: ^2.0.1 - get_it: ^7.2.0 - go_router: ^6.0.1 - intl: ^0.17.0 - json_annotation: ^4.8.0 - url_launcher: ^6.1.7 - uuid: ^3.0.7 - flutter: + flutter_bloc: ^8.1.3 + flutter_native_splash: ^2.3.2 + freezed_annotation: ^2.4.1 + gap: ^3.0.1 + get_it: ^7.6.4 + go_router: ^10.1.2 + intl: ^0.18.1 + json_annotation: ^4.8.1 + + flutter: sdk: flutter - flutter_localizations: + flutter_localizations: sdk: flutter - wyatt_architecture: - version: ^0.2.0 - hosted: + + wyatt_architecture: + version: ^0.2.0+1 + hosted: name: wyatt_architecture url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ - wyatt_bloc_helper: + + wyatt_bloc_helper: version: ^2.0.1 - hosted: + hosted: name: wyatt_bloc_helper url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ - wyatt_type_utils: + + wyatt_type_utils: version: ^0.0.5 - hosted: + hosted: name: wyatt_type_utils url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ -dev_dependencies: - build_runner: ^2.3.3 - dart_code_metrics: ^5.4.0 - dependency_validator: ^3.2.2 - flutter_gen_runner: ^5.1.0+1 - flutter_launcher_icons: ^0.11.0 - freezed: ^2.3.2 - json_serializable: ^6.6.0 - pubspec_dependency_sorter: ^1.0.3 - rename: ^2.1.1 - flutter_test: + logging: ^1.2.0 + +dev_dependencies: + build_runner: ^2.4.6 + dart_code_metrics: + git: + url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git + ref: master + flutter_launcher_icons: ^0.13.1 + freezed: ^2.4.2 + json_serializable: ^6.7.1 + flutter_test: sdk: flutter - wyatt_analysis: + wyatt_analysis: version: ^2.5.0 - hosted: + hosted: name: wyatt_analysis url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ -flutter: - assets: + +flutter: + assets: - assets/images/ uses-material-design: true -flutter_gen: + +flutter_gen: output: lib/gen/ - integrations: + integrations: flutter_svg: true flare_flutter: true rive: true lottie: true - colors: - inputs: + colors: + inputs: - assets/colors.xml -flutter_icons: +flutter_icons: android: launcher_icon image_path: assets/images/wyatt_logo.jpeg - adaptive_icon_background: '#FFFFFF' + adaptive_icon_background: "#FFFFFF" ios: true -flutter_native_splash: +flutter_native_splash: image: assets/images/wyatt_logo.jpeg - color: '#FFFFFF' + color: "#FFFFFF" android_gravity: fill ios_content_mode: scaleAspectFit android: true diff --git a/apps/wyatt_app_template/starting_template/web/favicon.png b/apps/wyatt_app_template/starting_template/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/apps/wyatt_app_template/starting_template/web/favicon.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/web/icons/Icon-192.png b/apps/wyatt_app_template/starting_template/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/apps/wyatt_app_template/starting_template/web/icons/Icon-192.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/web/icons/Icon-512.png b/apps/wyatt_app_template/starting_template/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/apps/wyatt_app_template/starting_template/web/icons/Icon-512.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-192.png b/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d7..0000000 Binary files a/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-512.png b/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c566..0000000 Binary files a/apps/wyatt_app_template/starting_template/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/apps/wyatt_app_template/starting_template/web/index.html b/apps/wyatt_app_template/starting_template/web/index.html deleted file mode 100644 index bf34233..0000000 --- a/apps/wyatt_app_template/starting_template/web/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Display Name - - - - - - - - - - diff --git a/apps/wyatt_app_template/starting_template/web/manifest.json b/apps/wyatt_app_template/starting_template/web/manifest.json deleted file mode 100644 index f86027e..0000000 --- a/apps/wyatt_app_template/starting_template/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "Display Name", - "short_name": "Display Name", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A short project description", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/bricks/wyatt_app_template/__brick__/.gitignore b/bricks/wyatt_app_template/__brick__/.gitignore index 9e1210f..325bd7c 100644 --- a/bricks/wyatt_app_template/__brick__/.gitignore +++ b/bricks/wyatt_app_template/__brick__/.gitignore @@ -47,8 +47,17 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release -.mason/ +# Custom +.mason/ .env !.env.example -node_modules/ \ No newline at end of file +node_modules/ +lib/gen/ +**/*.g.dart +**/*.freezed.dart +android/fastlane/report.xml +pubspec_overrides.yaml +.fvm/flutter_sdk +*.apk +*.apks diff --git a/bricks/wyatt_app_template/__brick__/.vscode/launch.json b/bricks/wyatt_app_template/__brick__/.vscode/launch.json index 3e84edd..0ab67b1 100644 --- a/bricks/wyatt_app_template/__brick__/.vscode/launch.json +++ b/bricks/wyatt_app_template/__brick__/.vscode/launch.json @@ -5,36 +5,12 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch development/debug:mocks", + "name": "Launch development/debug", "request": "launch", "type": "dart", "program": "lib/main_development.dart", "args": [ - "--dart-define=dev_mode=mock", - "--target", - "lib/main_development.dart" - ], - "flutterMode": "debug" - }, - { - "name": "Launch development/debug:emulator", - "request": "launch", - "type": "dart", - "program": "lib/main_development.dart", - "args": [ - "--dart-define=dev_mode=emulator", - "--target", - "lib/main_development.dart" - ], - "flutterMode": "debug" - }, - { - "name": "Launch development/debug:real", - "request": "launch", - "type": "dart", - "program": "lib/main_development.dart", - "args": [ - "--dart-define=dev_mode=real", + "--dart-define-from-file=config.dev.json", "--target", "lib/main_development.dart" ], @@ -46,6 +22,7 @@ "type": "dart", "program": "lib/main_staging.dart", "args": [ + "--dart-define-from-file=config.staging.json", "--target", "lib/main_staging.dart" ], @@ -55,8 +32,9 @@ "name": "Launch production/debug", "request": "launch", "type": "dart", - "program": "lib/main_production.dart", + "program": "lib/main_produdction.dart", "args": [ + "--dart-define-from-file=config.prod.json", "--target", "lib/main_production.dart" ], @@ -66,12 +44,13 @@ "name": "Launch production/release", "request": "launch", "type": "dart", - "program": "lib/main_production.dart", + "program": "lib/main_produdction.dart", "args": [ + "--dart-define-from-file=config.prod.json", "--target", "lib/main_production.dart" ], "flutterMode": "release" }, ] -} \ No newline at end of file +} diff --git a/bricks/wyatt_app_template/__brick__/README.md b/bricks/wyatt_app_template/__brick__/README.md index e6f9a20..a19fc3d 100644 --- a/bricks/wyatt_app_template/__brick__/README.md +++ b/bricks/wyatt_app_template/__brick__/README.md @@ -7,47 +7,82 @@ * Flutter * Taskfile -### Configuration +> **Warning** Before anything, you need to generate some files -At the build time, the app will read the environment variables from `config.json` file. +```sh +task bootstrap # to bootstrap the project +``` -The important variable is `DEV_MODE` which can be `mock` , `local` or `real` . +## Configuration + +### Environment variables + +```sh +cp .env.example .env +``` + +This file contains the secrets variables. You need to fill them. + +At the build time, the app will read the environment variables from `config..json` file. + +You can enable/disable some features ```json { - "DEV_MODE": "local" + "FEATURE_FLAGS": "logger" // Separated by comma "," } ``` -> **Note** `local` can refer to a local server or a local emulator. +You can also customize data source -### Taskfile +```json +{ + "DATA_SOURCE": "mock" // Or "api" for example +} +``` -Available tasks: +### Splash and icons -| Commande | Description | Alias | -| --- | --- | --- | -| clean | Nettoie l'environnement de travail | cl | -| format | Formate le code | fmt | -| help | Affiche la boîte de dialogue d'aide | h, default | -| lint | Vérifie la qualité du code | l | -| start-emulators | Démarre les émulateurs nécessaires | emu | -| build:android | Construit le fichier APK pour Android | build:a | -| build:ios | Construit le fichier IPA pour iOS | build:i | -| gen:build | Exécute le générateur de build | gen:b | -| gen:build-delete | Exécute le générateur de build et supprime les sorties en conflit | gen:d | -| gen:clean | Nettoie le générateur de build | gen:c | -| gen:intl | Génère un fichier d'internationalisation | gen:i | -| gen:watch | Exécute le générateur de build en mode surveillance | gen:w | -| pub:get | Obtient les dernières dépendances | pub:g | -| pub:outdated | Vérifie les dépendances obsolètes | pub:o | -| pub:upgrade | Met à jour les dépendances | pub:u | -| pub:upgrade-major | Met à jour les dépendances majeures | pub:um | -| pub:validate | Exécute le validateur de dépendances | pub:v | -| run:dev | Lance l'application en environnement de développement | run:d | -| run:logs | Affiche la sortie de journalisation pour les applications Flutter en cours d'exécution | run:l | -| run:prod | Lance l'application en environnement de production | run:p | -| run:staging | Lance l'application en environnement de pré-production | run:s | +To generate splash screen and icons, you need to run the following command: + +```sh +task gen:splash # to generate splash screen +task gen:icons # to generate icons +``` + +## Taskfile + +### Commands + +
+ To display available commands run task help + +| Commande | Description | Aliases | +|---------------------------|---------------------------------------------------------------|--------------------------------| +| `bootstrap` | Bootstraps the project. | `bs` | +| `clean` | Cleans the environment. | `cl` | +| `decrypt-android-keys` | Decrypt Android keys | `dak` | +| `encrypt-android-keys` | Encrypt Android keys | `eak` | +| `format` | Formats the code. | `fmt` | +| `help` | Help dialog. | `h` , `default` | +| `lint` | Lints the code. | `l` | +| `build:android` | Building Android AAB | `build:a` | +| `build:ios` | Building iOS IPA | `build:i` | +| `gen:build` | Running build runner | `gen:b` | +| `gen:build-delete` | Running build runner with deletion of conflicting outputs | `gen:d` | +| `gen:clean` | Cleaning build runner | `gen:c` | +| `gen:intl` | Generating internationalization file | `gen:i` | +| `pub:get` | Getting latest dependencies | `pub:g` | +| `pub:outdated` | Checking for outdated dependencies | `pub:o` | +| `pub:upgrade` | Upgrading dependencies | `pub:u` | +| `pub:upgrade-major` | Upgrading dependencies | `pub:um` | +| `pub:validate` | Running dependency validator | `pub:v` | +| `run:dev` | Run app in development environment | `run:d` | +| `run:logs` | Show log output for running Flutter apps | `run:l` | +| `run:prod` | Run app in production environment | `run:p` | +| `run:staging` | Run app in staging environment | `run:s` | + +
### Parameters @@ -58,3 +93,13 @@ task run:staging -- -d chrome ``` > **Note** The `--` is required to pass options to the command. + +### Secrets + +Use: + +```sh +task decrypt-android-keys +``` + +to decrypt the android keys (this assumes you have the passphrase in your .env file). diff --git a/bricks/wyatt_app_template/__brick__/Taskfile.yml b/bricks/wyatt_app_template/__brick__/Taskfile.yml index 43888b9..1ab5e44 100644 --- a/bricks/wyatt_app_template/__brick__/Taskfile.yml +++ b/bricks/wyatt_app_template/__brick__/Taskfile.yml @@ -25,14 +25,14 @@ tasks: desc: Cleans the environment. aliases: [cl] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Cleaning the project...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Cleaning the project...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter clean format: desc: Formats the code. aliases: [fmt] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Formatting the code...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Formatting the code...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter format --fix - dart fix --apply @@ -40,12 +40,34 @@ tasks: desc: Lints the code. aliases: [l] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Verifying code...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Verifying code...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - dart analyze . || (echo "Error in project"; exit 1) - start-emulators: - desc: Start needed emulators. - aliases: [emu] + bootstrap: + desc: Bootstraps the project. + aliases: [bs] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Start Firebase emulators...{{.COLOROFF}}" - - firebase emulators:start --only auth,functions,firestore,storage --import=./functions/saved-data --export-on-exit=./functions/saved-data + - melos bs || true + - flutter pub get + - dart run build_runner build --delete-conflicting-outputs + - flutter gen-l10n + - fluttergen || true + + encrypt-android-keys: + desc: Encrypt Android keys + aliases: [eak] + cmds: + - cd android && jar cfvM android_keys.zip android_keys + - source '.env' && gpg --quiet --batch --yes --symmetric --passphrase=$ANDROID_KEYS_SECRET_PASSPHRASE --output android/android_keys.zip.gpg android/android_keys.zip + - rm -rf android/android_keys + - rm android/android_keys.zip + + decrypt-android-keys: + desc: Decrypt Android keys + aliases: [dak] + cmds: + - source '.env' && gpg --quiet --batch --yes --decrypt --passphrase=$ANDROID_KEYS_SECRET_PASSPHRASE --output android/android_keys.zip android/android_keys.zip.gpg + - cd android && jar xvf android_keys.zip + - mv android/android_keys/* android/ + - rm -rf android/android_keys + - rm android/android_keys.zip diff --git a/bricks/wyatt_app_template/__brick__/analysis_options.yaml b/bricks/wyatt_app_template/__brick__/analysis_options.yaml index 96780ca..91179f1 100644 --- a/bricks/wyatt_app_template/__brick__/analysis_options.yaml +++ b/bricks/wyatt_app_template/__brick__/analysis_options.yaml @@ -11,8 +11,8 @@ dart_code_metrics: metrics: cyclomatic-complexity: 20 maximum-nesting-level: 5 - number-of-parameters: 5 - source-lines-of-code: 250 + number-of-parameters: 10 + source-lines-of-code: 400 metrics-exclude: - test/** rules: diff --git a/bricks/wyatt_app_template/__brick__/android/.gitignore b/bricks/wyatt_app_template/__brick__/android/.gitignore deleted file mode 100644 index 6f56801..0000000 --- a/bricks/wyatt_app_template/__brick__/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/bricks/wyatt_app_template/__brick__/android/app/build.gradle b/bricks/wyatt_app_template/__brick__/android/app/build.gradle deleted file mode 100644 index 61ce318..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "{{#dotCase}}{{bundle_id}}{{/dotCase}}" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/debug/AndroidManifest.xml b/bricks/wyatt_app_template/__brick__/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 7791af8..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/AndroidManifest.xml b/bricks/wyatt_app_template/__brick__/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 46a06f9..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt b/bricks/wyatt_app_template/__brick__/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt deleted file mode 100644 index e1ea0f7..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/kotlin/io/wyattapp/start/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package {{#dotCase}}{{bundle_id}}{{/dotCase}} - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable-v21/launch_background.xml b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable/launch_background.xml b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values-night/styles.xml b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values/styles.xml b/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values/styles.xml deleted file mode 100644 index cb1ef88..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/app/src/profile/AndroidManifest.xml b/bricks/wyatt_app_template/__brick__/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 7791af8..0000000 --- a/bricks/wyatt_app_template/__brick__/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/bricks/wyatt_app_template/__brick__/android/build.gradle b/bricks/wyatt_app_template/__brick__/android/build.gradle deleted file mode 100644 index 83ae220..0000000 --- a/bricks/wyatt_app_template/__brick__/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/bricks/wyatt_app_template/__brick__/android/gradle.properties b/bricks/wyatt_app_template/__brick__/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/bricks/wyatt_app_template/__brick__/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/bricks/wyatt_app_template/__brick__/android/gradle/wrapper/gradle-wrapper.properties b/bricks/wyatt_app_template/__brick__/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index cb24abd..0000000 --- a/bricks/wyatt_app_template/__brick__/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/bricks/wyatt_app_template/__brick__/android/settings.gradle b/bricks/wyatt_app_template/__brick__/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/bricks/wyatt_app_template/__brick__/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/bricks/wyatt_app_template/__brick__/assets/fonts/.gitkeep b/bricks/wyatt_app_template/__brick__/assets/fonts/.gitkeep index e69de29..551b494 100644 --- a/bricks/wyatt_app_template/__brick__/assets/fonts/.gitkeep +++ b/bricks/wyatt_app_template/__brick__/assets/fonts/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/automation/build.yml b/bricks/wyatt_app_template/__brick__/automation/build.yml index 21e22ca..9a7b6cd 100644 --- a/bricks/wyatt_app_template/__brick__/automation/build.yml +++ b/bricks/wyatt_app_template/__brick__/automation/build.yml @@ -22,17 +22,19 @@ tasks: - flutter pub get android: - desc: Building Android APK + desc: Building Android AAB deps: [clean, get] aliases: [a] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Building Android APK...{{.COLOROFF}}" - - flutter build apk --target=lib/main_production --no-pub --no-shrink - + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Building Android AAB...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter build appbundle lib/main_production.dart --dart-define-from-file=config.prod.json --no-pub --obfuscate --split-debug-info="./build/app/outputs/bundle/release/" {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} + - open ./build/app/outputs/bundle/release/ + ios: desc: Building iOS IPA deps: [clean, get] aliases: [i] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Building iOS IPA...{{.COLOROFF}}" - - flutter build ipa --target=lib/main_production --no-pub + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Building iOS IPA...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter build ipa lib/main_production.dart --dart-define-from-file=config.prod.json --no-pub --obfuscate --split-debug-info="./build/ios/archive" {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} + - find "./build/ios/archive" -name "*.xcarchive" -exec open {} \; diff --git a/bricks/wyatt_app_template/__brick__/automation/generator.yml b/bricks/wyatt_app_template/__brick__/automation/generator.yml index 6c86a1a..69bc76b 100644 --- a/bricks/wyatt_app_template/__brick__/automation/generator.yml +++ b/bricks/wyatt_app_template/__brick__/automation/generator.yml @@ -13,7 +13,7 @@ tasks: internal: true desc: Gets dependencies. cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Getting the dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Getting the dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub get build: @@ -21,7 +21,7 @@ tasks: deps: [get] aliases: [b] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running build runner...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner build intl: @@ -29,28 +29,36 @@ tasks: deps: [get] aliases: [i] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running intl generation...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running intl generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter gen-l10n + + splash: + desc: Generating splash screen + deps: [get] + aliases: [s] + cmds: + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running splash screen generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - dart run flutter_native_splash:create + + icons: + desc: Generating icons + deps: [get] + aliases: [ic] + cmds: + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running icon generation...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - dart run flutter_launcher_icons build-delete: desc: Running build runner with deletion of conflicting outputs deps: [get] aliases: [d] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner with deletion of conflicting outputs...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running build runner with deletion of conflicting outputs...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner build --delete-conflicting-outputs clean: desc: Cleaning build runner aliases: [c] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Cleaning build runner...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Cleaning build runner...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub run build_runner clean - - watch: - desc: Running build runner in watch mode - deps: [get] - aliases: [w] - cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running build runner in watch mode...{{.COLOROFF}}" - - flutter pub run build_runner watch diff --git a/bricks/wyatt_app_template/__brick__/automation/pub.yml b/bricks/wyatt_app_template/__brick__/automation/pub.yml index fe49212..035d6d1 100644 --- a/bricks/wyatt_app_template/__brick__/automation/pub.yml +++ b/bricks/wyatt_app_template/__brick__/automation/pub.yml @@ -13,21 +13,21 @@ tasks: desc: Getting latest dependencies aliases: [g] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Getting latest dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Getting latest dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub get upgrade: desc: Upgrading dependencies aliases: [u] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Upgrading dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade upgrade-major: desc: Upgrading dependencies aliases: [um] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies --major-versions...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Upgrading dependencies --major-versions...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade --major-versions outdated: @@ -35,13 +35,5 @@ tasks: deps: [upgrade] aliases: [o] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Checking for outdated dependencies...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Checking for outdated dependencies...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter pub upgrade - - validate: - desc: Running dependency validator - deps: [get] - aliases: [v] - cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Validating dependencies...{{.COLOROFF}}" - - flutter pub run dependency_validator diff --git a/bricks/wyatt_app_template/__brick__/automation/run.yml b/bricks/wyatt_app_template/__brick__/automation/run.yml index 0ddc9c4..0290f77 100644 --- a/bricks/wyatt_app_template/__brick__/automation/run.yml +++ b/bricks/wyatt_app_template/__brick__/automation/run.yml @@ -13,26 +13,26 @@ tasks: desc: Show log output for running Flutter apps aliases: [l] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Showing log output for running Flutter apps...{{.COLOROFF}}" + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Showing log output for running Flutter apps...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" - flutter logs dev: desc: Run app in development environment aliases: [d] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (development)...{{.COLOROFF}}" - - flutter run --target lib/main_development.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (development)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_development.dart --dart-define-from-file=config.dev.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} staging: desc: Run app in staging environment aliases: [s] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (staging)...{{.COLOROFF}}" - - flutter run --target lib/main_staging.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (staging)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_staging.dart --dart-define-from-file=config.staging.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} prod: desc: Run app in production environment aliases: [p] cmds: - - echo -e "{{.GREEN}}{{.PREFIX}} Running the app (production)...{{.COLOROFF}}" - - flutter run --target lib/main_production.dart --dart-define-from-file=config.json {{.CLI_ARGS}} + - echo -e "{{#mustacheCase}}.GREEN{{/mustacheCase}}{{#mustacheCase}}.PREFIX{{/mustacheCase}} Running the app (production)...{{#mustacheCase}}.COLOROFF{{/mustacheCase}}" + - flutter run --target lib/main_production.dart --dart-define-from-file=config.prod.json {{#mustacheCase}}.CLI_ARGS{{/mustacheCase}} diff --git a/bricks/wyatt_app_template/__brick__/config.dev.json b/bricks/wyatt_app_template/__brick__/config.dev.json new file mode 100644 index 0000000..9e07da1 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/config.dev.json @@ -0,0 +1,6 @@ +{ + "ENV_NAME": "dev", + "DATA_SOURCE": "api", + "LOGGER_LEVEL": "debug", + "FEATURE_FLAGS": "logger" +} diff --git a/bricks/wyatt_app_template/__brick__/config.json b/bricks/wyatt_app_template/__brick__/config.json deleted file mode 100644 index 356801b..0000000 --- a/bricks/wyatt_app_template/__brick__/config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "FIREBASE_EMULATOR_CLOUD_FUNCTION_PORT": 5001, - "FIREBASE_EMULATOR_FIRESTORE_PORT": 8080, - "FIREBASE_EMULATOR_AUTH_PORT": 9099, - "FIREBASE_EMULATOR_STORAGE_PORT": 919911, - "FIREBASE_EMULATOR_HOST": "localhost", - "DEV_MODE": "local" -} diff --git a/bricks/wyatt_app_template/__brick__/config.prod.json b/bricks/wyatt_app_template/__brick__/config.prod.json new file mode 100644 index 0000000..38e0b4a --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/config.prod.json @@ -0,0 +1,4 @@ +{ + "ENV_NAME": "prod", + "DATA_SOURCE": "api" +} diff --git a/bricks/wyatt_app_template/__brick__/config.staging.json b/bricks/wyatt_app_template/__brick__/config.staging.json new file mode 100644 index 0000000..f926b98 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/config.staging.json @@ -0,0 +1,5 @@ +{ + "ENV_NAME": "staging", + "DATA_SOURCE": "api", + "FEATURE_FLAGS": "logger" +} diff --git a/bricks/wyatt_app_template/__brick__/ios/.gitignore b/bricks/wyatt_app_template/__brick__/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/bricks/wyatt_app_template/__brick__/ios/Flutter/AppFrameworkInfo.plist b/bricks/wyatt_app_template/__brick__/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9625e10..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Flutter/Debug.xcconfig b/bricks/wyatt_app_template/__brick__/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/bricks/wyatt_app_template/__brick__/ios/Flutter/Release.xcconfig b/bricks/wyatt_app_template/__brick__/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bf..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/bricks/wyatt_app_template/__brick__/ios/Podfile b/bricks/wyatt_app_template/__brick__/ios/Podfile deleted file mode 100644 index 88359b2..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Podfile +++ /dev/null @@ -1,41 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/bricks/wyatt_app_template/__brick__/ios/Podfile.lock b/bricks/wyatt_app_template/__brick__/ios/Podfile.lock deleted file mode 100644 index cf0efe4..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Podfile.lock +++ /dev/null @@ -1,28 +0,0 @@ -PODS: - - Flutter (1.0.0) - - flutter_native_splash (0.0.1): - - Flutter - - url_launcher_ios (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`) - - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - flutter_native_splash: - :path: ".symlinks/plugins/flutter_native_splash/ios" - url_launcher_ios: - :path: ".symlinks/plugins/url_launcher_ios/ios" - -SPEC CHECKSUMS: - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2 - -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 - -COCOAPODS: 1.11.3 diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.pbxproj b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 059fb6b..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,556 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 50F1D9CF301DADBFF7F91098 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 01240B090F6ECE02483CB484 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 18B4FB2B44E101F10AB8D41B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EA780011634A6BC46817CBE0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 50F1D9CF301DADBFF7F91098 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 10872F84FB14C7DD915284C6 /* Pods */ = { - isa = PBXGroup; - children = ( - 18B4FB2B44E101F10AB8D41B /* Pods-Runner.debug.xcconfig */, - 01240B090F6ECE02483CB484 /* Pods-Runner.release.xcconfig */, - EA780011634A6BC46817CBE0 /* Pods-Runner.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - 4204558B17A62367423769E8 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1F58D6DFA5E148E9B1E5401F /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 10872F84FB14C7DD915284C6 /* Pods */, - 4204558B17A62367423769E8 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - B0C681F6443208846EBFB7D2 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - CF936C6216E6F00FB5F73F4C /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - B0C681F6443208846EBFB7D2 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - CF936C6216E6F00FB5F73F4C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = {{#dotCase}}{{bundle_id}}{{/dotCase}}; - PRODUCT_NAME = "{{#titleCase}}{{display_name}}{{/titleCase}}"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = {{#dotCase}}{{bundle_id}}{{/dotCase}}; - PRODUCT_NAME = "{{#titleCase}}{{display_name}}{{/titleCase}}"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 6Z5P8GG96U; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = {{#dotCase}}{{bundle_id}}{{/dotCase}}; - PRODUCT_NAME = "{{#titleCase}}{{display_name}}{{/titleCase}}"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/configuration/.gitkeep b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/configuration/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index c87d15a..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/contents.xcworkspacedata b/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc1..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/swiftpm/configuration/.gitkeep b/bricks/wyatt_app_template/__brick__/ios/Runner.xcworkspace/xcshareddata/swiftpm/configuration/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/AppDelegate.swift b/bricks/wyatt_app_template/__brick__/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -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. \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/LaunchScreen.storyboard b/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/Main.storyboard b/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Info.plist b/bricks/wyatt_app_template/__brick__/ios/Runner/Info.plist deleted file mode 100644 index c8fdef9..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Info.plist +++ /dev/null @@ -1,51 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - {{#titleCase}}{{display_name}}{{/titleCase}} - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - {{#titleCase}}{{display_name}}{{/titleCase}} - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Runner-Bridging-Header.h b/bricks/wyatt_app_template/__brick__/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a5..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/bricks/wyatt_app_template/__brick__/ios/Runner/Runner.entitlements b/bricks/wyatt_app_template/__brick__/ios/Runner/Runner.entitlements deleted file mode 100644 index 74c85d2..0000000 --- a/bricks/wyatt_app_template/__brick__/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - aps-environment - development - - \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/l10n.yaml b/bricks/wyatt_app_template/__brick__/l10n.yaml index 1518d35..cc17f7f 100644 --- a/bricks/wyatt_app_template/__brick__/l10n.yaml +++ b/bricks/wyatt_app_template/__brick__/l10n.yaml @@ -5,4 +5,5 @@ output-dir: lib/gen/ nullable-getter: false use-deferred-loading: true synthetic-package: false -header: "/// {{#titleCase}}{{display_name}}{{/titleCase}}, localized files. Automatically generated with `task gen:intl`." \ No newline at end of file +use-escaping: false +header: "/// {{#titleCase}}{{display_name}}{{/titleCase}}, localized files. Automatically generated with `task gen:intl`." diff --git a/bricks/wyatt_app_template/__brick__/lib/bootstrap.dart b/bricks/wyatt_app_template/__brick__/lib/bootstrap.dart index 38f7462..76603f7 100644 --- a/bricks/wyatt_app_template/__brick__/lib/bootstrap.dart +++ b/bricks/wyatt_app_template/__brick__/lib/bootstrap.dart @@ -2,18 +2,44 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:logging/logging.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/dependency_injection/get_it.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/feature_flag.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/app_logger.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/simple_log_printer.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/app_bloc_observer.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/env.dart'; Future bootstrap(FutureOr Function() builder) async { - WidgetsFlutterBinding.ensureInitialized(); + // Initialize logging + final logger = AppLogger(); - Bloc.observer = AppBlocObserver(); + await runZonedGuarded( + () async { + WidgetsFlutterBinding.ensureInitialized(); - debugPrint('${Flavor.instance}'); + // Verify that we have the correct environment + Env.verify(); - await GetItInitializer.init(); + if (Env.isFeatureEnabled(FeatureFlag.logger)) { + logger + ..level = Env.loggerLevel + ..addPlugin(const SimpleLogPrinter()); + } else { + logger.level = Level.OFF; + } - runApp(await builder()); + debugPrint(Env.summary); // Print even if logger is disabled + + Bloc.observer = AppBlocObserver(); + + // Intialize dependencies injection + await GetItInitializer.init(); + + runApp(await builder()); + }, + (error, stackTrace) { + logger.error(error.toString(), stackTrace); + }, + ); } diff --git a/bricks/wyatt_app_template/__brick__/lib/core/constants/build_config_key.dart b/bricks/wyatt_app_template/__brick__/lib/core/constants/build_config_key.dart new file mode 100644 index 0000000..f726479 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/constants/build_config_key.dart @@ -0,0 +1,163 @@ +const String _envName = 'ENV_NAME'; +const String _dataSource = 'DATA_SOURCE'; +const String _loggerLevel = 'LOGGER_LEVEL'; +const String _featureFlags = 'FEATURE_FLAGS'; + +enum BuildConfigKey { + envName(_envName, isRequired: true), + dataSource(_dataSource, isRequired: true), + loggerLevel(_loggerLevel), + featureFlags(_featureFlags); + + const BuildConfigKey(this.key, {this.isRequired = false}); + + final String key; + final bool isRequired; + + /// Returns true if the environment variable is defined + /// + /// Cannot use `const bool.hasEnvironment(key)` because it is not a + /// constant expression. This is why we need to use a switch statement. + bool get isDefined => switch (this) { + BuildConfigKey.envName => const bool.hasEnvironment(_envName), + BuildConfigKey.dataSource => const bool.hasEnvironment(_dataSource), + BuildConfigKey.loggerLevel => const bool.hasEnvironment(_loggerLevel), + BuildConfigKey.featureFlags => const bool.hasEnvironment(_featureFlags), + }; + + /// Returns the value of the environment variable + /// + /// Cannot use `const String.fromEnvironment(key)` because it is not a + /// constant expression. This is why we need to use a switch statement. + String get stringFromEnv => switch (this) { + BuildConfigKey.envName => const String.fromEnvironment(_envName), + BuildConfigKey.dataSource => const String.fromEnvironment(_dataSource), + BuildConfigKey.loggerLevel => + const String.fromEnvironment(_loggerLevel), + BuildConfigKey.featureFlags => + const String.fromEnvironment(_featureFlags), + }; + + /// Returns the values of the environment variables + static String get summary { + final summary = StringBuffer(); + for (final key in BuildConfigKey.values) { + if (key.isRequired && !key.isDefined) { + summary.writeln('${key.key} is not defined (required)'); + continue; + } + if (key.isDefined) { + summary.writeln('${key.key}: ${key.stringFromEnv}'); + continue; + } + } + + return summary.toString(); + } + + /// Returns the value of the environment variable + /// + /// If the environment variable is not defined, returns null + T? getOrNull() { + try { + return get(); + } catch (_) { + return null; + } + } + + /// Returns the value of the environment variable + /// + /// If the environment variable is not defined, returns the value of [or] + T getOr(T Function() or) { + switch (T) { + case String: + return _getStringOr(or as String Function()) as T; + case int: + return _getIntOr(or as int Function()) as T; + case double: + return _getDoubleOr(or as double Function()) as T; + case bool: + return _getBool() as T; + default: + throw Exception('Type $T is not supported'); + } + } + + /// Returns the value of the environment variable + /// + /// Throws an exception if the environment variable is not defined + T get() { + switch (T) { + case String: + return _getString() as T; + case int: + return _getInt() as T; + case double: + return _getDouble() as T; + case bool: + return _getBool() as T; + default: + throw Exception('Type $T is not supported'); + } + } + + String _getString() { + final value = stringFromEnv; + if (value.isEmpty) { + throw Exception('$key is not defined'); + } + + return value; + } + + int _getInt() { + // Use int.tryParse instead int.fromEnvironment because we want to + // support 0 as a value too. + final value = int.tryParse(stringFromEnv); + if (value == null) { + throw Exception('$key is not defined'); + } + + return value; + } + + double _getDouble() { + final value = double.tryParse(stringFromEnv); + if (value == null) { + throw Exception('$key is not defined'); + } + + return value; + } + + bool _getBool() { + final value = stringFromEnv.toLowerCase(); + + return value == 'true' || value == '1'; + } + + double _getDoubleOr(double Function() or) { + try { + return _getDouble(); + } catch (_) { + return or(); + } + } + + String _getStringOr(String Function() or) { + try { + return _getString(); + } catch (_) { + return or(); + } + } + + int _getIntOr(int Function() or) { + try { + return _getInt(); + } catch (_) { + return or(); + } + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/constants/constants.dart b/bricks/wyatt_app_template/__brick__/lib/core/constants/constants.dart new file mode 100644 index 0000000..5ca88f8 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/constants/constants.dart @@ -0,0 +1 @@ +const int kBlocObserverMessageLength = 100; diff --git a/bricks/wyatt_app_template/__brick__/lib/core/constants/emulator.dart b/bricks/wyatt_app_template/__brick__/lib/core/constants/emulator.dart deleted file mode 100644 index 0097c95..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/core/constants/emulator.dart +++ /dev/null @@ -1,18 +0,0 @@ -/// Firebase Emulator constants. -/// -/// If you don't use Firebase, it can be safely deleted. -abstract class Emulator { - static const String firebaseCloudFunctionEnvKey = - 'FIREBASE_EMULATOR_CLOUD_FUNCTION_PORT'; - static const String firebaseFirestoreEnvKey = - 'FIREBASE_EMULATOR_FIRESTORE_PORT'; - static const String firebaseAuthEnvKey = 'FIREBASE_EMULATOR_AUTH_PORT'; - static const String firebaseStorageEnvKey = 'FIREBASE_EMULATOR_STORAGE_PORT'; - static const String hostEnvKey = 'FIREBASE_EMULATOR_HOST'; - - static const int defaultFirebaseCloudFunctionPort = 5001; - static const int defaultFirebaseFirestorePort = 8080; - static const int defaultFirebaseAuthPort = 9099; - static const int defaultFirebaseStoragePort = 9199; - static const defaultHost = 'localhost'; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/dependency_injection/get_it.dart b/bricks/wyatt_app_template/__brick__/lib/core/dependency_injection/get_it.dart index 5c1103c..9d6c59b 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/dependency_injection/get_it.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/dependency_injection/get_it.dart @@ -1,52 +1,56 @@ import 'dart:async'; -import 'package:flutter/foundation.dart'; import 'package:get_it/get_it.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/dev_mode.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/firebase_emulator.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/data_source_type.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/app_logger.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/env.dart'; final getIt = GetIt.I; /// Service and Data Source locator abstract class GetItInitializer { + static AppLogger get logger => AppLogger('GetItInitializer'); + static FutureOr _initCommon() async { - // TODO(wyatt): Initialize common sources/services + logger.info('Initializing common sources/services'); } static FutureOr _initMock() async { - // TODO(wyatt): Initialize mocked sources/services. + logger.info('Initializing mock sources'); } - static FutureOr _initLocal() async { - // TODO(wyatt): Initialize local sources/services. - final emulator = FirebaseEmulator.fromEnv(); - debugPrint('Firebase Emulator: $emulator'); + static FutureOr _initApi() async { + logger.info('Initializing API sources'); } - static FutureOr _initReal() async { - // TODO(wyatt): Initialize real sources/services + static FutureOr _initRepositories() async { + logger.info('Initializing repositories'); + } + + static FutureOr _initUseCases() async { + logger.info('Initializing use cases'); } static FutureOr init() async { // Initialize common sources/services await _initCommon(); - // Initialize sources/services based on flavor - switch (Flavor.instance.devMode) { - case DevMode.mock: + // Initialize sources/services based on data source type + switch (Env.dataSource) { + case DataSourceType.mock: await _initMock(); break; - case DevMode.local: - await _initLocal(); + case DataSourceType.api: + await _initApi(); break; - case DevMode.real: - await _initReal(); - break; - case null: - throw Exception('DevMode not initialized!'); } + // Initialize repositories + await _initRepositories(); + + // Initialize use cases + await _initUseCases(); + await getIt.allReady(); } } diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/build_mode.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/build_mode.dart deleted file mode 100644 index 0aa4421..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/core/enums/build_mode.dart +++ /dev/null @@ -1,31 +0,0 @@ -enum BuildMode { - /// Debug build mode. Pass `--debug` to `flutter run` or `flutter build` to - /// use this mode. - debug, - - /// Release build mode. Pass `--profile` to `flutter run` or `flutter build` - /// to use this mode. - profile, - - /// Release build mode. Pass `--release` to `flutter run` or `flutter build` - /// to use this mode. - release; - - @override - String toString() => name; - - /// Tries to parse String and returns mode. Fallback is returned if there - /// is an error during parsing. - static BuildMode fromString( - String? mode, { - BuildMode fallback = BuildMode.debug, - }) { - for (final m in values) { - if (m.name == mode) { - return m; - } - } - - return fallback; - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/data_source_type.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/data_source_type.dart new file mode 100644 index 0000000..b5905c8 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/enums/data_source_type.dart @@ -0,0 +1,16 @@ +enum DataSourceType { + mock, + api; + + static DataSourceType fromString(String value) => DataSourceType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + + static DataSourceType? fromStringOr(String value, {DataSourceType? or}) { + try { + return DataSourceType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/dev_mode.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/dev_mode.dart deleted file mode 100644 index 3a628f9..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/core/enums/dev_mode.dart +++ /dev/null @@ -1,25 +0,0 @@ -enum DevMode { - /// Mocked data sources and services - mock, - - /// Local data sources and services, like local database, or firebase emulator - local, - - /// Real data sources and services, like firebase or other cloud services - real; - - @override - String toString() => name; - - /// Tries to parse String and returns mode. Fallback is returned if there - /// is an error during parsing. - static DevMode fromString(String? mode, {DevMode fallback = DevMode.mock}) { - for (final m in values) { - if (m.name == mode) { - return m; - } - } - - return fallback; - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/env_type.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/env_type.dart new file mode 100644 index 0000000..5e676f0 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/enums/env_type.dart @@ -0,0 +1,17 @@ +enum EnvType { + dev, + staging, + prod; + + static EnvType fromString(String value) => + EnvType.values.firstWhere((e) => e.name == value.toLowerCase().trim()); + + static EnvType? fromStringOr(String value, {EnvType? or}) { + try { + return EnvType.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/feature_flag.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/feature_flag.dart new file mode 100644 index 0000000..bfbed60 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/enums/feature_flag.dart @@ -0,0 +1,18 @@ +enum FeatureFlag { + logger; + + static FeatureFlag fromString(String value) => FeatureFlag.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + + static FeatureFlag? fromStringOr(String value, {FeatureFlag? or}) { + try { + return FeatureFlag.values + .firstWhere((e) => e.name == value.toLowerCase().trim()); + } catch (_) { + return or; + } + } + + @override + String toString() => name; +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/enums/page_protection.dart b/bricks/wyatt_app_template/__brick__/lib/core/enums/page_protection.dart index 63a846d..4d63018 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/enums/page_protection.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/enums/page_protection.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - enum PageProtection { /// The page can be accessed without authentication. public, diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/build_context_extension.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/build_context_extension.dart index 34c7346..44af603 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/extensions/build_context_extension.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/build_context_extension.dart @@ -2,5 +2,6 @@ import 'package:flutter/widgets.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/gen/app_localizations.dart'; extension BuildContextExtension on BuildContext { + /// Returns the [AppLocalizations] instance AppLocalizations get l10n => AppLocalizations.of(this); } diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/debuggable_bloc.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/debuggable_bloc.dart new file mode 100644 index 0000000..433bf09 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/debuggable_bloc.dart @@ -0,0 +1,19 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; + +extension DebuggableBloc on BlocBase { + static final _showInObserver = Expando(); + + bool get showInObserver => _showInObserver[this] ?? true; + + set showInObserver(bool value) => _showInObserver[this] = value; + + /// Show the bloc in the observer + void show() { + showInObserver = true; + } + + /// Hide the bloc from the observer + void hide() { + showInObserver = false; + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/get_it_extension.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/get_it_extension.dart new file mode 100644 index 0000000..692a4bf --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/get_it_extension.dart @@ -0,0 +1,26 @@ +import 'package:get_it/get_it.dart'; + +extension GetItExtension on GetIt { + void injectInterface( + T instanceToInject, { + String? instanceName, + }) { + registerSingleton(instanceToInject, instanceName: instanceName); + } + + void injectRepository(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectDataSource(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectUseCase(FactoryFunc func) { + registerLazySingleton(func); + } + + void injectBloc(FactoryFunc func) { + registerFactory(func); + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_extension.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_guard.dart similarity index 64% rename from bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_extension.dart rename to bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_guard.dart index 98361cc..e5e8ecd 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_extension.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_guard.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'package:go_router/go_router.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/page_protection.dart'; diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_list_extension.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_list_extension.dart new file mode 100644 index 0000000..f1eb6ab --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/go_route_list_extension.dart @@ -0,0 +1,21 @@ +import 'package:go_router/go_router.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/go_route_guard.dart'; + +extension GoRouteListExtension on Iterable { + /// Returns a list of public routes. + List get publicRoutes => + where((route) => route.isPublic).toList(growable: false); + + /// Returns a list of protected routes. + List get protectedRoutes => + where((route) => route.isProtected).toList(growable: false); + + /// Returns a list of routes that are neither public nor protected. + List get noneRoutes => + where((route) => route.isNone).toList(growable: false); + + GoRoute fromName(String name) => firstWhere((route) => route.name == name); + GoRoute fromPath(String path) => firstWhere((route) => route.path == path); + + GoRoute operator [](String name) => fromName(name); +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/extensions/route_base_extension.dart b/bricks/wyatt_app_template/__brick__/lib/core/extensions/route_base_extension.dart new file mode 100644 index 0000000..9866537 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/extensions/route_base_extension.dart @@ -0,0 +1,20 @@ +import 'package:go_router/go_router.dart'; + +/// Flatten the [GoRoute] tree. +extension RouteBaseExtension on RouteBase { + List flatten() { + final List routes = []; + if (this is GoRoute) { + routes.add(this as GoRoute); + } else if (this is ShellRoute) { + routes.addAll( + (this as ShellRoute) + .routes + .map((route) => route.flatten()) + .expand((routeList) => routeList), + ); + } + + return routes; + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/flavors/flavor.dart b/bricks/wyatt_app_template/__brick__/lib/core/flavors/flavor.dart deleted file mode 100644 index dcb29a3..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/core/flavors/flavor.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/build_mode.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/dev_mode.dart'; - -class Flavor { - Flavor._({ - this.flavorName, - this.bannerColor, - }) { - // Determine build mode - buildMode = kReleaseMode - ? BuildMode.release - : kProfileMode - ? BuildMode.profile - : BuildMode.debug; - - // Retrieve dev mode, fallback to mock - devMode = DevMode.fromString( - const String.fromEnvironment('DEV_MODE', defaultValue: 'mock'), - ); - - _instance = this; - } - - static Flavor? _instance; - - final String? flavorName; - final Color? bannerColor; - - late final DevMode? devMode; - late final BuildMode? buildMode; - - /// Returns [Flavor] instance. - static Flavor get instance { - if (_instance == null) { - throw Exception('Flavor not initialized!'); - } - - return _instance!; - } - - String get name => flavorName ?? 'Unknown'; - Color get color => bannerColor ?? Colors.grey; - - static bool shouldShowBanner() => instance.buildMode != BuildMode.release; - - @override - String toString() => - 'Flavor: $flavorName, DevMode: $devMode, BuildMode: $buildMode'; -} - -class DevelopmentFlavor extends Flavor { - DevelopmentFlavor() - : super._(flavorName: 'Development', bannerColor: Colors.red); -} - -class StagingFlavor extends Flavor { - StagingFlavor() : super._(flavorName: 'Staging', bannerColor: Colors.orange); -} - -class ProductionFlavor extends Flavor { - ProductionFlavor() - : super._(flavorName: 'Production', bannerColor: Colors.green); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger.dart b/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger.dart new file mode 100644 index 0000000..c5f517b --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger.dart @@ -0,0 +1,81 @@ +import 'package:logging/logging.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/app_logger_plugin.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/log_level.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/mixins/debuggable.dart'; + +class AppLogger with Debuggable { + /// Creates a top-level [AppLogger]. + factory AppLogger([String namespace = rootNamespace]) { + if (!namespace.startsWith(rootNamespace)) { + namespace = '$rootNamespace.$namespace'; + } + + return AppLogger.activeLoggers[namespace] ??= AppLogger._(namespace); + } + + AppLogger._(String namespace) : _logger = Logger(namespace); + + /// The root namespace for all [AppLogger]s. + static const rootNamespace = '{{#pascalCase}}{{project_name}}{{/pascalCase}}'; + + static final Map activeLoggers = {}; + + String get namespace => _logger.fullName; + + final Logger _logger; + + AppLogger createChild(String name) { + assert(name.isNotEmpty, 'Name should not be empty'); + + return AppLogger('$namespace.$name'); + } + + Level get level => _logger.level; + + set level(Level level) { + hierarchicalLoggingEnabled = true; + _logger.level = level; + } + + void addPlugin(AppLoggerPlugin plugin) { + _logger.onRecord.listen(plugin.handleLogRecord); + } + + /// Logs a [message] at the given [level]. + void log( + Level level, + String message, [ + Object? error, + StackTrace? stackTrace, + ]) { + _logger.log(level, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.verbose]. + void verbose(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.verbose, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.debug]. + void debug(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.debug, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.info]. + void info(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.info, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.warn]. + void warn(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.warn, message, error, stackTrace); + } + + /// Logs a message with level [LogLevel.error]. + void error(String message, [Object? error, StackTrace? stackTrace]) { + log(LogLevel.error, message, error, stackTrace); + } + + @override + String get debugName => 'AppLogger'; +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger_plugin.dart b/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger_plugin.dart new file mode 100644 index 0000000..67c2961 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/logger/app_logger_plugin.dart @@ -0,0 +1,7 @@ +import 'package:logging/logging.dart'; + +abstract class AppLoggerPlugin { + const AppLoggerPlugin(); + + void handleLogRecord(LogRecord record); +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/logger/log_level.dart b/bricks/wyatt_app_template/__brick__/lib/core/logger/log_level.dart new file mode 100644 index 0000000..9dea729 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/logger/log_level.dart @@ -0,0 +1,20 @@ +import 'package:logging/logging.dart'; + +abstract class LogLevel { + static const Level verbose = Level('VERBOSE', 300); + static const Level bloc = Level('BLOC', 450); + static const Level debug = Level('DEBUG', 500); + static const Level info = Level.INFO; + static const Level warn = Level.WARNING; + static const Level error = Level('ERROR', 1000); + + static Level fromString(String value) => switch (value.toLowerCase()) { + 'verbose' => verbose, + 'bloc' => bloc, + 'debug' => debug, + 'info' => info, + 'warn' || 'warning' => warn, + 'error' || 'fail' || 'failure' => error, + _ => throw Exception('Unknown log level: $value'), + }; +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/logger/simple_log_printer.dart b/bricks/wyatt_app_template/__brick__/lib/core/logger/simple_log_printer.dart new file mode 100644 index 0000000..c6652f1 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/logger/simple_log_printer.dart @@ -0,0 +1,40 @@ +import 'package:logging/logging.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/app_logger_plugin.dart'; + +class SimpleLogPrinter implements AppLoggerPlugin { + const SimpleLogPrinter(); + + /// Formats [LogRecord] using level, namespace, and message components. + static String formatLogRecord(LogRecord record) { + final buffer = StringBuffer() + ..write(record.level.name.toUpperCase()) + ..write(' | '); + + final namespace = record.loggerName.split('.').lastOrNull; + if (namespace != null && namespace.isNotEmpty) { + buffer + ..write(namespace) + ..write(' | '); + } + + buffer.write(record.message); + final error = record.error; + if (error != null) { + buffer + ..write(': ') + ..writeln(error); + } + final stackTrace = record.stackTrace; + if (stackTrace != null) { + buffer.writeln(stackTrace); + } + + return buffer.toString(); + } + + @override + void handleLogRecord(LogRecord record) { + // ignore: avoid_print + print(formatLogRecord(record)); + } +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/mixins/debuggable.dart b/bricks/wyatt_app_template/__brick__/lib/core/mixins/debuggable.dart new file mode 100644 index 0000000..a3f7e4b --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/mixins/debuggable.dart @@ -0,0 +1,3 @@ +mixin Debuggable { + String get debugName; +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/mixins/loggable.dart b/bricks/wyatt_app_template/__brick__/lib/core/mixins/loggable.dart new file mode 100644 index 0000000..7041f4c --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/mixins/loggable.dart @@ -0,0 +1,6 @@ +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/app_logger.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/mixins/debuggable.dart'; + +mixin Loggable on Debuggable { + AppLogger get logger => AppLogger().createChild(debugName); +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/routes/router.dart b/bricks/wyatt_app_template/__brick__/lib/core/routes/app_router.dart similarity index 54% rename from bricks/wyatt_app_template/__brick__/lib/core/routes/router.dart rename to bricks/wyatt_app_template/__brick__/lib/core/routes/app_router.dart index 014a959..0a63502 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/routes/router.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/routes/app_router.dart @@ -1,7 +1,8 @@ import 'package:flutter/cupertino.dart'; import 'package:go_router/go_router.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/page_protection.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/go_route_extension.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/go_route_guard.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/route_base_extension.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/routes/go_router_refresh_stream.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/home/home.dart'; @@ -32,11 +33,20 @@ abstract class AppRouter { )..setPublic(), ]; + /// Singleton instance of [GoRouter] + static GoRouter? _router; + + /// Navigator key for the root navigator + static final GlobalKey rootNavigatorKey = + GlobalKey(); + /// Router - static GoRouter routerOf(BuildContext context) => GoRouter( + static GoRouter routerOf(BuildContext context) => _router ??= GoRouter( initialLocation: '/', routes: AppRouter.routes, + navigatorKey: rootNavigatorKey, debugLogDiagnostics: true, + refreshListenable: GoRouterRefreshStream(const Stream.empty()), // TODO(wyatt): Add authentication logic redirect: (context, state) { /// Define the default guard @@ -44,17 +54,34 @@ abstract class AppRouter { /// does not have a guard set. (It is set to [PageProtection.none]) const defaultGuard = PageProtection.protected; - // Compute current route - // Compute current route - final currentRoute = AppRouter.routes.firstWhere( - (route) => route.path == state.location, - ); + /// Recursively get all routes and subroutes in a one-dimensional list + /// This will work for any level of nesting + final routes = + AppRouter.routes.map((route) => route.flatten()).expand( + (routeList) => routeList, + ); - // Get the guard of the current route - final guard = currentRoute.guard; + /// Matches is a list of all routes that match the current uri + final matches = _router?.configuration + .findMatch( + state.uri.toString(), + ) + .routes + .map((route) => route.flatten()) + .expand( + (routeList) => routeList, + ) ?? + routes; + + /// Get the current route + final currentRoute = matches.last; + + /// Get the guard of the current route + final guard = (currentRoute.guard == PageProtection.none) + ? defaultGuard + : currentRoute.guard; return null; }, - refreshListenable: GoRouterRefreshStream(const Stream.empty()), ); } diff --git a/bricks/wyatt_app_template/__brick__/lib/core/routes/go_router_refresh_stream.dart b/bricks/wyatt_app_template/__brick__/lib/core/routes/go_router_refresh_stream.dart index b37ca83..269555c 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/routes/go_router_refresh_stream.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/routes/go_router_refresh_stream.dart @@ -1,19 +1,3 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'dart:async'; import 'package:flutter/foundation.dart'; diff --git a/bricks/wyatt_app_template/__brick__/lib/core/utils/app_bloc_observer.dart b/bricks/wyatt_app_template/__brick__/lib/core/utils/app_bloc_observer.dart index 92be592..3e610ef 100644 --- a/bricks/wyatt_app_template/__brick__/lib/core/utils/app_bloc_observer.dart +++ b/bricks/wyatt_app_template/__brick__/lib/core/utils/app_bloc_observer.dart @@ -1,9 +1,11 @@ -import 'package:flutter/foundation.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/constants/constants.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/debuggable_bloc.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/log_level.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/mixins/debuggable.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/mixins/loggable.dart'; -const _messageLength = 100; - -class AppBlocObserver extends BlocObserver { +class AppBlocObserver extends BlocObserver with Debuggable, Loggable { AppBlocObserver({ this.printEvent = true, this.printError = true, @@ -18,6 +20,9 @@ class AppBlocObserver extends BlocObserver { final bool printTransition; final bool fullPrint; + @override + String get debugName => 'AppBlocObserver'; + String sanitize(Object? object) { final message = object.toString(); @@ -25,25 +30,33 @@ class AppBlocObserver extends BlocObserver { ? message : message.substring( 0, - message.length < _messageLength ? message.length : _messageLength, + message.length < kBlocObserverMessageLength + ? message.length + : kBlocObserverMessageLength, ); } @override void onEvent(Bloc bloc, Object? event) { super.onEvent(bloc, event); - if (printEvent) { - debugPrint('onEvent: ${bloc.runtimeType}\n' - '> event: ${sanitize(event)}'); + if (printEvent && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonEvent: ${bloc.runtimeType}\n' + '> event: ${sanitize(event)}', + ); } } @override void onError(BlocBase bloc, Object error, StackTrace stackTrace) { - if (printError) { - debugPrint('onError: ${bloc.runtimeType}\n' - '> error: ${sanitize(error)}\n' - '$stackTrace'); + if (printError && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonError: ${bloc.runtimeType}\n' + '> error: ${sanitize(error)}\n' + '$stackTrace', + ); } super.onError(bloc, error, stackTrace); } @@ -51,10 +64,13 @@ class AppBlocObserver extends BlocObserver { @override void onChange(BlocBase bloc, Change change) { super.onChange(bloc, change); - if (printChange) { - debugPrint('onChange: ${bloc.runtimeType}\n' - '> currentState: ${sanitize(change.currentState)}\n' - '> nextState: ${sanitize(change.nextState)}'); + if (printChange && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonChange: ${bloc.runtimeType}\n' + '> currentState: ${sanitize(change.currentState)}\n' + '> nextState: ${sanitize(change.nextState)}', + ); } } @@ -64,11 +80,14 @@ class AppBlocObserver extends BlocObserver { Transition transition, ) { super.onTransition(bloc, transition); - if (printTransition) { - debugPrint('onTransition: ${bloc.runtimeType}\n' - '> currentState: ${sanitize(transition.currentState)}\n' - '> event: ${sanitize(transition.event)}\n' - '> nextState: ${sanitize(transition.nextState)}'); + if (printTransition && bloc.showInObserver) { + logger.log( + LogLevel.bloc, + '\nonTransition: ${bloc.runtimeType}\n' + '> currentState: ${sanitize(transition.currentState)}\n' + '> event: ${sanitize(transition.event)}\n' + '> nextState: ${sanitize(transition.nextState)}', + ); } } } diff --git a/bricks/wyatt_app_template/__brick__/lib/core/utils/env.dart b/bricks/wyatt_app_template/__brick__/lib/core/utils/env.dart new file mode 100644 index 0000000..7f69d3b --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/core/utils/env.dart @@ -0,0 +1,116 @@ +import 'package:logging/logging.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/constants/build_config_key.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/data_source_type.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/env_type.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/feature_flag.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/logger/log_level.dart'; + +abstract class Env { + /// Check if all **required** environment variables are defined, and throw + /// an exception if not + static void verify() { + final List missingKeys = []; + + // Check required environment variables + for (final key in BuildConfigKey.values) { + if (key.isRequired && !key.isDefined) { + missingKeys.add(key); + } + } + + if (missingKeys.isNotEmpty) { + throw Exception( + 'Missing environment variables: ' + '${missingKeys.map((e) => e.key).join(', ')}', + ); + } + + // Check optional environment variables + // TODO(Wyatt): Check optional environment variables, for example: + // if DataSource is API, then check for API base URL. + } + + // REQUIRED ENVIRONMENT VARIABLES + + /// Returns environment type + static EnvType get type => EnvType.fromString(BuildConfigKey.envName.get()); + + /// Returns the data source type + static DataSourceType get dataSource => + DataSourceType.fromString(BuildConfigKey.dataSource.get()); + + // OPTIONAL ENVIRONMENT VARIABLES (can be null or have a default value) + + /// Returns the logger level + static Level get loggerLevel => + LogLevel.fromString(BuildConfigKey.loggerLevel.getOr(() => 'info')); + + /// Returns the feature flags + static List get featureFlags { + final flags = BuildConfigKey.featureFlags.getOr(() => ''); + if (flags.isEmpty) { + return []; + } + + return flags + .split(',') + .map(FeatureFlag.fromString) + .whereType() + .toList(); + } + + // TODO(Wyatt): Add more environment variables here + + // HELPER METHODS + + /// Returns true if the environment is production + static bool get isProduction => type == EnvType.prod; + + /// Returns true if the environment is staging + static bool get isStaging => type == EnvType.staging; + + /// Returns true if the environment is development + static bool get isDevelopment => type == EnvType.dev; + + /// Returns true if the data source is API + static bool get dataSourceIsApi => dataSource == DataSourceType.api; + + /// Returns true if the data source is mock + static bool get dataSourceIsMock => dataSource == DataSourceType.mock; + + /// Retourns true if a feature is enabled + static bool isFeatureEnabled(FeatureFlag feature) => + featureFlags.contains(feature); + + /// Returns true if a feature is disabled + static bool isFeatureDisabled(FeatureFlag feature) => + !isFeatureEnabled(feature); + + /// Returns true if a list of features is enabled + static bool areFeaturesEnabled(List features) { + for (final feature in features) { + if (!isFeatureEnabled(feature)) { + return false; + } + } + + return true; + } + + /// Returns true if a list of features is disabled + static bool areFeaturesDisabled(List features) { + for (final feature in features) { + if (isFeatureEnabled(feature)) { + return false; + } + } + + return true; + } + + /// Returns environment name + static String get name => type.name; + + /// Returns environment summary + static String get summary => BuildConfigKey.summary; +} diff --git a/bricks/wyatt_app_template/__brick__/lib/core/utils/firebase_emulator.dart b/bricks/wyatt_app_template/__brick__/lib/core/utils/firebase_emulator.dart deleted file mode 100644 index 157880d..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/core/utils/firebase_emulator.dart +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/constants/emulator.dart'; - -class FirebaseEmulator { - const FirebaseEmulator._({ - required this.cloudFunctionPort, - required this.firestorePort, - required this.authPort, - required this.storagePort, - required this.host, - }); - - factory FirebaseEmulator.fromEnv() => const FirebaseEmulator._( - cloudFunctionPort: int.fromEnvironment( - Emulator.firebaseCloudFunctionEnvKey, - defaultValue: Emulator.defaultFirebaseCloudFunctionPort, - ), - firestorePort: int.fromEnvironment( - Emulator.firebaseFirestoreEnvKey, - defaultValue: Emulator.defaultFirebaseFirestorePort, - ), - authPort: int.fromEnvironment( - Emulator.firebaseAuthEnvKey, - defaultValue: Emulator.defaultFirebaseAuthPort, - ), - storagePort: int.fromEnvironment( - Emulator.firebaseStorageEnvKey, - defaultValue: Emulator.defaultFirebaseStoragePort, - ), - host: String.fromEnvironment( - Emulator.hostEnvKey, - defaultValue: Emulator.defaultHost, - ), - ); - - final int cloudFunctionPort; - final int firestorePort; - final int authPort; - final int storagePort; - final String host; - - @override - String toString() => 'FirebaseEmulator(cloudFunctionPort: ' - '$cloudFunctionPort, firestorePort: $firestorePort, authPort: $authPort, ' - 'storagePort: $storagePort, host: $host)'; -} diff --git a/apps/wyatt_app_template/starting_template/lib/domain/data_sources/remote/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/data/data_sources/.gitkeep similarity index 100% rename from apps/wyatt_app_template/starting_template/lib/domain/data_sources/remote/.gitkeep rename to bricks/wyatt_app_template/__brick__/lib/data/data_sources/.gitkeep diff --git a/bricks/wyatt_app_template/__brick__/lib/data/data_sources/local/counter_data_source_impl.dart b/bricks/wyatt_app_template/__brick__/lib/data/data_sources/local/counter_data_source_impl.dart deleted file mode 100644 index 16c5b54..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/data_sources/local/counter_data_source_impl.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'dart:convert'; - -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/data/models/integer_model.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/data_sources/local/counter_data_source.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class CounterDataSourceImpl extends CounterDataSource { - // Simulate external data processing - String actual = '{"value": 0}'; - - @override - Future decrement(Integer value) async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - final newValue = current.value - value.value; - if (newValue < 0) { - throw ClientException("Counter can't be negative!"); - } - - final newInteger = IntegerModel(value: newValue); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } - - @override - Future increment(Integer value) async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - final newValue = current.value + value.value; - if (newValue < 0) { - throw ClientException("Counter can't be negative!"); - } - - final newInteger = IntegerModel(value: newValue); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } - - @override - Future getCurrent() async { - final current = - IntegerModel.fromJson(json.decode(actual) as Map); - - return current; - } - - @override - Future reset() async { - const newInteger = IntegerModel(value: 0); - actual = jsonEncode(newInteger.toJson()); - - return newInteger; - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/data/data_sources/remote/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/data/data_sources/remote/.gitkeep deleted file mode 100644 index f94cb6f..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/data_sources/remote/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# just to keep empty folder in brick generation \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/lib/data/models/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/data/models/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/data/models/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.dart b/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.dart deleted file mode 100644 index 292c1c9..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.dart +++ /dev/null @@ -1,15 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; - -part 'integer_model.freezed.dart'; -part 'integer_model.g.dart'; - -@freezed -class IntegerModel extends Integer with _$IntegerModel { - const factory IntegerModel({ - required int value, - }) = _IntegerModel; - - factory IntegerModel.fromJson(Map json) => - _$IntegerModelFromJson(json); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.freezed.dart b/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.freezed.dart deleted file mode 100644 index 2fbb008..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.freezed.dart +++ /dev/null @@ -1,146 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'integer_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); - -IntegerModel _$IntegerModelFromJson(Map json) { - return _IntegerModel.fromJson(json); -} - -/// @nodoc -mixin _$IntegerModel { - int get value => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $IntegerModelCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $IntegerModelCopyWith<$Res> { - factory $IntegerModelCopyWith( - IntegerModel value, $Res Function(IntegerModel) then) = - _$IntegerModelCopyWithImpl<$Res, IntegerModel>; - @useResult - $Res call({int value}); -} - -/// @nodoc -class _$IntegerModelCopyWithImpl<$Res, $Val extends IntegerModel> - implements $IntegerModelCopyWith<$Res> { - _$IntegerModelCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? value = null, - }) { - return _then(_value.copyWith( - value: null == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$_IntegerModelCopyWith<$Res> - implements $IntegerModelCopyWith<$Res> { - factory _$$_IntegerModelCopyWith( - _$_IntegerModel value, $Res Function(_$_IntegerModel) then) = - __$$_IntegerModelCopyWithImpl<$Res>; - @override - @useResult - $Res call({int value}); -} - -/// @nodoc -class __$$_IntegerModelCopyWithImpl<$Res> - extends _$IntegerModelCopyWithImpl<$Res, _$_IntegerModel> - implements _$$_IntegerModelCopyWith<$Res> { - __$$_IntegerModelCopyWithImpl( - _$_IntegerModel _value, $Res Function(_$_IntegerModel) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? value = null, - }) { - return _then(_$_IntegerModel( - value: null == value - ? _value.value - : value // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$_IntegerModel implements _IntegerModel { - const _$_IntegerModel({required this.value}); - - factory _$_IntegerModel.fromJson(Map json) => - _$$_IntegerModelFromJson(json); - - @override - final int value; - - @override - bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$_IntegerModel && - (identical(other.value, value) || other.value == value)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, value); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$_IntegerModelCopyWith<_$_IntegerModel> get copyWith => - __$$_IntegerModelCopyWithImpl<_$_IntegerModel>(this, _$identity); - - @override - Map toJson() { - return _$$_IntegerModelToJson( - this, - ); - } -} - -abstract class _IntegerModel implements IntegerModel { - const factory _IntegerModel({required final int value}) = _$_IntegerModel; - - factory _IntegerModel.fromJson(Map json) = - _$_IntegerModel.fromJson; - - @override - int get value; - @override - @JsonKey(ignore: true) - _$$_IntegerModelCopyWith<_$_IntegerModel> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.g.dart b/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.g.dart deleted file mode 100644 index 291e5cf..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/models/integer_model.g.dart +++ /dev/null @@ -1,17 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'integer_model.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$_IntegerModel _$$_IntegerModelFromJson(Map json) => - _$_IntegerModel( - value: json['value'] as int, - ); - -Map _$$_IntegerModelToJson(_$_IntegerModel instance) => - { - 'value': instance.value, - }; diff --git a/bricks/wyatt_app_template/__brick__/lib/data/repositories/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/data/repositories/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/data/repositories/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/lib/data/repositories/counter_repository_impl.dart b/bricks/wyatt_app_template/__brick__/lib/data/repositories/counter_repository_impl.dart deleted file mode 100644 index 1249785..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/data/repositories/counter_repository_impl.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/data_sources/local/counter_data_source.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; -import 'package:wyatt_type_utils/wyatt_type_utils.dart'; - -class CounterRepositoryImpl extends CounterRepository { - CounterRepositoryImpl({ - required CounterDataSource counterDataSource, - }) : _counterDataSource = counterDataSource; - - final CounterDataSource _counterDataSource; - - @override - FutureOrResult decrement({Integer by = const Integer(1)}) => - Result.tryCatchAsync( - () async => _counterDataSource.decrement(by), - (error) => error, - ); - - @override - FutureOrResult increment({Integer by = const Integer(1)}) => - Result.tryCatchAsync( - () async => _counterDataSource.increment(by), - (error) => error, - ); - - @override - FutureOrResult getCurrent() => - Result.tryCatchAsync( - () async => _counterDataSource.getCurrent(), - (error) => error, - ); - - @override - FutureOrResult reset() => - Result.tryCatchAsync( - () async => _counterDataSource.reset(), - (error) => error, - ); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/local/counter_data_source.dart b/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/local/counter_data_source.dart deleted file mode 100644 index cfbaa26..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/local/counter_data_source.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -abstract class CounterDataSource extends BaseDataSource { - Future decrement(Integer value); - Future increment(Integer value); - Future getCurrent(); - Future reset(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/remote/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/remote/.gitkeep deleted file mode 100644 index f94cb6f..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/data_sources/remote/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# just to keep empty folder in brick generation \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/entities/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/domain/entities/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/domain/entities/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/entities/integer.dart b/bricks/wyatt_app_template/__brick__/lib/domain/entities/integer.dart deleted file mode 100644 index aea24f1..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/entities/integer.dart +++ /dev/null @@ -1,11 +0,0 @@ -// ignore_for_file: public_member_api_docs, sort_constructors_first -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Integer extends Entity { - const Integer(this.value); - - final int value; - - @override - String toString() => 'Integer(value: $value)'; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/repositories/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/domain/repositories/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/domain/repositories/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/repositories/counter_repository.dart b/bricks/wyatt_app_template/__brick__/lib/domain/repositories/counter_repository.dart deleted file mode 100644 index 5a0590b..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/repositories/counter_repository.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -abstract class CounterRepository extends BaseRepository { - FutureOrResult decrement({Integer by = const Integer(1)}); - FutureOrResult increment({Integer by = const Integer(1)}); - FutureOrResult getCurrent(); - FutureOrResult reset(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/.gitkeep new file mode 100644 index 0000000..551b494 --- /dev/null +++ b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/.gitkeep @@ -0,0 +1 @@ +# just to keep empty folder in brick generation diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/decrement.dart b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/decrement.dart deleted file mode 100644 index af614aa..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/decrement.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Decrement extends AsyncUseCase { - Decrement({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(int? params) async { - final step = Integer(params ?? 1); - - return _counterRepository.decrement(by: step); - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/get_current.dart b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/get_current.dart deleted file mode 100644 index 95ea3f5..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/get_current.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class GetCurrent extends AsyncUseCase { - GetCurrent({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(void params) async => - _counterRepository.getCurrent(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/increment.dart b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/increment.dart deleted file mode 100644 index b18434b..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/increment.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Increment extends AsyncUseCase { - Increment({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(int? params) async { - final step = Integer(params ?? 1); - - return _counterRepository.increment(by: step); - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/reset.dart b/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/reset.dart deleted file mode 100644 index 0839bbe..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/domain/usecases/counter/reset.dart +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/entities/integer.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:wyatt_architecture/wyatt_architecture.dart'; - -class Reset extends AsyncUseCase { - Reset({ - required CounterRepository counterRepository, - }) : _counterRepository = counterRepository; - - final CounterRepository _counterRepository; - - @override - FutureOrResult execute(void params) async => - _counterRepository.reset(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/main_development.dart b/bricks/wyatt_app_template/__brick__/lib/main_development.dart index 602ad95..99d71f7 100644 --- a/bricks/wyatt_app_template/__brick__/lib/main_development.dart +++ b/bricks/wyatt_app_template/__brick__/lib/main_development.dart @@ -1,11 +1,7 @@ import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/bootstrap.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - DevelopmentFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/bricks/wyatt_app_template/__brick__/lib/main_production.dart b/bricks/wyatt_app_template/__brick__/lib/main_production.dart index 4d355ab..99d71f7 100644 --- a/bricks/wyatt_app_template/__brick__/lib/main_production.dart +++ b/bricks/wyatt_app_template/__brick__/lib/main_production.dart @@ -1,11 +1,7 @@ import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/bootstrap.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - ProductionFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/bricks/wyatt_app_template/__brick__/lib/main_staging.dart b/bricks/wyatt_app_template/__brick__/lib/main_staging.dart index 9e8a7d4..99d71f7 100644 --- a/bricks/wyatt_app_template/__brick__/lib/main_staging.dart +++ b/bricks/wyatt_app_template/__brick__/lib/main_staging.dart @@ -1,11 +1,7 @@ import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/bootstrap.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/app/app.dart'; void main(List args) { - // Define flavor - StagingFlavor(); - // Initialize environment and variables bootstrap(App.new); } diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/app/app.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/app/app.dart index 917a6d5..edefcfe 100644 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/app/app.dart +++ b/bricks/wyatt_app_template/__brick__/lib/presentation/features/app/app.dart @@ -1,12 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/dependency_injection/get_it.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/routes/router.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/data/repositories/counter_repository_impl.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/routes/app_router.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/gen/app_localizations.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/shared/widgets/flavor_banner.dart'; import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; @@ -15,16 +10,7 @@ class App extends StatelessWidget { @override Widget build(BuildContext context) => MultiProvider( - repositoryProviders: [ - RepositoryProvider( - create: (_) => CounterRepositoryImpl(counterDataSource: getIt()), - ), - ], - blocProviders: [ - BlocProvider( - create: (_) => CounterBloc(), - ), - ], + // TODO(Wyatt): add global bloc providers here child: FlavorBanner( child: MaterialApp.router( title: '{{#titleCase}}{{display_name}}{{/titleCase}}', diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart deleted file mode 100644 index cd0683d..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_bloc.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'dart:async'; - -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; - -part 'counter_event.dart'; -part 'counter_state.dart'; - -/// {@template counter_bloc} -/// CounterBloc description -/// {@endtemplate} -class CounterBloc extends Bloc { - /// {@macro counter_bloc} - CounterBloc() : super(const CounterInitial()) { - on(_onCustomCounterEvent); - } - - FutureOr _onCustomCounterEvent( - CustomCounterEvent event, - Emitter emit, - ) async { - // TODO(wyatt): Add custom UI logic - const _ = 1 + 1; - - return; - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart deleted file mode 100644 index 49c34d2..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_event.dart +++ /dev/null @@ -1,20 +0,0 @@ -part of 'counter_bloc.dart'; - -/// {@template counter_event} -/// CounterEvent description -/// {@endtemplate} -abstract class CounterEvent extends Equatable { - /// {@macro counter_event} - const CounterEvent(); -} - -/// {@template custom_counter_event} -/// Event added when some custom logic happens -/// {@endtemplate} -class CustomCounterEvent extends CounterEvent { - /// {@macro custom_counter_event} - const CustomCounterEvent(); - - @override - List get props => []; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart deleted file mode 100644 index 79dfd2f..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_bloc/counter_state.dart +++ /dev/null @@ -1,20 +0,0 @@ -part of 'counter_bloc.dart'; - -/// {@template counter_state} -/// CounterState description -/// {@endtemplate} -abstract class CounterState extends Equatable { - /// {@macro counter_state} - const CounterState(); -} - -/// {@template counter_initial} -/// The initial state of CounterState -/// {@endtemplate} -class CounterInitial extends CounterState { - /// {@macro counter_initial} - const CounterInitial(); - - @override - List get props => []; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart deleted file mode 100644 index 5467bd3..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart +++ /dev/null @@ -1,86 +0,0 @@ -import 'dart:async'; - -import 'package:equatable/equatable.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/decrement.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/get_current.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/increment.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/reset.dart'; - -part 'counter_state.dart'; - -/// {@template counter_cubit} -/// CounterCubit manages UI depending on counter state. -/// {@endtemplate} -class CounterCubit extends Cubit { - /// {@macro counter_cubit} - CounterCubit({ - required Decrement decrement, - required Increment increment, - required GetCurrent getCurrent, - required Reset reset, - }) : _decrement = decrement, - _increment = increment, - _getCurrent = getCurrent, - _reset = reset, - super(const CounterState(0)); - - final Decrement _decrement; - final Increment _increment; - final GetCurrent _getCurrent; - final Reset _reset; - - /// Decrement counter. - FutureOr decrement([int by = 1]) async { - final result = await _decrement.call(by); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Increment counter. - FutureOr increment([int by = 1]) async { - final result = await _increment.call(by); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Get current counter state. - FutureOr getCurrent() async { - final result = await _getCurrent.call(null); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - /// Reset counter state. - FutureOr reset() async { - final result = await _reset.call(null); - - result.fold( - (integer) => emit(CounterState(integer.value)), - addError, - ); - - return; - } - - @override - void onError(Object error, StackTrace stackTrace) { - emit(state); - super.onError(error, stackTrace); - } -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart deleted file mode 100644 index 50132cd..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/blocs/counter_cubit/counter_state.dart +++ /dev/null @@ -1,14 +0,0 @@ -part of 'counter_cubit.dart'; - -/// {@template counter_state} -/// CounterState containing counter value -/// {@endtemplate} -class CounterState extends Equatable { - /// {@macro counter_state} - const CounterState(this.value); - - final int value; - - @override - List get props => [value]; -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/counter.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/counter.dart deleted file mode 100644 index 812d65c..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/counter.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/screens/counter_provider.dart'; - -class Counter extends StatelessWidget { - const Counter({super.key}); - - static const String pageName = 'counterPage'; - - @override - Widget build(BuildContext context) => const CounterProvider(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/counter_provider.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/counter_provider.dart deleted file mode 100644 index b17d165..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/counter_provider.dart +++ /dev/null @@ -1,76 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/build_context_extension.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/repositories/counter_repository.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/decrement.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/get_current.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/increment.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/domain/usecases/counter/reset.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/screens/widgets/counter_consumer_widget.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/shared/layouts/{{#snakeCase}}{{project_name}}{{/snakeCase}}_scaffold.dart'; -import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; - -/// {@template counter_provider} -/// CounterProvider provides bloc to his children. -/// {@endtemplate} -class CounterProvider extends CubitProviderScreen { - /// {@macro counter_provider} - const CounterProvider({super.key}); - - @override - CounterCubit create(BuildContext context) => CounterCubit( - decrement: Decrement( - counterRepository: repo(context), - ), - increment: Increment( - counterRepository: repo(context), - ), - getCurrent: GetCurrent( - counterRepository: repo(context), - ), - reset: Reset( - counterRepository: repo(context), - ), - ); - - @override - CounterCubit init(BuildContext context, CounterCubit bloc) => - bloc..getCurrent(); - - @override - Widget builder(BuildContext context) => {{#pascalCase}}{{project_name}}{{/pascalCase}}Scaffold( - title: Text(context.l10n.counterAppBarTitle), - body: const CounterConsumerWidget(), - fabChildren: [ - FloatingActionButton( - heroTag: 'increment_tag', - onPressed: () => bloc(context).increment(), - child: const Icon(Icons.add), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'increment_10_tag', - onPressed: () => bloc(context).increment(10), - child: const Text('+10'), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'decrement_tag', - onPressed: () => bloc(context).decrement(), - child: const Icon(Icons.remove), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'decrement_10_tag', - onPressed: () => bloc(context).decrement(10), - child: const Text('-10'), - ), - const SizedBox(height: 8), - FloatingActionButton( - heroTag: 'reset_tag', - onPressed: () => bloc(context).reset(), - child: const Icon(Icons.refresh), - ), - ], - ); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart deleted file mode 100644 index 5883630..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/screens/widgets/counter_consumer_widget.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/build_context_extension.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/blocs/counter_cubit/counter_cubit.dart'; -import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart'; - -/// {@template counter_consumer_widget} -/// CounterConsumerWidget is a stateful widget. Aware of state changes. -/// {@endtemplate} -class CounterConsumerWidget - extends CubitConsumerScreen { - /// {@macro counter_consumer_widget} - const CounterConsumerWidget({super.key}); - - @override - Widget onBuild(BuildContext context, CounterState state) => Text( - context.l10n.youHavePushed(state.value), - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline3, - ); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/stateless/counter_widget.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/stateless/counter_widget.dart deleted file mode 100644 index 32a7619..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/counter/stateless/counter_widget.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:flutter/material.dart'; - -/// {@template counter_widget} -/// CounterWidget is a stateless widget. (Not aware of cubit or bloc states) -/// {@endtemplate} -class CounterWidget extends StatelessWidget { - /// {@macro counter_widget} - const CounterWidget({super.key}); - - @override - Widget build(BuildContext context) => Container(); -} diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/features/home/home.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/features/home/home.dart index 9e2dd3c..ab52d88 100644 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/features/home/home.dart +++ b/bricks/wyatt_app_template/__brick__/lib/presentation/features/home/home.dart @@ -1,9 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:gap/gap.dart'; -import 'package:go_router/go_router.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/extensions/build_context_extension.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/gen/assets.gen.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/features/counter/counter.dart'; import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/presentation/shared/layouts/{{#snakeCase}}{{project_name}}{{/snakeCase}}_scaffold.dart'; class Home extends StatelessWidget { @@ -17,11 +13,6 @@ class Home extends StatelessWidget { child: Column( children: [ Assets.images.wyattLogo.image(width: 150), - const Gap(30), - ElevatedButton( - child: Text(context.l10n.goToCounter), - onPressed: () => context.pushNamed(Counter.pageName), - ), ], ), ), diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/.gitkeep b/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/.gitkeep deleted file mode 100644 index f94cb6f..0000000 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# just to keep empty folder in brick generation \ No newline at end of file diff --git a/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/flavor_banner.dart b/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/flavor_banner.dart index e3b85c6..fc21533 100644 --- a/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/flavor_banner.dart +++ b/bricks/wyatt_app_template/__brick__/lib/presentation/shared/widgets/flavor_banner.dart @@ -1,27 +1,11 @@ -// Copyright (C) 2023 WYATT GROUP -// Please see the AUTHORS file for details. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - import 'package:flutter/material.dart'; -import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart'; +import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/env.dart'; /// {@template flavor_banner} /// A banner that displays the current flavor. /// This is useful for quickly identifying which flavor is currently running. /// -/// When [Flavor.shouldShowBanner] is `false`, this widget will return [child]. +/// When [Env.isProduction] is `true`, this widget will return [child]. /// You can also override this behavior by setting [visible] to `true`. /// /// Wrap your [MaterialApp] with this widget to display the banner. @@ -30,7 +14,7 @@ import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor /// /// ```dart /// FlavorBanner( -/// visible: true, // or null to use Flavor.shouldShowBanner() +/// visible: true, // or null to use !Env.isProduction /// child: const MaterialApp( /// title: 'Starting Template', /// ... @@ -47,25 +31,23 @@ class FlavorBanner extends StatelessWidget { final Widget? child; - /// Defaults to [Flavor.shouldShowBanner]. + /// Defaults to `!Env.isProduction`. final bool? visible; @override Widget build(BuildContext context) { - final visible = this.visible ?? Flavor.shouldShowBanner(); + final visible = this.visible ?? !Env.isProduction; if (!visible) { return child ?? const SizedBox.shrink(); } - final flavor = Flavor.instance; - return Directionality( textDirection: TextDirection.ltr, child: Banner( location: BannerLocation.topEnd, - message: flavor.name, - color: flavor.color, + message: Env.name, + color: Color((Env.type.index+1) * 0x33FFFFFF), child: child, ), ); diff --git a/bricks/wyatt_app_template/__brick__/pubspec.yaml b/bricks/wyatt_app_template/__brick__/pubspec.yaml index 55cdb5c..b9be981 100644 --- a/bricks/wyatt_app_template/__brick__/pubspec.yaml +++ b/bricks/wyatt_app_template/__brick__/pubspec.yaml @@ -2,80 +2,87 @@ name: {{#snakeCase}}{{project_name}}{{/snakeCase}} version: 1.0.0+1 publish_to: none description: {{#sentenceCase}}{{description}}{{/sentenceCase}} -environment: - sdk: '>=2.18.0 <3.0.0' - flutter: '>=3.0.0' -dependencies: - cupertino_icons: ^1.0.5 + +environment: + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.0.0" + +dependencies: + cupertino_icons: ^1.0.6 equatable: ^2.0.5 - flutter_bloc: ^8.1.1 - flutter_native_splash: ^2.2.15 - freezed_annotation: ^2.2.0 - gap: ^2.0.1 - get_it: ^7.2.0 - go_router: ^6.0.1 - intl: ^0.17.0 - json_annotation: ^4.8.0 - url_launcher: ^6.1.7 - uuid: ^3.0.7 - flutter: + flutter_bloc: ^8.1.3 + flutter_native_splash: ^2.3.2 + freezed_annotation: ^2.4.1 + gap: ^3.0.1 + get_it: ^7.6.4 + go_router: ^10.1.2 + intl: ^0.18.1 + json_annotation: ^4.8.1 + + flutter: sdk: flutter - flutter_localizations: + flutter_localizations: sdk: flutter - wyatt_architecture: - version: ^0.2.0 - hosted: + + wyatt_architecture: + version: ^0.2.0+1 + hosted: name: wyatt_architecture url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ - wyatt_bloc_helper: + + wyatt_bloc_helper: version: ^2.0.1 - hosted: + hosted: name: wyatt_bloc_helper url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ - wyatt_type_utils: + + wyatt_type_utils: version: ^0.0.5 - hosted: + hosted: name: wyatt_type_utils url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ -dev_dependencies: - build_runner: ^2.3.3 - dart_code_metrics: ^5.4.0 - dependency_validator: ^3.2.2 - flutter_gen_runner: ^5.1.0+1 - flutter_launcher_icons: ^0.11.0 - freezed: ^2.3.2 - json_serializable: ^6.6.0 - pubspec_dependency_sorter: ^1.0.3 - rename: ^2.1.1 - flutter_test: + logging: ^1.2.0 + +dev_dependencies: + build_runner: ^2.4.6 + dart_code_metrics: + git: + url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/dart-code-metrics.git + ref: master + flutter_launcher_icons: ^0.13.1 + freezed: ^2.4.2 + json_serializable: ^6.7.1 + flutter_test: sdk: flutter - wyatt_analysis: + wyatt_analysis: version: ^2.5.0 - hosted: + hosted: name: wyatt_analysis url: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/ -flutter: - assets: + +flutter: + assets: - assets/images/ uses-material-design: true -flutter_gen: + +flutter_gen: output: lib/gen/ - integrations: + integrations: flutter_svg: true flare_flutter: true rive: true lottie: true - colors: - inputs: + colors: + inputs: - assets/colors.xml -flutter_icons: +flutter_icons: android: launcher_icon image_path: assets/images/wyatt_logo.jpeg - adaptive_icon_background: '#FFFFFF' + adaptive_icon_background: "#FFFFFF" ios: true -flutter_native_splash: +flutter_native_splash: image: assets/images/wyatt_logo.jpeg - color: '#FFFFFF' + color: "#FFFFFF" android_gravity: fill ios_content_mode: scaleAspectFit android: true diff --git a/bricks/wyatt_app_template/__brick__/web/favicon.png b/bricks/wyatt_app_template/__brick__/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/bricks/wyatt_app_template/__brick__/web/favicon.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/web/icons/Icon-192.png b/bricks/wyatt_app_template/__brick__/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/bricks/wyatt_app_template/__brick__/web/icons/Icon-192.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/web/icons/Icon-512.png b/bricks/wyatt_app_template/__brick__/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/bricks/wyatt_app_template/__brick__/web/icons/Icon-512.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-192.png b/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d7..0000000 Binary files a/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-512.png b/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c566..0000000 Binary files a/bricks/wyatt_app_template/__brick__/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/bricks/wyatt_app_template/__brick__/web/index.html b/bricks/wyatt_app_template/__brick__/web/index.html deleted file mode 100644 index ad65153..0000000 --- a/bricks/wyatt_app_template/__brick__/web/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - {{#titleCase}}{{display_name}}{{/titleCase}} - - - - - - - - - - diff --git a/bricks/wyatt_app_template/__brick__/web/manifest.json b/bricks/wyatt_app_template/__brick__/web/manifest.json deleted file mode 100644 index 556e6b9..0000000 --- a/bricks/wyatt_app_template/__brick__/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "{{#titleCase}}{{display_name}}{{/titleCase}}", - "short_name": "{{#titleCase}}{{display_name}}{{/titleCase}}", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "{{#sentenceCase}}{{description}}{{/sentenceCase}}", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/bricks/wyatt_app_template/hooks/post_gen.dart b/bricks/wyatt_app_template/hooks/post_gen.dart index 398a858..d9aa04f 100644 --- a/bricks/wyatt_app_template/hooks/post_gen.dart +++ b/bricks/wyatt_app_template/hooks/post_gen.dart @@ -35,5 +35,38 @@ void removeGitKeepFiles(String targetPath) { Future run(HookContext context) async { final workingDirectory = Directory.current.path; + + /// Remove .gitkeep files + print('Removing .gitkeep files'); removeGitKeepFiles(workingDirectory); + + /// dart pub get + print('Running `dart pub get`'); + await Process.run('dart', ['pub', 'get'], runInShell: true); + + /// dart format . --fix && dart fix . --apply + print('Running `dart format . --fix && dart fix . --apply`'); + await Process.run('dart', ['format', '.', '--fix'], runInShell: true); + await Process.run('dart', ['fix', '.', '--apply'], runInShell: true); + + final bundleId = context.vars['bundle_id'] as String?; + final appName = bundleId?.split('.').last; + final org = bundleId?.replaceAll('.$appName', ''); + + /// flutter create --platforms android,ios --org com.example --project-name example . + print( + 'Running `flutter create --platforms android,ios --org $org --project-name $appName .`'); + await Process.run( + 'flutter', + [ + 'create', + '--platforms', + 'android,ios', + '--org', + org ?? 'com.example', + '--project-name', + appName ?? 'example', + '.' + ], + runInShell: true); }