diff --git a/README.md b/README.md
index ccb1219..862c8e2 100644
--- a/README.md
+++ b/README.md
@@ -7,45 +7,54 @@ some mason bricks that we use for our internal workflow
> Note that we use `bdaya_flutter_common` as a base library for the generated code
> We also need `build_runner` as a dev dependency.
-* [bdaya_form](https://brickhub.dev/bricks/bdaya_form)
- - generate a form using `reactive_forms_annotations` + `reactive_forms_generator`
-* [bdaya_page](https://brickhub.dev/bricks/bdaya_page)
- - generate a simple page (view + controller)
-* [bdaya_route](https://brickhub.dev/bricks/bdaya_route)
- - generate a page that reacts to route changes from `go_router`
-
+- [bdaya_form](https://brickhub.dev/bricks/bdaya_form)
+ - generate a form using `reactive_forms_annotations` + `reactive_forms_generator`
+- [bdaya_page](https://brickhub.dev/bricks/bdaya_page)
+ - generate a simple page (view + controller)
+- [bdaya_route](https://brickhub.dev/bricks/bdaya_route)
+ - generate a page that reacts to route changes from `go_router`
+- [bdaya_new_flutter_app](https://brickhub.dev/bricks/bdaya_new_flutter_app)
+ - generate a new bdaya flutter app.
## Usage on git
+
1. Activate [mason_cli](https://pub.dev/packages/mason_cli)
- - `dart pub global activate mason_cli`
+ - `dart pub global activate mason_cli`
2. Add Bricks
- - bdaya_form
- ```
- mason add bdaya_form --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_form
- ```
- - bdaya_route
- ```
- mason add bdaya_route --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_route
- ```
- - bdaya_page
- ```
- mason add bdaya_page --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_page
- ```
+ - bdaya_form
+ ```
+ mason add bdaya_form --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_form
+ ```
+ - bdaya_route
+ ```
+ mason add bdaya_route --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_route
+ ```
+ - bdaya_page
+ ```
+ mason add bdaya_page --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_page
+ ```
+ - bdaya_new_flutter_app
+ ```
+ mason add bdaya_new_flutter_app --git-url https://github.com/Bdaya-Dev/bricks --git-path bdaya_new_flutter_app
+ ```
3. `mason get`
4. Make
- - bdaya_form:
- ```
- mason make bdaya_form -o lib/src/dialogs --name EditUser
- ```
- > Note that `bdaya_form` requires some dependencies, which you can add using this command:
- >
- > `dart pub add reactive_forms_annotations --dev reactive_forms_generator`
- - bdaya_route:
- ```
- mason make bdaya_route -o lib/src/pages --name UserDetails
- ```
- - bdaya_page:
- ```
- mason make bdaya_page -o lib/src/pages --name Users
- ```
-
+ - bdaya_form:
+ ```
+ mason make bdaya_form -o lib/src/dialogs --name EditUser
+ ```
+ > Note that `bdaya_form` requires some dependencies, which you can add using this command:
+ >
+ > `dart pub add reactive_forms_annotations --dev reactive_forms_generator`
+ - bdaya_route:
+ ```
+ mason make bdaya_route -o lib/src/pages --name UserDetails
+ ```
+ - bdaya_page:
+ ```
+ mason make bdaya_page -o lib/src/pages --name Users
+ ```
+ - bdaya_new_flutter_app:
+ ```
+ mason make bdaya_new_flutter_app -o "your/projects/path"
+ ```
diff --git a/bdaya_new_flutter_app/.gitignore b/bdaya_new_flutter_app/.gitignore
new file mode 100644
index 0000000..b93e117
--- /dev/null
+++ b/bdaya_new_flutter_app/.gitignore
@@ -0,0 +1,12 @@
+.DS_Store
+.atom/
+.idea/*
+.vscode/*
+
+# Files and directories created by pub
+.dart_tool/
+.packages
+pubspec.lock
+
+# Conventional directory for build outputs
+build/
diff --git a/bdaya_new_flutter_app/CHANGELOG.md b/bdaya_new_flutter_app/CHANGELOG.md
new file mode 100644
index 0000000..23f4b41
--- /dev/null
+++ b/bdaya_new_flutter_app/CHANGELOG.md
@@ -0,0 +1,3 @@
+# 0.0.1
+
+- feat: initial release 🎉
diff --git a/bdaya_new_flutter_app/LICENSE b/bdaya_new_flutter_app/LICENSE
new file mode 100644
index 0000000..6b6926d
--- /dev/null
+++ b/bdaya_new_flutter_app/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2025 Bdaya Development
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/bdaya_new_flutter_app/README.md b/bdaya_new_flutter_app/README.md
new file mode 100644
index 0000000..cfbd6b2
--- /dev/null
+++ b/bdaya_new_flutter_app/README.md
@@ -0,0 +1,89 @@
+# Bdaya New Flutter App
+
+Inspired from [very_good_core][very_good_core_link] 🦄.
+
+Developed with 💙 by [Bdaya Development][bdaya_development_link].
+
+[![License: MIT][license_badge]][license_link]
+[](https://github.com/felangel/mason)
+
+A Bdaya New Flutter App created by [Bdaya Development][bdaya_development_link].
+
+## What's Included ✨
+
+Out of the box, Bdaya New Flutter App includes:
+
+- ✅ [Cross Platform Support][flutter_cross_platform_link] - Built-in support for iOS, Android, Web, and Windows (MacOS/Linux coming soon!)
+- ✅ [Build Flavors][flutter_flavors_link] - Multiple flavor support for development, staging, and production
+- ✅ [Internationalization Support][internationalization_link] - Internationalization support using synthetic code generation to streamline the development process
+- ✅ [Sound Null-Safety][null_safety_link] - No more null-dereference exceptions at runtime. Develop with a sound, static type system.
+- ✅ [bdaya_flutter_common][bdaya_flutter_common] - A library to combine and standarize the common code we use in our projects into a single package.
+- ✅ [get_it][get_it_link] - Integrated get_it architecture for scalable, testable code which offers a simple Service Locator for bdaya app services,and controllers.
+- ✅ [bdaya_shared_value][bdaya_shared_value_link] - An opinionated fork of the original package [shared_value][shared_value_link] that is a wrapper over [InheritedModel][InheritedModel_link] , this module allows you to easily manage global state in flutter apps. At a high level, SharedValue puts your variables in an intelligent "container" that is flutter-aware. It can be viewed as a low-boilerplate generalization of the Provider state management solution.
+- ✅ [Testing][testing_link] - Unit and Widget Tests with 100% line coverage (Integration Tests coming soon!)
+- ✅ [Logging][logging_link] - Built-in, extensible logging to capture uncaught Flutter and Dart Exceptions
+
+## Output 📦
+
+```sh
+├── .gitignore
+├── .idea
+│ └── runConfigurations
+│ ├── development.xml
+│ ├── production.xml
+│ └── staging.xml
+├── .vscode
+│ ├── extensions.json
+│ └── launch.json
+├── LICENSE
+├── README.md
+├── analysis_options.yaml
+├── android
+├── coverage_badge.svg
+├── ios
+├── l10n.yaml
+├── lib
+│ ├── app
+│ │ ├── app.dart
+│ │ └── view
+│ ├── bootstrap.dart
+│ ├── counter
+│ │ ├── counter.dart
+│ │ ├── cubit
+│ │ └── view
+│ ├── l10n
+│ │ ├── arb
+│ │ └── l10n.dart
+│ ├── main_development.dart
+│ ├── main_production.dart
+│ └── main_staging.dart
+├── pubspec.lock
+├── pubspec.yaml
+├── test
+│ ├── app
+│ │ └── view
+│ ├── counter
+│ │ ├── cubit
+│ │ └── view
+│ └── helpers
+│ ├── helpers.dart
+│ └── pump_app.dart
+├── web
+└── windows
+```
+
+[bdaya_flutter_common]: https://pub.dev/packages/bdaya_flutter_common
+[get_it_link]: https://pub.dev/packages/get_it
+[bdaya_shared_value_link]: https://pub.dev/packages/bdaya_shared_value
+[shared_value_link]: https://pub.dev/packages/shared_value
+[InheritedModel_link]: https://api.flutter.dev/flutter/widgets/InheritedModel-class.html
+[flutter_cross_platform_link]: https://flutter.dev/docs/development/tools/sdk/release-notes/supported-platforms
+[flutter_flavors_link]: https://flutter.dev/docs/deployment/flavors
+[internationalization_link]: https://flutter.dev/docs/development/accessibility-and-localization/internationalization
+[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
+[license_link]: https://opensource.org/licenses/MIT
+[logging_link]: https://api.flutter.dev/flutter/dart-developer/log.html
+[null_safety_link]: https://flutter.dev/docs/null-safety
+[testing_link]: https://flutter.dev/docs/testing
+[bdaya_development_link]: https://bdaya-dev.com/
+[very_good_core_link]: https://github.com/VeryGoodOpenSource/very_good_templates/tree/main/very_good_core
diff --git a/bdaya_new_flutter_app/__brick__/{{project_name.snakeCase()}}/blank.md b/bdaya_new_flutter_app/__brick__/{{project_name.snakeCase()}}/blank.md
new file mode 100644
index 0000000..5ecb694
--- /dev/null
+++ b/bdaya_new_flutter_app/__brick__/{{project_name.snakeCase()}}/blank.md
@@ -0,0 +1,3 @@
+# Blank file
+
+This File should be removed, If you are reading this, please remove it.
diff --git a/bdaya_new_flutter_app/analysis_options.yaml b/bdaya_new_flutter_app/analysis_options.yaml
new file mode 100644
index 0000000..162dea2
--- /dev/null
+++ b/bdaya_new_flutter_app/analysis_options.yaml
@@ -0,0 +1,4 @@
+analyzer:
+ exclude:
+ - __brick__/**
+ - lib/template/**
diff --git a/bdaya_new_flutter_app/brick.yaml b/bdaya_new_flutter_app/brick.yaml
new file mode 100644
index 0000000..4b51e93
--- /dev/null
+++ b/bdaya_new_flutter_app/brick.yaml
@@ -0,0 +1,29 @@
+name: bdaya_new_flutter_app
+description: A Bdaya New Flutter app created by Bdaya Development.
+repository: https://github.com/Bdaya-Dev/bricks/tree/main/bdaya_new_flutter_app
+version: 0.0.1
+
+environment:
+ mason: ^0.1.0
+
+vars:
+ project_name:
+ type: string
+ description: The project name
+ default: my_app
+ prompt: What is the project name?
+ org_name:
+ type: string
+ description: The organization name
+ default: com.example
+ prompt: What is the organization name?
+ application_id:
+ type: string
+ description: The application id on Android, Bundle ID on iOS and company name on Windows. If omitted value will be formed by org_name + . + project_name.
+ default: example.com
+ prompt: What is the application id?
+ description:
+ type: string
+ description: A short project description
+ default: A Bdaya Development App
+ prompt: What is the project description?
diff --git a/bdaya_new_flutter_app/config.json b/bdaya_new_flutter_app/config.json
new file mode 100644
index 0000000..419d1e6
--- /dev/null
+++ b/bdaya_new_flutter_app/config.json
@@ -0,0 +1,6 @@
+{
+ "project_name": "test_app",
+ "org_name": "bdaya_development",
+ "application_id": "bdaya.dev.test",
+ "description": "bdaya_new_flutter_app test configuration"
+}
diff --git a/bdaya_new_flutter_app/coverage_badge.svg b/bdaya_new_flutter_app/coverage_badge.svg
new file mode 100644
index 0000000..88bfadf
--- /dev/null
+++ b/bdaya_new_flutter_app/coverage_badge.svg
@@ -0,0 +1,20 @@
+
\ No newline at end of file
diff --git a/bdaya_new_flutter_app/hooks/analysis_options.yaml b/bdaya_new_flutter_app/hooks/analysis_options.yaml
new file mode 100644
index 0000000..77a5e52
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/analysis_options.yaml
@@ -0,0 +1,4 @@
+include: package:flutter_lints/flutter.yaml
+analyzer:
+ exclude:
+ - template/**
diff --git a/bdaya_new_flutter_app/hooks/lib/bdaya_new_flutter_app_hooks.dart b/bdaya_new_flutter_app/hooks/lib/bdaya_new_flutter_app_hooks.dart
new file mode 100644
index 0000000..ab95c8d
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/bdaya_new_flutter_app_hooks.dart
@@ -0,0 +1 @@
+export 'src/_exports.dart';
diff --git a/bdaya_new_flutter_app/hooks/lib/src/_exports.dart b/bdaya_new_flutter_app/hooks/lib/src/_exports.dart
new file mode 100644
index 0000000..767f7ab
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/_exports.dart
@@ -0,0 +1 @@
+export 'models/_exports.dart';
diff --git a/bdaya_new_flutter_app/hooks/lib/src/consts.dart b/bdaya_new_flutter_app/hooks/lib/src/consts.dart
new file mode 100644
index 0000000..d76695c
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/consts.dart
@@ -0,0 +1,38 @@
+const kSdk = '>=3.4.0 <4.0.0';
+const kFlutter = '>=3.0.0';
+
+const kDep = [
+ 'async',
+ 'bdaya_flutter_common',
+ 'collection',
+ 'go_router',
+ 'grpc',
+ 'logging',
+];
+
+const kDevDep = [
+ 'build_runner',
+ 'flutter_lints',
+ 'injectable_generator',
+ 'mocktail',
+];
+
+final kDirs = [
+ 'extensions',
+ 'gen',
+ 'l10n',
+ 'mixins',
+ 'models',
+ 'pages',
+ 'services',
+ 'utils',
+ 'widgets',
+];
+
+final kFiles = [
+ 'bootstrap.dart',
+ 'common.dart',
+ 'get_it_config.dart',
+ 'injectable_module.dart',
+ 'routes.dart',
+];
diff --git a/bdaya_new_flutter_app/hooks/lib/src/models/_exports.dart b/bdaya_new_flutter_app/hooks/lib/src/models/_exports.dart
new file mode 100644
index 0000000..2b93c52
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/models/_exports.dart
@@ -0,0 +1,7 @@
+export 'android_application_id.dart';
+export 'android_namespace.dart';
+export 'apple_application_id.dart';
+export 'exceptions.dart';
+export 'bdaya_new_flutter_app_configuration.dart';
+export 'windows_application_id.dart';
+export 'progress_args.dart';
diff --git a/bdaya_new_flutter_app/hooks/lib/src/models/android_application_id.dart b/bdaya_new_flutter_app/hooks/lib/src/models/android_application_id.dart
new file mode 100644
index 0000000..3c03741
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/models/android_application_id.dart
@@ -0,0 +1,71 @@
+import 'package:mason/mason.dart';
+
+/// {@template android_application_id}
+/// Every Android app has a unique application ID that looks like a Java or
+/// Kotlin package name, such as `com.example.app`.
+///
+/// This ID uniquely identifies your app on the device and in the Google Play
+/// Store.
+///
+/// See also:
+///
+/// * [Set the application ID Android documentation](https://developer.android.com/build/configure-app-module#set-application-id)
+/// {@endtemplate}
+extension type AndroidApplicationId(String value) {
+ /// Creates a new [AndroidApplicationId] from the provided [organizationName]
+ /// and [projectName].
+ ///
+ /// This is the default fallback value for the application ID.
+ factory AndroidApplicationId.fallback({
+ required String organizationName,
+ required String projectName,
+ }) {
+ final segments = [];
+ for (final segment in organizationName.split('.')) {
+ if (segment.isEmpty) continue;
+ segments.add(segment.snakeCase);
+ }
+ segments.add(projectName.snakeCase);
+
+ return AndroidApplicationId(segments.join('.'));
+ }
+
+ /// Checks if the [AndroidApplicationId] is valid, returning `true` if it is
+ /// and `false` otherwise.
+ ///
+ /// Although the application ID looks like a traditional Kotlin or Java
+ /// package name, the naming rules for the application ID are a bit more
+ /// restrictive:
+ ///
+ /// * It must have at least two segments (one or more dots).
+ /// * Each segment must start with a letter.
+ /// * All characters must be alphanumeric or an underscore [a-zA-Z0-9_].
+ ///
+ /// See also:
+ ///
+ /// * [Set the application ID Android documentation](https://developer.android.com/build/configure-app-module#set-application-id)
+ bool get isValid {
+ final segments = value.split('.');
+ if (segments.length < 2) {
+ // It must have at least two segments (one or more dots).
+ return false;
+ }
+
+ final isLetter = RegExp('^[a-zA-Z]');
+ final isAlphanumeric = RegExp(r'^[a-zA-Z0-9_]+$');
+
+ for (final segment in segments) {
+ if (segment.isEmpty || !isLetter.hasMatch(segment[0])) {
+ // Each segment must start with a letter.
+ return false;
+ }
+
+ if (!isAlphanumeric.hasMatch(segment)) {
+ // All characters must be alphanumeric or an underscore [a-zA-Z0-9_].
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/bdaya_new_flutter_app/hooks/lib/src/models/android_namespace.dart b/bdaya_new_flutter_app/hooks/lib/src/models/android_namespace.dart
new file mode 100644
index 0000000..0e34d9b
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/models/android_namespace.dart
@@ -0,0 +1,40 @@
+import 'package:bdaya_new_flutter_app/bdaya_new_flutter_app_hooks.dart';
+
+/// {@template android_namespace}
+/// Every Android module has a namespace, which is used as the Kotlin or Java
+/// package name for its generated R and BuildConfig classes.
+///
+/// The namespace can be different than the application ID, but it is usually
+/// kept the same for a simpler workflow.
+///
+/// The name you set for the build.gradle file's namespace property should
+/// always match your project's base package name, where you keep your
+/// activities and other app code. You can have other sub-packages in your
+/// project, but those files must import the R class using the namespace from
+/// the namespace property.
+///
+/// See also:
+///
+/// * [Set the namespace Android documentation](https://developer.android.com/studio/build/application-id)
+/// {@endtemplate}
+extension type AndroidNamespace(String value) {
+ /// Creates a new [AndroidNamespace] from the provided [applicationId].
+ ///
+ /// If a specific namespace is not provided, the namespace will default to the
+ /// application ID.
+ ///
+ /// It is recommended to keep the namespace the same as the application ID for
+ /// a simpler workflow:
+ ///
+ /// From: [Set the namespace Android documentation](https://developer.android.com/build/configure-app-module#set-namespace)
+ /// > For a simpler workflow, keep your namespace the same as your application
+ /// > ID, as they are by default.
+ ///
+ /// From: [Set the application ID Android documentation](https://developer.android.com/build/configure-app-module#set-application-id):
+ /// > Keep the application ID the same as the namespace. The distinction
+ /// > between the two properties can be a bit confusing, but if you keep them
+ /// > the same, you have nothing to worry about.
+ AndroidNamespace.fromApplicationId(
+ AndroidApplicationId applicationId,
+ ) : this(applicationId.value);
+}
diff --git a/bdaya_new_flutter_app/hooks/lib/src/models/apple_application_id.dart b/bdaya_new_flutter_app/hooks/lib/src/models/apple_application_id.dart
new file mode 100644
index 0000000..87a2b50
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/models/apple_application_id.dart
@@ -0,0 +1,32 @@
+import 'package:mason/mason.dart';
+
+/// {@template apple_application_id}
+/// An App ID identifies your iOS/macOS app in a provisioning profile.
+///
+/// An App ID is a two-part string used to identify one or more apps from a
+/// single development team. A period (.) separates its parts.
+///
+/// See also:
+///
+/// * [Register an App ID](https://developer.apple.com/help/account/manage-identifiers/register-an-app-id/)
+/// * [Apple Documentation Archive](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/AppID.html)
+/// {@endtemplate}
+extension type AppleApplicationId(String value) {
+ /// Creates a new [AppleApplicationId] from the provided [organizationName]
+ /// and [projectName].
+ ///
+ /// This is the default fallback value for the application ID.
+ factory AppleApplicationId.fallback({
+ required String organizationName,
+ required String projectName,
+ }) {
+ final parts = [];
+ for (final part in organizationName.split('.')) {
+ if (part.isEmpty) continue;
+ parts.add(part.paramCase);
+ }
+ parts.add(projectName.paramCase);
+
+ return AppleApplicationId(parts.join('.'));
+ }
+}
diff --git a/bdaya_new_flutter_app/hooks/lib/src/models/bdaya_new_flutter_app_configuration.dart b/bdaya_new_flutter_app/hooks/lib/src/models/bdaya_new_flutter_app_configuration.dart
new file mode 100644
index 0000000..2fcb739
--- /dev/null
+++ b/bdaya_new_flutter_app/hooks/lib/src/models/bdaya_new_flutter_app_configuration.dart
@@ -0,0 +1,193 @@
+import 'package:equatable/equatable.dart';
+import 'package:bdaya_new_flutter_app/bdaya_new_flutter_app_hooks.dart';
+
+/// The variables specified by this hook.
+///
+/// The variables can be found in the Brick's `brick.yaml` file. They are
+/// initially included in the `HookContext.vars` map.
+///
+/// See also:
+///
+/// * [brick.yaml documentation](https://docs.brickhub.dev/brick-structure#brickyaml)
+enum _BdayaNewFlutterAppConfigurationVariables {
+ /// {@template bdaya_new_flutter_app_configuration_variables.project_name}
+ /// The project name.
+ ///
+ /// Defaults to `my_app`.
+ /// {@endtemplate}
+ projectName._('project_name'),
+
+ /// {@template bdaya_new_flutter_app_configuration_variables.organization_name}
+ /// The organization name.
+ ///
+ /// Defaults to `com.example`.
+ /// {@endtemplate}
+ organizationName._('org_name'),
+
+ /// {@template bdaya_new_flutter_app_configuration_variables.application_id}
+ /// The application id on Android, Bundle ID on iOS and company name on
+ /// Windows. If omitted value will be formed by org_name + . + project_name.
+ ///
+ /// Has no default specified within the `brick.yaml`.
+ /// {@endtemplate}
+ applicationId._('application_id'),
+
+ /// {@template bdaya_new_flutter_app_configuration_variables.description}
+ /// A short project description.
+ ///
+ /// Defaults to `A Bdaya App`.
+ /// {@endtemplate}
+ description._('description');
+
+ const _BdayaNewFlutterAppConfigurationVariables._(this.key);
+
+ /// The key used in the `HookContext.vars` [Map].
+ ///
+ /// This should match the variable key in the `brick.yaml`.
+ final String key;
+}
+
+/// {@template bdaya_new_flutter_app_configuration}
+/// Configuration for the `bdaya_new_flutter_app` brick.
+/// {@endtemplate}
+class BdayaNewFlutterAppConfiguration extends Equatable {
+ /// {@macro bdaya_new_flutter_app_configuration}
+ BdayaNewFlutterAppConfiguration({
+ String? projectName,
+ String? organizationName,
+ String? description,
+ WindowsApplicationId? windowsApplicationId,
+ AppleApplicationId? iOsApplicationId,
+ AppleApplicationId? macOsApplicationId,
+ AndroidApplicationId? androidApplicationId,
+ AndroidNamespace? androidNamespace,
+ }) : projectName = projectName ?? 'my_app',
+ organizationName = organizationName ?? 'com.example',
+ description = description ?? 'A Bdaya App' {
+ this.windowsApplicationId = windowsApplicationId ??
+ WindowsApplicationId.fallback(
+ organizationName: this.organizationName,
+ projectName: this.projectName,
+ );
+ this.iOsApplicationId = iOsApplicationId ??
+ AppleApplicationId.fallback(
+ organizationName: this.organizationName,
+ projectName: this.projectName,
+ );
+ this.macOsApplicationId = macOsApplicationId ??
+ AppleApplicationId.fallback(
+ organizationName: this.organizationName,
+ projectName: this.projectName,
+ );
+ this.androidApplicationId = androidApplicationId ??
+ AndroidApplicationId.fallback(
+ organizationName: this.organizationName,
+ projectName: this.projectName,
+ );
+ if (!this.androidApplicationId.isValid) {
+ throw InvalidAndroidApplicationIdFormat(this.androidApplicationId);
+ }
+
+ this.androidNamespace = androidNamespace ??
+ AndroidNamespace.fromApplicationId(this.androidApplicationId);
+ }
+
+ /// Deserializes a [BdayaNewFlutterAppConfiguration] from a `Map`
+ /// used to represent the configuration in the `HookContext.vars` map.
+ factory BdayaNewFlutterAppConfiguration.fromHookVars(
+ Map vars) {
+ final projectName =
+ vars[_BdayaNewFlutterAppConfigurationVariables.projectName.key];
+ if (projectName is! String?) {
+ throw ArgumentError.value(
+ vars,
+ 'vars',
+ '''Expected a value for key "${_BdayaNewFlutterAppConfigurationVariables.projectName.key}" to be of type String?, got $projectName.''',
+ );
+ }
+
+ final organizationName =
+ vars[_BdayaNewFlutterAppConfigurationVariables.organizationName.key];
+ if (organizationName is! String?) {
+ throw ArgumentError.value(
+ vars,
+ 'vars',
+ '''Expected a value for key "${_BdayaNewFlutterAppConfigurationVariables.organizationName.key}" to be of type String?, got $organizationName.''',
+ );
+ }
+
+ final applicationId =
+ vars[_BdayaNewFlutterAppConfigurationVariables.applicationId.key];
+ if (applicationId is! String?) {
+ throw ArgumentError.value(
+ vars,
+ 'vars',
+ '''Expected a value for key "${_BdayaNewFlutterAppConfigurationVariables.applicationId.key}" to be of type String?, got $applicationId.''',
+ );
+ }
+
+ final description =
+ vars[_BdayaNewFlutterAppConfigurationVariables.description.key];
+ if (description is! String?) {
+ throw ArgumentError.value(
+ vars,
+ 'vars',
+ '''Expected a value for key "${_BdayaNewFlutterAppConfigurationVariables.description.key}" to be of type String?, got $description.''',
+ );
+ }
+
+ return BdayaNewFlutterAppConfiguration(
+ projectName: projectName,
+ organizationName: organizationName,
+ iOsApplicationId: applicationId == null || applicationId.isEmpty
+ ? null
+ : AppleApplicationId(applicationId),
+ macOsApplicationId: applicationId == null || applicationId.isEmpty
+ ? null
+ : AppleApplicationId(applicationId),
+ windowsApplicationId: applicationId == null || applicationId.isEmpty
+ ? null
+ : WindowsApplicationId(applicationId),
+ androidApplicationId: applicationId == null || applicationId.isEmpty
+ ? null
+ : AndroidApplicationId(applicationId),
+ description: description,
+ );
+ }
+
+ /// {@macro bdaya_new_flutter_app_configuration_variables.project_name}
+ final String projectName;
+
+ /// {@macro bdaya_new_flutter_app_configuration_variables.organization_name}
+ final String organizationName;
+
+ /// {@macro bdaya_new_flutter_app_configuration_variables.description}
+ final String description;
+
+ /// {@macro windows_application_id}
+ late final WindowsApplicationId windowsApplicationId;
+
+ /// {@macro apple_application_id}
+ late final AppleApplicationId iOsApplicationId;
+
+ /// {@macro apple_application_id}
+ late final AppleApplicationId macOsApplicationId;
+
+ /// {@macro android_namespace}
+ late final AndroidNamespace androidNamespace;
+
+ /// {@macro android_application_id}
+ late final AndroidApplicationId androidApplicationId;
+
+ @override
+ List