diff --git a/apps/wyatt_clean_code/generate.sh b/apps/wyatt_clean_code/generate.sh
index 58ddeb1..ac3f503 100755
--- a/apps/wyatt_clean_code/generate.sh
+++ b/apps/wyatt_clean_code/generate.sh
@@ -3,6 +3,7 @@
make clean
rm -rf .idea
rm -f wyatt_clean_code.iml
+rm .fvm/flutter_sdk
cd ../../
echo "Brick generator..."
dart tools/brick_generator/bin/brick_generator.dart wyatt_clean_code wyatt_clean_code wyatt-clean-code "Wyatt Demo" com.example.wyatt_clean_code
@@ -17,4 +18,5 @@ mv -f bricks/wyatt_clean_code/__brick__/ios/ bricks/wyatt_clean_code/__brick__/{
mkdir bricks/wyatt_clean_code/__brick__/{{#enable_web}}web\{\{
mv -f bricks/wyatt_clean_code/__brick__/web/ bricks/wyatt_clean_code/__brick__/{{#enable_web}}web{{/enable_web}}
-rm bricks/wyatt_clean_code/__brick__/generate.sh
\ No newline at end of file
+rm bricks/wyatt_clean_code/__brick__/generate.sh
+rm -rf bricks/wyatt_clean_code/__brick__/.fvm/flutter_sdk
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/.gitignore b/bricks/wyatt_clean_code/__brick__/.gitignore
new file mode 100644
index 0000000..a8e938c
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/.gitignore
@@ -0,0 +1,47 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Web related
+lib/generated_plugin_registrant.dart
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/bricks/wyatt_clean_code/__brick__/.metadata b/bricks/wyatt_clean_code/__brick__/.metadata
new file mode 100644
index 0000000..2112298
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/.metadata
@@ -0,0 +1,30 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled.
+
+version:
+ revision: f1875d570e39de09040c8f79aa13cc56baab8db1
+ channel: stable
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
+ base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
+ - platform: web
+ create_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
+ base_revision: f1875d570e39de09040c8f79aa13cc56baab8db1
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/bricks/wyatt_clean_code/__brick__/.vscode/launch.json b/bricks/wyatt_clean_code/__brick__/.vscode/launch.json
index 96763cd..40a2104 100644
--- a/bricks/wyatt_clean_code/__brick__/.vscode/launch.json
+++ b/bricks/wyatt_clean_code/__brick__/.vscode/launch.json
@@ -5,21 +5,121 @@
"version": "0.2.0",
"configurations": [
{
- "name": "{{#snakeCase}}{{project_name}}{{/snakeCase}}",
- "request": "launch",
- "type": "dart"
- },
- {
- "name": "{{#snakeCase}}{{project_name}}{{/snakeCase}} (profile mode)",
+ "name": "Launch development",
"request": "launch",
"type": "dart",
+ "program": "lib/main_development.dart",
+ "args": [
+ "--flavor",
+ "development",
+ "--target",
+ "lib/main_development.dart"
+ ],
+ "flutterMode": "debug"
+ },
+ {
+ "name": "Launch development in profile mode",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_development.dart",
+ "args": [
+ "--flavor",
+ "development",
+ "--target",
+ "lib/main_development.dart"
+ ],
"flutterMode": "profile"
},
{
- "name": "{{#snakeCase}}{{project_name}}{{/snakeCase}} (release mode)",
+ "name": "Launch development in release mode",
"request": "launch",
"type": "dart",
+ "program": "lib/main_development.dart",
+ "args": [
+ "--flavor",
+ "development",
+ "--target",
+ "lib/main_development.dart"
+ ],
"flutterMode": "release"
- }
+ },
+ {
+ "name": "Launch staging",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_staging.dart",
+ "args": [
+ "--flavor",
+ "staging",
+ "--target",
+ "lib/main_staging.dart"
+ ],
+ "flutterMode": "debug"
+ },
+ {
+ "name": "Launch staging in profile mode",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_staging.dart",
+ "args": [
+ "--flavor",
+ "staging",
+ "--target",
+ "lib/main_staging.dart"
+ ],
+ "flutterMode": "profile"
+ },
+ {
+ "name": "Launch staging in release mode",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_staging.dart",
+ "args": [
+ "--flavor",
+ "staging",
+ "--target",
+ "lib/main_staging.dart"
+ ],
+ "flutterMode": "release"
+ },
+ {
+ "name": "Launch production",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_production.dart",
+ "args": [
+ "--flavor",
+ "production",
+ "--target",
+ "lib/main_production.dart"
+ ],
+ "flutterMode": "debug"
+ },
+ {
+ "name": "Launch production in profile mode",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_production.dart",
+ "args": [
+ "--flavor",
+ "production",
+ "--target",
+ "lib/main_production.dart"
+ ],
+ "flutterMode": "profile"
+ },
+ {
+ "name": "Launch production in release mode",
+ "request": "launch",
+ "type": "dart",
+ "program": "lib/main_production.dart",
+ "args": [
+ "--flavor",
+ "production",
+ "--target",
+ "lib/main_production.dart"
+ ],
+ "flutterMode": "release"
+ },
]
}
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/.vscode/settings.json b/bricks/wyatt_clean_code/__brick__/.vscode/settings.json
index 855293b..fa6f612 100644
--- a/bricks/wyatt_clean_code/__brick__/.vscode/settings.json
+++ b/bricks/wyatt_clean_code/__brick__/.vscode/settings.json
@@ -1,4 +1,5 @@
{
+ "dart.flutterSdkPath": ".fvm/flutter_sdk",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.config": {
"blankLinesAfter": 0,
diff --git a/bricks/wyatt_clean_code/__brick__/Makefile b/bricks/wyatt_clean_code/__brick__/Makefile
index f46b81c..a9a3ef9 100644
--- a/bricks/wyatt_clean_code/__brick__/Makefile
+++ b/bricks/wyatt_clean_code/__brick__/Makefile
@@ -1,4 +1,4 @@
-.PHONY: help clean get upgrade format lint gen
+.PHONY: help clean get upgrade format lint gen watch run-dev run-stg run-prod
# Adding a help file: https://gist.github.com/prwhite/8168133#gistcomment-1313022
help: ## This help dialog.
@@ -33,6 +33,22 @@ lint: ## Lints the code.
@echo "• Verifying code..."
@dart analyze . || (echo "Error in project"; exit 1)
-gen: get ## Run build_runner (Freezed, Fluttergen, etc...)
- @echo "• Running build_runner scripts"
- @flutter pub run build_runner build
\ No newline at end of file
+gen: get ## Run build_runner build (Freezed, Fluttergen, Hive etc...)
+ @echo "• build_runner build"
+ @flutter pub run build_runner build
+
+watch: get ## Run build_runner watch (Freezed, Fluttergen, Hive etc...)
+ @echo "• build_runner watch"
+ @flutter pub run build_runner watch
+
+run-dev: ## Run app in development mode
+ @echo "• Running the app (development)"
+ @flutter run --flavor development --target lib/main_development.dart
+
+run-stg: ## Run app in staging mode
+ @echo "• Running the app (staging)"
+ @flutter run --flavor staging --target lib/main_staging.dart
+
+run-prod: ## Run app in production mode
+ @echo "• Running the app (production)"
+ @flutter run --flavor production --target lib/main_production.dart
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/README.md b/bricks/wyatt_clean_code/__brick__/README.md
new file mode 100644
index 0000000..4136204
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/README.md
@@ -0,0 +1,16 @@
+# {{#snakeCase}}{{project_name}}{{/snakeCase}}
+
+{{{description}}}
+
+## Getting Started
+
+This project is a starting point for a Flutter application.
+
+A few resources to get you started if this is your first Flutter project:
+
+- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
+- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
+
+For help getting started with Flutter development, view the
+[online documentation](https://docs.flutter.dev/), which offers tutorials,
+samples, guidance on mobile development, and a full API reference.
diff --git a/bricks/wyatt_clean_code/__brick__/analysis_options.yaml b/bricks/wyatt_clean_code/__brick__/analysis_options.yaml
index d00274d..9bdb566 100644
--- a/bricks/wyatt_clean_code/__brick__/analysis_options.yaml
+++ b/bricks/wyatt_clean_code/__brick__/analysis_options.yaml
@@ -1,9 +1,35 @@
-# {{#enable_analysis}}
-include: package:wyatt_analysis/analysis_options.flutter.experimental.yaml
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
-analyzer:
- strong-mode:
- implicit-dynamic: true
-# {{/enable_analysis}}{{^enable_analysis}}
-include: package:flutter_lints/flutter.yaml
-# {{/enable_analysis}}
\ No newline at end of file
+# The following line activates a set of recommended lints for Flutter by
+# Wyatt Studio, for apps packages, and plugins designed to
+# encourage good coding practices.
+include: package:wyatt_analysis/analysis_options.flutter.yaml
+
+analyzer:
+ exclude:
+ - '**/*.g.dart'
+ - '**/*.freezed.dart'
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at
+ # https://dart-lang.github.io/linter/lints/index.html.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/bricks/wyatt_clean_code/__brick__/assets/colors.xml b/bricks/wyatt_clean_code/__brick__/assets/colors.xml
new file mode 100644
index 0000000..f5e9c9a
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/assets/colors.xml
@@ -0,0 +1,61 @@
+
+
+ #FF2196F3
+
+ #FF0061A6
+ #FFFFFFFF
+ #FFD0E4FF
+ #FF001D36
+
+ #FF535F70
+ #FFFFFFFF
+ #FFD6E3F7
+ #FF101C2B
+
+ #FFBA1B1B
+ #FFFFFFFF
+ #FFFFDAD4
+ #FF410001
+
+ #FFFDFCFF
+ #FF1B1B1B
+ #FFFDFCFF
+ #FF1B1B1B
+ #FFDFE2EB
+ #FF42474E
+ #FF73777F
+ #FF000000
+
+ #FF2F3033
+ #FFF1F0F4
+ #FF9CCAFF
+
+
+ #FF9CCAFF
+ #FF00325A
+ #FF00497F
+ #FFD0E4FF
+
+ #FFBBC8DB
+ #FF253140
+ #FF3C4858
+ #FFD6E3F7
+
+ #FFFFB4A9
+ #FF680003
+ #FF930006
+ #FFFFB4A9
+
+ #FF1B1B1B
+ #FFE2E2E6
+ #FF1B1B1B
+ #FFE2E2E6
+ #FF42474E
+ #FFC3C7D0
+ #FF8D9199
+ #FF000000
+
+ #FFE2E2E6
+ #FF2F3033
+ #FF0061A6
+
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/assets/colors/dark.xml b/bricks/wyatt_clean_code/__brick__/assets/colors/dark.xml
deleted file mode 100644
index 76afbe8..0000000
--- a/bricks/wyatt_clean_code/__brick__/assets/colors/dark.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- #FFFFFF
- #000000
- #EEEEEE
- #979797
- #CF2A2A
- #DF9527
-
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/assets/fonts/.gitkeep b/bricks/wyatt_clean_code/__brick__/assets/fonts/.gitkeep
index e69de29..f94cb6f 100644
--- a/bricks/wyatt_clean_code/__brick__/assets/fonts/.gitkeep
+++ b/bricks/wyatt_clean_code/__brick__/assets/fonts/.gitkeep
@@ -0,0 +1 @@
+# just to keep empty folder in brick generation
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/assets/images/.gitkeep b/bricks/wyatt_clean_code/__brick__/assets/images/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/bricks/wyatt_clean_code/__brick__/assets/images/wyatt-studio-logo.png b/bricks/wyatt_clean_code/__brick__/assets/images/wyatt-studio-logo.png
new file mode 100644
index 0000000..322633e
Binary files /dev/null and b/bricks/wyatt_clean_code/__brick__/assets/images/wyatt-studio-logo.png differ
diff --git a/bricks/wyatt_clean_code/__brick__/assets/{{#enable_l10n}}l10n{{/enable_l10n}}/intl_fr.arb b/bricks/wyatt_clean_code/__brick__/assets/l10n/intl_fr.arb
similarity index 54%
rename from bricks/wyatt_clean_code/__brick__/assets/{{#enable_l10n}}l10n{{/enable_l10n}}/intl_fr.arb
rename to bricks/wyatt_clean_code/__brick__/assets/l10n/intl_fr.arb
index 1a6db0f..b95f76d 100644
--- a/bricks/wyatt_clean_code/__brick__/assets/{{#enable_l10n}}l10n{{/enable_l10n}}/intl_fr.arb
+++ b/bricks/wyatt_clean_code/__brick__/assets/l10n/intl_fr.arb
@@ -4,6 +4,15 @@
"@counterAppBarTitle": {
"description": "Texte affiché dans l'AppBar de la page Compteur"
},
+ "youHavePushed": "Vous avez appuyé {count} fois sur le bouton !",
+ "@youHavePushed": {
+ "description": "Message affiché sur la page compteur",
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ },
"goToCounter": "Aller au Compteur",
"@goToCounter": {
"description": "Texte affiché dans le bouton ammenant vers la page Compteur"
diff --git a/bricks/wyatt_clean_code/__brick__/lib/app.dart b/bricks/wyatt_clean_code/__brick__/lib/app.dart
deleted file mode 100644
index cb21a0e..0000000
--- a/bricks/wyatt_clean_code/__brick__/lib/app.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-import 'package:{{project_name.snakeCase()}}/widget_tree.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-{{#enable_auth}}import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';{{/enable_auth}}
-
-class App extends StatelessWidget {
- const App({super.key});
-
- @override
- Widget build(BuildContext context) {
- // Data providers
- // ...
- // return MultiRepositoryProvider(
- // providers: [
- // // Repositories
- // ],
- // child: MultiBlocProvider(
- // providers: [
- // // Toplevel Blocs and Cubits
- // ],
- // child: const WidgetTree(),
- // ),
- // );
- return const WidgetTree();
- }
-}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/bootstrap.dart b/bricks/wyatt_clean_code/__brick__/lib/bootstrap.dart
new file mode 100644
index 0000000..55dec5e
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/bootstrap.dart
@@ -0,0 +1,46 @@
+import 'dart:async';
+
+import 'package:flutter/foundation.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/dependency_injection/get_it.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor_settings.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/app_bloc_observer.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/wyatt_printer.dart';
+
+Future bootstrap(FutureOr Function() builder) async {
+ await runZonedGuarded(
+ () async {
+ WidgetsFlutterBinding.ensureInitialized();
+
+ FlutterError.onError = (details) {
+ WyattPrinter.get().e(
+ '',
+ details,
+ details.stack,
+ );
+ };
+
+ FlavorSettings.init();
+ GetItInitializer.run();
+
+ GoRouter.setUrlPathStrategy(UrlPathStrategy.path);
+
+ if (!kReleaseMode) {
+ final env = FlavorSettings.get();
+ WyattPrinter.get().i('Flavor : ${env.flavor.name}');
+ }
+
+ await BlocOverrides.runZoned(
+ () async => runApp(await builder()),
+ blocObserver: AppBlocObserver(),
+ );
+ },
+ (error, stackTrace) => WyattPrinter.get().e(
+ '',
+ error,
+ stackTrace,
+ ),
+ );
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/constants/.gitkeep b/bricks/wyatt_clean_code/__brick__/lib/core/constants/.gitkeep
new file mode 100644
index 0000000..f94cb6f
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/constants/.gitkeep
@@ -0,0 +1 @@
+# just to keep empty folder in brick generation
\ No newline at end of file
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/dependency_injection/get_it.dart b/bricks/wyatt_clean_code/__brick__/lib/core/dependency_injection/get_it.dart
new file mode 100644
index 0000000..7180ebb
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/dependency_injection/get_it.dart
@@ -0,0 +1,15 @@
+import 'dart:async';
+
+import 'package:get_it/get_it.dart';
+
+final getIt = GetIt.I;
+
+abstract class GetItInitializer {
+ static Future init() async {
+ // Here, register data sources
+ }
+
+ static void run() {
+ unawaited(init());
+ }
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/design_system/colors.dart b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/colors.dart
new file mode 100644
index 0000000..a4ea53c
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/colors.dart
@@ -0,0 +1,2 @@
+/// Generate colors with `flutter pub run build_runner build`
+export 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/gen/colors.gen.dart';
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/design_system/sizing.dart b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/sizing.dart
new file mode 100644
index 0000000..1c4fdc0
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/sizing.dart
@@ -0,0 +1,235 @@
+import 'package:flutter/material.dart';
+import 'package:gap/gap.dart';
+
+/// Geometric progression.
+abstract class AppSizing {
+ /// Default to 1
+ static const double factor = 1;
+
+ /// SizedBox.shrink();
+ static const SizedBox empty = SizedBox.shrink();
+
+ /// xxs = factor * 2
+ static const double xxs = factor * 2;
+
+ /// xs = factor * 4
+ static const double xs = factor * 4;
+
+ /// s = factor * 8
+ static const double s = factor * 8;
+
+ /// m = factor * 16
+ static const double m = factor * 16;
+
+ /// l = factor * 32
+ static const double l = factor * 32;
+
+ /// xl = factor * 64
+ static const double xl = factor * 64;
+
+ /// xxl = factor * 128
+ static const double xxl = factor * 128;
+
+ /// xxs = factor * 2
+ static const Gap xxsGap = Gap(xxs);
+
+ /// xs = factor * 4
+ static const Gap xsGap = Gap(xs);
+
+ /// s = factor * 8
+ static const Gap sGap = Gap(s);
+
+ /// m = factor * 16
+ static const Gap mGap = Gap(m);
+
+ /// l = factor * 32
+ static const Gap lGap = Gap(l);
+
+ /// xl = factor * 64
+ static const Gap xlGap = Gap(xl);
+
+ /// xxl = factor * 128
+ static const Gap xxlGap = Gap(xxl);
+
+ /// xxs = factor * 2
+ static const Radius xxsRadius = Radius.circular(xxs);
+
+ /// xs = factor * 4
+ static const Radius xsRadius = Radius.circular(xs);
+
+ /// s = factor * 8
+ static const Radius sRadius = Radius.circular(s);
+
+ /// m = factor * 16
+ static const Radius mRadius = Radius.circular(m);
+
+ /// l = factor * 32
+ static const Radius lRadius = Radius.circular(l);
+
+ /// xl = factor * 64
+ static const Radius xlRadius = Radius.circular(xl);
+
+ /// xxl = factor * 128
+ static const Radius xxlRadius = Radius.circular(xxl);
+
+ /// xxs = factor * 2
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets xxsSquareInset = EdgeInsets.all(xxs);
+
+ /// xs = factor * 4
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets xsSquareInset = EdgeInsets.all(xs);
+
+ /// s = factor * 8
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets sSquareInset = EdgeInsets.all(s);
+
+ /// m = factor * 16
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets mSquareInset = EdgeInsets.all(m);
+
+ /// l = factor * 32
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets lSquareInset = EdgeInsets.all(l);
+
+ /// xl = factor * 64
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets xlSquareInset = EdgeInsets.all(xl);
+
+ /// xxl = factor * 128
+ ///
+ /// A square inset offers indents content on all four sides.
+ ///
+ /// *e.g [EdgeInsets.all(value)]*
+ static const EdgeInsets xxlSquareInset = EdgeInsets.all(xxl);
+
+ /// xxs = factor * 2
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets xxsSquishInset =
+ EdgeInsets.symmetric(horizontal: xxs, vertical: xxs / 2);
+
+ /// xs = factor * 4
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets xsSquishInset =
+ EdgeInsets.symmetric(horizontal: xs, vertical: xs / 2);
+
+ /// s = factor * 8
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets sSquishInset =
+ EdgeInsets.symmetric(horizontal: s, vertical: s / 2);
+
+ /// m = factor * 16
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets mSquishInset =
+ EdgeInsets.symmetric(horizontal: m, vertical: m / 2);
+
+ /// l = factor * 32
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets lSquishInset =
+ EdgeInsets.symmetric(horizontal: l, vertical: l / 2);
+
+ /// xl = factor * 64
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets xlSquishInset =
+ EdgeInsets.symmetric(horizontal: xl, vertical: xl / 2);
+
+ /// xxl = factor * 128
+ ///
+ /// A squished inset reduces space top and bottom by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(horizontal: value, vertical: value / 2)]*
+ static const EdgeInsets xxlSquishInset =
+ EdgeInsets.symmetric(horizontal: xxl, vertical: xxl / 2);
+
+ /// xxs = factor * 2
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets xxsStretchInset =
+ EdgeInsets.symmetric(vertical: xxs, horizontal: xxs / 2);
+
+ /// xs = factor * 4
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets xsStretchInset =
+ EdgeInsets.symmetric(vertical: xs, horizontal: xs / 2);
+
+ /// s = factor * 8
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets sStretchInset =
+ EdgeInsets.symmetric(vertical: s, horizontal: s / 2);
+
+ /// m = factor * 16
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets mStretchInset =
+ EdgeInsets.symmetric(vertical: m, horizontal: m / 2);
+
+ /// l = factor * 32
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets lStretchInset =
+ EdgeInsets.symmetric(vertical: l, horizontal: l / 2);
+
+ /// xl = factor * 64
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets xlStretchInset =
+ EdgeInsets.symmetric(vertical: xl, horizontal: xl / 2);
+
+ /// xxl = factor * 128
+ ///
+ /// A stretched inset reduces space left and right by 50%.
+ ///
+ /// *e.g [EdgeInsets.symmetric(vertical: value, horizontal: value / 2)]*
+ static const EdgeInsets xxlStretchInset =
+ EdgeInsets.symmetric(vertical: xxl, horizontal: xxl / 2);
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/design_system/theme.dart b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/theme.dart
new file mode 100644
index 0000000..4903272
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/theme.dart
@@ -0,0 +1,240 @@
+import 'package:flutter/material.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/design_system/colors.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/design_system/typography.dart';
+
+const _smallTextScaleFactor = 0.80;
+const _largeTextScaleFactor = 1.20;
+
+/// Namespace for the [ThemeData].
+class AppTheme {
+ /// Light `ThemeData` for UI.
+ static ThemeData get light => ThemeData(
+ colorScheme: ColorScheme.fromSwatch(
+ primarySwatch: ColorName.seedColor,
+ accentColor: ColorName.seedColorAccent,
+ cardColor: ColorName.lightBackground,
+ backgroundColor: ColorName.lightBackground,
+ errorColor: ColorName.lightError,
+ ),
+ appBarTheme: _appBarLightTheme,
+ elevatedButtonTheme: _elevatedButtonLightTheme,
+ outlinedButtonTheme: _outlinedButtonLightTheme,
+ textTheme: _textTheme(),
+ dialogTheme: _dialogLightTheme,
+ tooltipTheme: _tooltipLightTheme,
+ bottomSheetTheme: _bottomSheetLightTheme,
+ tabBarTheme: _tabBarLightTheme,
+ dividerTheme: _dividerLightTheme,
+ backgroundColor: ColorName.lightBackground,
+ );
+
+ /// dark `ThemeData` for UI.
+ static ThemeData get dark => ThemeData(
+ colorScheme: ColorScheme.fromSwatch(
+ primarySwatch: ColorName.seedColor,
+ accentColor: ColorName.darkSecondary,
+ cardColor: ColorName.darkBackground,
+ backgroundColor: ColorName.darkBackground,
+ errorColor: ColorName.darkError,
+ brightness: Brightness.dark,
+ ),
+ appBarTheme: _appBarDarkTheme,
+ elevatedButtonTheme: _elevatedButtonDarkTheme,
+ outlinedButtonTheme: _outlinedButtonDarkTheme,
+ textTheme: _textTheme(isDark: true),
+ dialogTheme: _dialogDarkTheme,
+ tooltipTheme: _tooltipDarkTheme,
+ bottomSheetTheme: _bottomSheetDarkTheme,
+ tabBarTheme: _tabBarDarkTheme,
+ dividerTheme: _dividerDarkTheme,
+ backgroundColor: ColorName.darkBackground,
+ canvasColor: ColorName.darkBackground,
+ );
+
+ /// `ThemeData` for UI for small screens.
+ static ThemeData get lightSmall =>
+ light.copyWith(textTheme: _smallTextTheme());
+
+ /// `ThemeData` for UI for medium screens.
+ static ThemeData get lightMedium =>
+ light.copyWith(textTheme: _smallTextTheme());
+
+ /// `ThemeData` for UI for large screens.
+ static ThemeData get lightLarge =>
+ light.copyWith(textTheme: _largeTextTheme());
+
+ /// `ThemeData` for UI for small screens.
+ static ThemeData get darkSmall =>
+ dark.copyWith(textTheme: _smallTextTheme(isDark: true));
+
+ /// `ThemeData` for UI for medium screens.
+ static ThemeData get darkMedium =>
+ dark.copyWith(textTheme: _smallTextTheme(isDark: true));
+
+ /// `ThemeData` for UI for large screens.
+ static ThemeData get darkLarge =>
+ dark.copyWith(textTheme: _largeTextTheme(isDark: true));
+
+ static TextTheme _textTheme({bool isDark = false}) => TextTheme(
+ headline1: AppTypography.headline1,
+ headline2: AppTypography.headline2,
+ headline3: AppTypography.headline3,
+ headline4: AppTypography.headline4,
+ headline5: AppTypography.headline5,
+ headline6: AppTypography.headline6,
+ subtitle1: AppTypography.subtitle1,
+ subtitle2: AppTypography.subtitle2,
+ bodyText1: AppTypography.bodyText1,
+ bodyText2: AppTypography.bodyText2,
+ caption: AppTypography.caption,
+ overline: AppTypography.overline,
+ button: AppTypography.button,
+ ).apply(
+ bodyColor:
+ isDark ? ColorName.darkOnBackground : ColorName.lightOnBackground,
+ displayColor:
+ isDark ? ColorName.darkOnBackground : ColorName.lightOnBackground,
+ );
+
+ static TextTheme _smallTextTheme({bool isDark = false}) =>
+ _textTheme(isDark: isDark).apply(fontSizeFactor: _smallTextScaleFactor);
+
+ static TextTheme _largeTextTheme({bool isDark = false}) =>
+ _textTheme(isDark: isDark).apply(fontSizeFactor: _largeTextScaleFactor);
+
+ static AppBarTheme get _appBarLightTheme =>
+ const AppBarTheme(color: ColorName.lightPrimary);
+
+ static AppBarTheme get _appBarDarkTheme =>
+ const AppBarTheme(color: ColorName.darkSurfaceVariant);
+
+ static ElevatedButtonThemeData get _elevatedButtonLightTheme =>
+ ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ elevation: 0,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30)),
+ ),
+ primary: ColorName.lightPrimary,
+ fixedSize: const Size(208, 54),
+ ),
+ );
+
+ static ElevatedButtonThemeData get _elevatedButtonDarkTheme =>
+ ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ elevation: 0,
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30)),
+ ),
+ primary: ColorName.darkPrimary,
+ fixedSize: const Size(208, 54),
+ ),
+ );
+
+ static OutlinedButtonThemeData get _outlinedButtonLightTheme =>
+ OutlinedButtonThemeData(
+ style: OutlinedButton.styleFrom(
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30)),
+ ),
+ side: const BorderSide(color: ColorName.lightOutline, width: 2),
+ primary: ColorName.lightPrimary,
+ fixedSize: const Size(208, 54),
+ ),
+ );
+
+ static OutlinedButtonThemeData get _outlinedButtonDarkTheme =>
+ OutlinedButtonThemeData(
+ style: OutlinedButton.styleFrom(
+ shape: const RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(Radius.circular(30)),
+ ),
+ side: const BorderSide(color: ColorName.darkOutline, width: 2),
+ primary: ColorName.darkPrimary,
+ fixedSize: const Size(208, 54),
+ ),
+ );
+
+ static TooltipThemeData get _tooltipLightTheme => const TooltipThemeData(
+ decoration: BoxDecoration(
+ color: ColorName.lightInverseSurface,
+ borderRadius: BorderRadius.all(Radius.circular(5)),
+ ),
+ padding: EdgeInsets.all(10),
+ textStyle: TextStyle(color: ColorName.lightOnInverseSurface),
+ );
+
+ static TooltipThemeData get _tooltipDarkTheme => const TooltipThemeData(
+ decoration: BoxDecoration(
+ color: ColorName.darkInverseSurface,
+ borderRadius: BorderRadius.all(Radius.circular(5)),
+ ),
+ padding: EdgeInsets.all(10),
+ textStyle: TextStyle(color: ColorName.darkOnInverseSurface),
+ );
+
+ static DialogTheme get _dialogLightTheme => DialogTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ );
+
+ static DialogTheme get _dialogDarkTheme => DialogTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ );
+
+ static BottomSheetThemeData get _bottomSheetLightTheme =>
+ const BottomSheetThemeData(
+ backgroundColor: ColorName.lightBackground,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
+ ),
+ );
+
+ static BottomSheetThemeData get _bottomSheetDarkTheme =>
+ const BottomSheetThemeData(
+ backgroundColor: ColorName.darkBackground,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.vertical(top: Radius.circular(12)),
+ ),
+ );
+
+ static TabBarTheme get _tabBarLightTheme => const TabBarTheme(
+ indicator: UnderlineTabIndicator(
+ borderSide: BorderSide(
+ width: 2,
+ color: ColorName.lightPrimary,
+ ),
+ ),
+ labelColor: ColorName.lightPrimary,
+ unselectedLabelColor: ColorName.lightOutline,
+ indicatorSize: TabBarIndicatorSize.tab,
+ );
+
+ static TabBarTheme get _tabBarDarkTheme => const TabBarTheme(
+ indicator: UnderlineTabIndicator(
+ borderSide: BorderSide(
+ width: 2,
+ color: ColorName.darkPrimary,
+ ),
+ ),
+ labelColor: ColorName.darkPrimary,
+ unselectedLabelColor: ColorName.darkOutline,
+ indicatorSize: TabBarIndicatorSize.tab,
+ );
+
+ static DividerThemeData get _dividerLightTheme => const DividerThemeData(
+ space: 0,
+ thickness: 1,
+ color: ColorName.lightOutline,
+ );
+
+ static DividerThemeData get _dividerDarkTheme => const DividerThemeData(
+ space: 0,
+ thickness: 1,
+ color: ColorName.darkOutline,
+ );
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/design_system/typography.dart b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/typography.dart
new file mode 100644
index 0000000..ce1b241
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/design_system/typography.dart
@@ -0,0 +1,115 @@
+import 'package:flutter/material.dart';
+
+abstract class AppFontWeight {
+ /// FontWeight value of `w900`
+ static const FontWeight black = FontWeight.w900;
+
+ /// FontWeight value of `w800`
+ static const FontWeight extraBold = FontWeight.w800;
+
+ /// FontWeight value of `w700`
+ static const FontWeight bold = FontWeight.w700;
+
+ /// FontWeight value of `w600`
+ static const FontWeight semiBold = FontWeight.w600;
+
+ /// FontWeight value of `w500`
+ static const FontWeight medium = FontWeight.w500;
+
+ /// FontWeight value of `w400`
+ static const FontWeight regular = FontWeight.w400;
+
+ /// FontWeight value of `w300`
+ static const FontWeight light = FontWeight.w300;
+
+ /// FontWeight value of `w200`
+ static const FontWeight extraLight = FontWeight.w200;
+
+ /// FontWeight value of `w100`
+ static const FontWeight thin = FontWeight.w100;
+}
+
+class AppTypography {
+ static const TextStyle _base = TextStyle(
+ color: Colors.black,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Headline 1 Text Style
+ static TextStyle get headline1 => _base.copyWith(
+ fontSize: 56,
+ fontWeight: AppFontWeight.medium,
+ );
+
+ /// Headline 2 Text Style
+ static TextStyle get headline2 => _base.copyWith(
+ fontSize: 30,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Headline 3 Text Style
+ static TextStyle get headline3 => _base.copyWith(
+ fontSize: 28,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Headline 4 Text Style
+ static TextStyle get headline4 => _base.copyWith(
+ fontSize: 22,
+ fontWeight: AppFontWeight.bold,
+ );
+
+ /// Headline 5 Text Style
+ static TextStyle get headline5 => _base.copyWith(
+ fontSize: 20,
+ fontWeight: AppFontWeight.medium,
+ );
+
+ /// Headline 6 Text Style
+ static TextStyle get headline6 => _base.copyWith(
+ fontSize: 22,
+ fontWeight: AppFontWeight.bold,
+ );
+
+ /// Subtitle 1 Text Style
+ static TextStyle get subtitle1 => _base.copyWith(
+ fontSize: 16,
+ fontWeight: AppFontWeight.bold,
+ );
+
+ /// Subtitle 2 Text Style
+ static TextStyle get subtitle2 => _base.copyWith(
+ fontSize: 14,
+ fontWeight: AppFontWeight.bold,
+ );
+
+ /// Body Text 1 Text Style
+ static TextStyle get bodyText1 => _base.copyWith(
+ fontSize: 18,
+ fontWeight: AppFontWeight.medium,
+ );
+
+ /// Body Text 2 Text Style (the default)
+ static TextStyle get bodyText2 => _base.copyWith(
+ fontSize: 16,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Caption Text Style
+ static TextStyle get caption => _base.copyWith(
+ fontSize: 14,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Overline Text Style
+ static TextStyle get overline => _base.copyWith(
+ fontSize: 16,
+ fontWeight: AppFontWeight.regular,
+ );
+
+ /// Button Text Style
+ static TextStyle get button => _base.copyWith(
+ fontSize: 18,
+ fontWeight: AppFontWeight.medium,
+ );
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/enums/.gitkeep b/bricks/wyatt_clean_code/__brick__/lib/core/enums/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/enums/exception_type.dart b/bricks/wyatt_clean_code/__brick__/lib/core/enums/exception_type.dart
new file mode 100644
index 0000000..decb960
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/enums/exception_type.dart
@@ -0,0 +1,7 @@
+enum AppExceptionType {
+ network,
+ api,
+ database,
+ cache,
+ assertion,
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/enums/flavor.dart b/bricks/wyatt_clean_code/__brick__/lib/core/enums/flavor.dart
new file mode 100644
index 0000000..2cec6bb
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/enums/flavor.dart
@@ -0,0 +1,12 @@
+import 'package:flutter/material.dart';
+
+enum Flavor {
+ development('dev', Colors.red),
+ staging('stg', Colors.blue),
+ production('prod', Colors.green);
+
+ final String short;
+ final Color color;
+
+ const Flavor(this.short, this.color);
+}
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/errors/.gitkeep b/bricks/wyatt_clean_code/__brick__/lib/core/errors/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/bricks/wyatt_clean_code/__brick__/lib/core/errors/exceptions.dart b/bricks/wyatt_clean_code/__brick__/lib/core/errors/exceptions.dart
new file mode 100644
index 0000000..edda147
--- /dev/null
+++ b/bricks/wyatt_clean_code/__brick__/lib/core/errors/exceptions.dart
@@ -0,0 +1,29 @@
+import 'package:equatable/equatable.dart';
+import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/enums/exception_type.dart';
+
+abstract class AppException extends Equatable implements Exception {
+ final String message;
+ final AppExceptionType type;
+
+ AppException(this.type, [String? message]) : message = message ?? type.name;
+
+ @override
+ List