feat(wyatt_app_template): use brickgen

This commit is contained in:
Hugo Pointcheval 2023-01-26 23:51:45 +01:00
parent 9638a23345
commit a2b09f9441
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC
141 changed files with 230 additions and 164 deletions
apps/wyatt_app_template
brick_config.yamlbrickgen.yaml
hooks
lib
starting_template
.env.example.gitignore.metadata
.vscode
README.mdTaskfile.ymlanalysis_options.yaml
android
assets
automation
ios
l10n.yaml
lib

@ -1,42 +0,0 @@
name: wyatt_app
description: New app template for Wyatt Studio projects.
path_to_brickify: .
brick_ignore:
- .env
- brick_config.yaml
- .dart_tool/
- .idea/
- build/
- node_modules/
version: 0.1.0
vars:
display_name:
name: Display Name
type: string
description: The display name
default: Display Name
prompt: "What is the display name?"
project_name:
name: wyatt_app_template
type: string
description: The project name
default: wyatt_app
prompt: "What is the project name?"
bundle_id:
name: io.wyattapp.new
type: string
description: The bundle id used in Android and iOS
default: io.wyattapp.new
prompt: "What is the bundle id?"
description:
name: wyatt_description
type: string
description: A short project description
default: An app by Wyatt Studio.
prompt: "What is the project description?"

@ -0,0 +1,60 @@
# 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 <https://www.gnu.org/licenses/>.
name: wyatt_app_template
description: New app template for Wyatt Studio projects.
version: 0.1.0
vars:
display_name:
compilable: Display Name
type: string
description: The display name
default: Display Name
prompt: "What is the display name?"
project_name:
compilable: starting_template
type: string
description: The project name
default: starting_template
prompt: "What is the project name?"
bundle_id:
compilable: io.wyattapp.start
type: string
description: The bundle id used in Android and iOS
default: io.wyattapp.start
prompt: "What is the bundle id?"
description:
compilable: wyatt_description
type: string
description: A short project description
default: An app by Wyatt Studio.
prompt: "What is the project description?"
brickgen:
path_to_brickify: starting_template
hooks: true
ignore:
- .env
- .dart_tool/
- .idea/
- build/
- node_modules/
- ios/.symlinks/

@ -0,0 +1,39 @@
// Copyright (C) 2022 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 <https://www.gnu.org/licenses/>.
import 'dart:io';
import 'package:mason/mason.dart';
void removeGitKeepFiles(String targetPath) {
if (!FileSystemEntity.isDirectorySync(targetPath)) {
throw ArgumentError('Target must be a directory', 'targetPath');
}
Directory(targetPath)
.listSync(recursive: true)
.whereType<File>()
.forEach((file) {
if (file.path.contains('.gitkeep')) {
file.deleteSync(recursive: true);
}
});
}
Future<void> run(HookContext context) async {
final workingDirectory = Directory.current.path;
removeGitKeepFiles(workingDirectory);
}

@ -0,0 +1,7 @@
name: hooks
environment:
sdk: ">=2.18.0 <3.0.0"
dependencies:
mason: any

@ -1,11 +0,0 @@
import 'package:wyatt_app_template/bootstrap.dart';
import 'package:wyatt_app_template/core/flavors/flavor.dart';
import 'package:wyatt_app_template/presentation/features/app/app.dart';
void main(List<String> args) {
// Define environment
DevelopmentFlavor();
// Initialize environment and variables
bootstrap(App.new);
}

@ -1,11 +0,0 @@
import 'package:wyatt_app_template/bootstrap.dart';
import 'package:wyatt_app_template/core/flavors/flavor.dart';
import 'package:wyatt_app_template/presentation/features/app/app.dart';
void main(List<String> args) {
// Define environment
ProductionFlavor();
// Initialize environment and variables
bootstrap(App.new);
}

@ -1,11 +0,0 @@
import 'package:wyatt_app_template/bootstrap.dart';
import 'package:wyatt_app_template/core/flavors/flavor.dart';
import 'package:wyatt_app_template/presentation/features/app/app.dart';
void main(List<String> args) {
// Define environment
StagingFlavor();
// Initialize environment and variables
bootstrap(App.new);
}

@ -1 +0,0 @@
# just to keep empty folder in brick generation

@ -44,7 +44,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.wyattapp.new"
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

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.wyattapp.new.wyatt_app_template">
package="io.wyattapp.start">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

@ -1,9 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.wyattapp.new.wyatt_app_template">
<application
android:label="Display Name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.wyattapp.start">
<application android:label="Display Name" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
@ -16,19 +12,14 @@
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
</manifest>

@ -1,4 +1,4 @@
package io.wyattapp.new.wyatt_app_template
package io.wyattapp.start
import io.flutter.embedding.android.FlutterActivity

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.wyattapp.new.wyatt_app_template">
package="io.wyattapp.start">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.

@ -21,7 +21,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@ -200,6 +200,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -214,6 +215,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@ -363,8 +365,8 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.new;
PRODUCT_NAME = "$(TARGET_NAME)";
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";
@ -492,12 +494,13 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.new;
PRODUCT_NAME = "$(TARGET_NAME)";
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;
};
@ -515,11 +518,12 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = io.wyattapp.new;
PRODUCT_NAME = "$(TARGET_NAME)";
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;
};

@ -48,4 +48,4 @@
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
</plist>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

@ -2,9 +2,9 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wyatt_app_template/core/dependency_injection/get_it.dart';
import 'package:wyatt_app_template/core/flavors/flavor.dart';
import 'package:wyatt_app_template/core/utils/app_bloc_observer.dart';
import 'package:starting_template/core/dependency_injection/get_it.dart';
import 'package:starting_template/core/flavors/flavor.dart';
import 'package:starting_template/core/utils/app_bloc_observer.dart';
Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();

@ -1,10 +1,10 @@
import 'dart:async';
import 'package:get_it/get_it.dart';
import 'package:wyatt_app_template/core/enums/dev_mode.dart';
import 'package:wyatt_app_template/core/flavors/flavor.dart';
import 'package:wyatt_app_template/data/data_sources/local/counter_data_source_impl.dart';
import 'package:wyatt_app_template/domain/data_sources/local/counter_data_source.dart';
import 'package:starting_template/core/enums/dev_mode.dart';
import 'package:starting_template/core/flavors/flavor.dart';
import 'package:starting_template/data/data_sources/local/counter_data_source_impl.dart';
import 'package:starting_template/domain/data_sources/local/counter_data_source.dart';
final getIt = GetIt.I;

@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:wyatt_app_template/gen/app_localizations.dart';
import 'package:starting_template/gen/app_localizations.dart';
extension BuildContextExtension on BuildContext {
AppLocalizations get l10n => AppLocalizations.of(this);

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:wyatt_app_template/core/enums/dev_mode.dart';
import 'package:starting_template/core/enums/dev_mode.dart';
abstract class Flavor {
Flavor._({

@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:go_router/go_router.dart';
import 'package:wyatt_app_template/presentation/features/counter/counter.dart';
import 'package:wyatt_app_template/presentation/features/home/home.dart';
import 'package:starting_template/presentation/features/counter/counter.dart';
import 'package:starting_template/presentation/features/home/home.dart';
abstract class AppRouter {
/// Default transition for all pages

@ -1,8 +1,8 @@
import 'dart:convert';
import 'package:wyatt_app_template/data/models/integer_model.dart';
import 'package:wyatt_app_template/domain/data_sources/local/counter_data_source.dart';
import 'package:wyatt_app_template/domain/entities/integer.dart';
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 {

@ -1,5 +1,5 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:wyatt_app_template/domain/entities/integer.dart';
import 'package:starting_template/domain/entities/integer.dart';
part 'integer_model.freezed.dart';
part 'integer_model.g.dart';

@ -1,6 +1,6 @@
import 'package:wyatt_app_template/domain/data_sources/local/counter_data_source.dart';
import 'package:wyatt_app_template/domain/entities/integer.dart';
import 'package:wyatt_app_template/domain/repositories/counter_repository.dart';
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';

@ -1,4 +1,4 @@
import 'package:wyatt_app_template/domain/entities/integer.dart';
import 'package:starting_template/domain/entities/integer.dart';
import 'package:wyatt_architecture/wyatt_architecture.dart';
abstract class CounterDataSource extends BaseDataSource {

Some files were not shown because too many files have changed in this diff Show More