From 5e3f507e89571486927d6fa2969e85c40bf08a5e Mon Sep 17 00:00:00 2001 From: Fernando Ferrara Date: Wed, 5 Apr 2023 17:02:18 -0300 Subject: [PATCH 1/4] Add UI constants --- .../app/web/lib/ui/common/app_colors.dart.stk | 2 ++ .../app/web/lib/ui/common/app_styles.dart.stk | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 lib/src/templates/app/web/lib/ui/common/app_styles.dart.stk diff --git a/lib/src/templates/app/web/lib/ui/common/app_colors.dart.stk b/lib/src/templates/app/web/lib/ui/common/app_colors.dart.stk index e660186..481b342 100644 --- a/lib/src/templates/app/web/lib/ui/common/app_colors.dart.stk +++ b/lib/src/templates/app/web/lib/ui/common/app_colors.dart.stk @@ -2,8 +2,10 @@ import 'package:flutter/material.dart'; const Color kcPrimaryColor = Color(0xFF9600FF); const Color kcPrimaryColorDark = Color(0xFF300151); +const Color kcBlack = Color(0xFF000000); const Color kcDarkGreyColor = Color(0xFF1A1B1E); const Color kcMediumGrey = Color(0xFF474A54); const Color kcLightGrey = Color.fromARGB(255, 187, 187, 187); const Color kcVeryLightGrey = Color(0xFFE3E3E3); +const Color kcWhite = Color(0xFFFFFFFF); const Color kcBackgroundColor = kcDarkGreyColor; diff --git a/lib/src/templates/app/web/lib/ui/common/app_styles.dart.stk b/lib/src/templates/app/web/lib/ui/common/app_styles.dart.stk new file mode 100644 index 0000000..0fe4e3b --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/common/app_styles.dart.stk @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +TextStyle get ktsHeading1 => const TextStyle( + fontSize: 80, + height: 0.95, + fontWeight: FontWeight.w800, + ); + +TextStyle get ktsHeading2 => const TextStyle( + fontSize: 40, + height: 0.95, + fontWeight: FontWeight.w800, + ); + +TextStyle get ktsBodyRegular => const TextStyle( + fontSize: 15, + ); + +TextStyle get ktsBodyLarge => const TextStyle( + fontSize: 20, + ); From 33cfad52cbcf7780d730f670b738f39b1463c33c Mon Sep 17 00:00:00 2001 From: Fernando Ferrara Date: Wed, 5 Apr 2023 17:05:45 -0300 Subject: [PATCH 2/4] Add UnknownView --- .../templates/app/web/lib/app/app.dart.stk | 4 ++ .../ui/views/unknown/unknown_view.dart.stk | 31 +++++++++++++++ .../unknown/unknown_view.desktop.dart.stk | 38 +++++++++++++++++++ .../unknown/unknown_view.mobile.dart.stk | 38 +++++++++++++++++++ .../unknown/unknown_view.tablet.dart.stk | 38 +++++++++++++++++++ .../views/unknown/unknown_viewmodel.dart.stk | 3 ++ .../unknown_viewmodel_test.dart.stk | 11 ++++++ 7 files changed, 163 insertions(+) create mode 100644 lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.dart.stk create mode 100644 lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.desktop.dart.stk create mode 100644 lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.mobile.dart.stk create mode 100644 lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.tablet.dart.stk create mode 100644 lib/src/templates/app/web/lib/ui/views/unknown/unknown_viewmodel.dart.stk create mode 100644 lib/src/templates/app/web/test/viewmodels/unknown_viewmodel_test.dart.stk diff --git a/lib/src/templates/app/web/lib/app/app.dart.stk b/lib/src/templates/app/web/lib/app/app.dart.stk index 4b6191c..964a1e2 100644 --- a/lib/src/templates/app/web/lib/app/app.dart.stk +++ b/lib/src/templates/app/web/lib/app/app.dart.stk @@ -2,6 +2,7 @@ import 'package:{{packageName}}/{{{bottomSheetsPath}}}/notice/notice_sheet.dart' import 'package:{{packageName}}/{{{dialogsPath}}}/info_alert/info_alert_dialog.dart'; import 'package:{{packageName}}/{{{viewImportPath}}}/home/home_view.dart'; import 'package:{{packageName}}/{{{viewImportPath}}}/startup/startup_view.dart'; +import 'package:{{packageName}}/{{{viewImportPath}}}/unknown/unknown_view.dart'; import 'package:stacked/stacked_annotations.dart'; import 'package:stacked_services/stacked_services.dart'; // @stacked-import @@ -11,6 +12,9 @@ import 'package:stacked_services/stacked_services.dart'; CustomRoute(page: StartupView, initial: true), CustomRoute(page: HomeView), // @stacked-route + + CustomRoute(page: UnknownView, path: '/404'), + ], dependencies: [ LazySingleton(classType: BottomSheetService), diff --git a/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.dart.stk b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.dart.stk new file mode 100644 index 0000000..cec9bbe --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.dart.stk @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; +import 'package:responsive_builder/responsive_builder.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_view.desktop.dart'; +import 'unknown_view.tablet.dart'; +import 'unknown_view.mobile.dart'; +import 'unknown_viewmodel.dart'; + +class UnknownView extends StackedView { + const UnknownView({super.key}); + + @override + Widget builder( + BuildContext context, + UnknownViewModel viewModel, + Widget? child, + ) { + return ScreenTypeLayout.builder( + mobile: (_) => const UnknownViewMobile(), + tablet: (_) => const UnknownViewTablet(), + desktop: (_) => const UnknownViewDesktop(), + ); + } + + @override + UnknownViewModel viewModelBuilder( + BuildContext context, + ) => + UnknownViewModel(); +} diff --git a/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.desktop.dart.stk b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.desktop.dart.stk new file mode 100644 index 0000000..e603db8 --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.desktop.dart.stk @@ -0,0 +1,38 @@ +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewDesktop extends ViewModelWidget { + const UnknownViewDesktop({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.mobile.dart.stk b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.mobile.dart.stk new file mode 100644 index 0000000..68a83e7 --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.mobile.dart.stk @@ -0,0 +1,38 @@ +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewMobile extends ViewModelWidget { + const UnknownViewMobile({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.tablet.dart.stk b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.tablet.dart.stk new file mode 100644 index 0000000..fc81672 --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_view.tablet.dart.stk @@ -0,0 +1,38 @@ +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewTablet extends ViewModelWidget { + const UnknownViewTablet({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/src/templates/app/web/lib/ui/views/unknown/unknown_viewmodel.dart.stk b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_viewmodel.dart.stk new file mode 100644 index 0000000..bed5a64 --- /dev/null +++ b/lib/src/templates/app/web/lib/ui/views/unknown/unknown_viewmodel.dart.stk @@ -0,0 +1,3 @@ +import 'package:stacked/stacked.dart'; + +class UnknownViewModel extends BaseViewModel {} diff --git a/lib/src/templates/app/web/test/viewmodels/unknown_viewmodel_test.dart.stk b/lib/src/templates/app/web/test/viewmodels/unknown_viewmodel_test.dart.stk new file mode 100644 index 0000000..e6e5d44 --- /dev/null +++ b/lib/src/templates/app/web/test/viewmodels/unknown_viewmodel_test.dart.stk @@ -0,0 +1,11 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:{{packageName}}/{{{relativeLocatorFilePath}}}'; + +import '../helpers/test_helpers.dart'; + +void main() { + group('UnknownViewModel Tests -', () { + setUp(() => registerServices()); + tearDown(() => locator.reset()); + }); +} \ No newline at end of file From a26281484f96cf8a75573c08b08f7d2ccc78fa70 Mon Sep 17 00:00:00 2001 From: Fernando Ferrara Date: Wed, 5 Apr 2023 17:07:10 -0300 Subject: [PATCH 3/4] Redirect to UnknownView when route was not find --- lib/src/templates/app/web/lib/app/app.dart.stk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/templates/app/web/lib/app/app.dart.stk b/lib/src/templates/app/web/lib/app/app.dart.stk index 964a1e2..0f043e5 100644 --- a/lib/src/templates/app/web/lib/app/app.dart.stk +++ b/lib/src/templates/app/web/lib/app/app.dart.stk @@ -15,6 +15,8 @@ import 'package:stacked_services/stacked_services.dart'; CustomRoute(page: UnknownView, path: '/404'), + /// When none of the above routes match, redirect to UnknownView + RedirectRoute(path: '*', redirectTo: '/404'), ], dependencies: [ LazySingleton(classType: BottomSheetService), From 3cd50372fcfd7ea88ce5c1a793b63756687161bd Mon Sep 17 00:00:00 2001 From: Fernando Ferrara Date: Wed, 5 Apr 2023 17:07:17 -0300 Subject: [PATCH 4/4] Compile templates --- lib/src/templates/compiled_template_map.dart | 153 ++++--- lib/src/templates/compiled_templates.dart | 406 +++++++++++++++++-- 2 files changed, 452 insertions(+), 107 deletions(-) diff --git a/lib/src/templates/compiled_template_map.dart b/lib/src/templates/compiled_template_map.dart index 60cbb85..2262b6d 100644 --- a/lib/src/templates/compiled_template_map.dart +++ b/lib/src/templates/compiled_template_map.dart @@ -11,6 +11,10 @@ Map> kCompiledStackedTemplates = { relativeOutputPath: kAppWebTemplateStackedJsonStkPath, content: kAppWebTemplateStackedJsonStkContent, fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewmodelTestPath, + content: kAppWebTemplateUnknownViewmodelTestContent, + fileType: FileType.text), TemplateFile( relativeOutputPath: kAppWebTemplateHomeViewmodelTestPath, content: kAppWebTemplateHomeViewmodelTestContent, @@ -59,6 +63,10 @@ Map> kCompiledStackedTemplates = { relativeOutputPath: kAppWebTemplateUiHelpersPath, content: kAppWebTemplateUiHelpersContent, fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateAppStylesPath, + content: kAppWebTemplateAppStylesContent, + fileType: FileType.text), TemplateFile( relativeOutputPath: kAppWebTemplateAppStringsPath, content: kAppWebTemplateAppStringsContent, @@ -103,6 +111,26 @@ Map> kCompiledStackedTemplates = { relativeOutputPath: kAppWebTemplateHomeViewTabletPath, content: kAppWebTemplateHomeViewTabletContent, fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewPath, + content: kAppWebTemplateUnknownViewContent, + fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewDesktopPath, + content: kAppWebTemplateUnknownViewDesktopContent, + fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewTabletPath, + content: kAppWebTemplateUnknownViewTabletContent, + fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewmodelPath, + content: kAppWebTemplateUnknownViewmodelContent, + fileType: FileType.text), + TemplateFile( + relativeOutputPath: kAppWebTemplateUnknownViewMobilePath, + content: kAppWebTemplateUnknownViewMobileContent, + fileType: FileType.text), TemplateFile( relativeOutputPath: kAppWebTemplateStartupViewmodelPath, content: kAppWebTemplateStartupViewmodelContent, @@ -131,10 +159,6 @@ Map> kCompiledStackedTemplates = { relativeOutputPath: kAppWebTemplatePubspecYamlStkPath, content: kAppWebTemplatePubspecYamlStkContent, fileType: FileType.text), - TemplateFile( - relativeOutputPath: kAppWebTemplateSettingsJsonStkPath, - content: kAppWebTemplateSettingsJsonStkContent, - fileType: FileType.text), ], modificationFiles: [], ), @@ -257,21 +281,18 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-dialog', modificationTemplate: '''StackedDialog(classType: {{dialogName}}),''', - modificationProblemError: - 'The dialog registration should be stored in lib/app/app.dart', - modificationName: - 'Add \'{{dialogName}}\' dependency to StackedApp annotations file', + modificationProblemError: 'The dialog registration should be stored in lib/app/app.dart', + modificationName: 'Add \'{{dialogName}}\' dependency to StackedApp annotations file', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{dialogsPath}}}/{{dialogFolderName}}/{{dialogFilename}}\';''', - modificationProblemError: - 'The dialog registration should be stored in lib/app/app.dart', + modificationTemplate: '''import \'package:{{packageName}}/{{{dialogsPath}}}/{{dialogFolderName}}/{{dialogFilename}}\';''', + modificationProblemError: 'The dialog registration should be stored in lib/app/app.dart', modificationName: 'Add import for \'{{dialogName}}\' class', ), - ], + ], ), }, 'view': { @@ -299,22 +320,18 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-route', modificationTemplate: '''MaterialRoute(page: {{viewName}}),''', - modificationProblemError: - 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: - 'Add {{viewName}} route where @StackedApp annotation is located', + modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: 'Add {{viewName}} route where @StackedApp annotation is located', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', - modificationProblemError: - 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: - 'Add {{viewName}} route import where @StackedApp annotation is located', + modificationTemplate: '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', + modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: 'Add {{viewName}} route import where @StackedApp annotation is located', ), - ], + ], ), 'web': StackedTemplate( templateFiles: [ @@ -348,22 +365,18 @@ Map> kCompiledStackedTemplates = { relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-route', modificationTemplate: '''CustomRoute(page: {{viewName}}),''', - modificationProblemError: - 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: - 'Add {{viewName}} route where @StackedApp annotation is located', + modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: 'Add {{viewName}} route where @StackedApp annotation is located', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', - modificationProblemError: - 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', - modificationName: - 'Add {{viewName}} route import where @StackedApp annotation is located', + modificationTemplate: '''import \'package:{{packageName}}/{{{viewImportPath}}}/{{viewFolderName}}/{{viewFileName}}\';''', + modificationProblemError: 'The structure of your stacked application is invalid. The app.dart file should be located in lib/app/', + modificationName: 'Add {{viewName}} route import where @StackedApp annotation is located', ), - ], + ], ), }, 'service': { @@ -382,72 +395,63 @@ Map> kCompiledStackedTemplates = { ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-create', - modificationTemplate: - '''Mock{{serviceName}} getAndRegister{{serviceName}}() { + modificationTemplate: '''Mock{{serviceName}} getAndRegister{{serviceName}}() { _removeRegistrationIfExists<{{serviceName}}>(); final service = Mock{{serviceName}}(); {{locatorName}}.registerSingleton<{{serviceName}}>(service); return service; }''', - modificationProblemError: - 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Add {{serviceName}} mock to test helpers', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-service', - modificationTemplate: - '''LazySingleton(classType: {{serviceName}}),''', - modificationProblemError: - 'The service registration should be stored in lib/app/app.dart', - modificationName: - 'Add {{serviceName}} dependency to StackedApp annotations file', + modificationTemplate: '''LazySingleton(classType: {{serviceName}}),''', + modificationProblemError: 'The service registration should be stored in lib/app/app.dart', + modificationName: 'Add {{serviceName}} dependency to StackedApp annotations file', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', - modificationProblemError: - 'The service registration should be stored in lib/app/app.dart', - modificationName: - 'Add {{serviceName}} import to StackedApp annotations file', + modificationTemplate: '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', + modificationProblemError: 'The service registration should be stored in lib/app/app.dart', + modificationName: 'Add {{serviceName}} import to StackedApp annotations file', ), + ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-spec', - modificationTemplate: - '''MockSpec<{{serviceName}}>(onMissingStub: OnMissingStub.returnDefault),''', - modificationProblemError: - 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationTemplate: '''MockSpec<{{serviceName}}>(onMissingStub: OnMissingStub.returnDefault),''', + modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Create {{serviceName}} mock to test helpers', ), + ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-mock-register', modificationTemplate: '''getAndRegister{{serviceName}}();''', - modificationProblemError: - 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', + modificationProblemError: 'The test mocks and helpers should be stored in test/helpers/test_helpers.dart', modificationName: 'Add {{serviceName}} register to test helpers', ), + ModificationFile( relativeModificationPath: 'test/helpers/test_helpers.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', - modificationProblemError: - 'It seems your test_helpers.dart file is not in test/helpers/test_helpers.dart. Add a stacked.json file and set the path for \'test_helpers_path\' to the folder we can locate your test_helpers.dart file', + modificationTemplate: '''import \'package:{{packageName}}/{{{serviceImportPath}}}/{{serviceFilename}}\';''', + modificationProblemError: 'It seems your test_helpers.dart file is not in test/helpers/test_helpers.dart. Add a stacked.json file and set the path for \'test_helpers_path\' to the folder we can locate your test_helpers.dart file', modificationName: 'Add {{serviceName}} import to test helpers', ), - ], + ], ), }, 'bottom_sheet': { 'empty': StackedTemplate( templateFiles: [ TemplateFile( - relativeOutputPath: - kBottomSheetEmptyTemplateGenericSheetModelTestPath, + relativeOutputPath: kBottomSheetEmptyTemplateGenericSheetModelTestPath, content: kBottomSheetEmptyTemplateGenericSheetModelTestContent, fileType: FileType.text), TemplateFile( @@ -455,8 +459,7 @@ return service; content: kBottomSheetEmptyTemplateGenericSheetModelContent, fileType: FileType.text), TemplateFile( - relativeOutputPath: - kBottomSheetEmptyTemplateGenericSheetUseModelPath, + relativeOutputPath: kBottomSheetEmptyTemplateGenericSheetUseModelPath, content: kBottomSheetEmptyTemplateGenericSheetUseModelContent, fileType: FileType.text), TemplateFile( @@ -468,23 +471,19 @@ return service; ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-bottom-sheet', - modificationTemplate: - '''StackedBottomsheet(classType: {{sheetName}}),''', - modificationProblemError: - 'The bottom sheet registration should be stored in lib/app/app.dart', - modificationName: - 'Add \'{{sheetName}}\' dependency to StackedApp annotations file', + modificationTemplate: '''StackedBottomsheet(classType: {{sheetName}}),''', + modificationProblemError: 'The bottom sheet registration should be stored in lib/app/app.dart', + modificationName: 'Add \'{{sheetName}}\' dependency to StackedApp annotations file', ), + ModificationFile( relativeModificationPath: 'lib/app/app.dart', modificationIdentifier: '// @stacked-import', - modificationTemplate: - '''import \'package:{{packageName}}/{{{bottomSheetsPath}}}/{{sheetFolderName}}/{{sheetFilename}}\';''', - modificationProblemError: - 'The bottom sheet registration should be stored in lib/app/app.dart', + modificationTemplate: '''import \'package:{{packageName}}/{{{bottomSheetsPath}}}/{{sheetFolderName}}/{{sheetFilename}}\';''', + modificationProblemError: 'The bottom sheet registration should be stored in lib/app/app.dart', modificationName: 'Add import for \'{{sheetName}}\' class', ), - ], + ], ), }, }; diff --git a/lib/src/templates/compiled_templates.dart b/lib/src/templates/compiled_templates.dart index f8094c3..c36e25e 100644 --- a/lib/src/templates/compiled_templates.dart +++ b/lib/src/templates/compiled_templates.dart @@ -1,9 +1,11 @@ /// NOTE: This is generated code from the compileTemplates command. Do not modify by hand /// This file should be checked into source control. + // -------- StackedJsonStk Template Data ---------- -const String kAppWebTemplateStackedJsonStkPath = 'stacked.json.stk'; +const String kAppWebTemplateStackedJsonStkPath = + 'stacked.json.stk'; const String kAppWebTemplateStackedJsonStkContent = ''' { @@ -29,6 +31,29 @@ const String kAppWebTemplateStackedJsonStkContent = ''' // -------------------------------------------------- + +// -------- UnknownViewmodelTest Template Data ---------- + +const String kAppWebTemplateUnknownViewmodelTestPath = + 'test/viewmodels/unknown_viewmodel_test.dart.stk'; + +const String kAppWebTemplateUnknownViewmodelTestContent = ''' +import 'package:flutter_test/flutter_test.dart'; +import 'package:{{packageName}}/{{{relativeLocatorFilePath}}}'; + +import '../helpers/test_helpers.dart'; + +void main() { + group('UnknownViewModel Tests -', () { + setUp(() => registerServices()); + tearDown(() => locator.reset()); + }); +} +'''; + +// -------------------------------------------------- + + // -------- HomeViewmodelTest Template Data ---------- const String kAppWebTemplateHomeViewmodelTestPath = @@ -80,6 +105,7 @@ void main() { // -------------------------------------------------- + // -------- NoticeSheetModelTest Template Data ---------- const String kAppWebTemplateNoticeSheetModelTestPath = @@ -102,6 +128,7 @@ void main() { // -------------------------------------------------- + // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelTestPath = @@ -124,6 +151,7 @@ void main() { // -------------------------------------------------- + // -------- TestHelpers Template Data ---------- const String kAppWebTemplateTestHelpersPath = @@ -213,9 +241,11 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- + // -------- BuildYamlStk Template Data ---------- -const String kAppWebTemplateBuildYamlStkPath = 'build.yaml.stk'; +const String kAppWebTemplateBuildYamlStkPath = + 'build.yaml.stk'; const String kAppWebTemplateBuildYamlStkContent = ''' targets: @@ -228,9 +258,11 @@ targets: // -------------------------------------------------- + // -------- MainIconPngStk Template Data ---------- -const String kAppWebTemplateMainIconPngStkPath = 'web/main-icon.png.stk'; +const String kAppWebTemplateMainIconPngStkPath = + 'web/main-icon.png.stk'; const String kAppWebTemplateMainIconPngStkContent = ''' iVBORw0KGgoAAAANSUhEUgAAALMAAACzCAYAAADCFC3zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAN5SURBVHgB7daLjVNBDEDRF0QjVEIrdMLSAS3RyZZAByGWdqUQ5Z/5eGbOkSw3cC152wAAAAAAAAAAAAAAAACAjHZbYfuDDW77tdvt3raCvmzQXvGQg5hprUrIQcy0VC3kIGZaqRpyEDMtVA85iJnamoQcxExNzUIOYqaWpiEHMVND85CDmCmtS8hBzJTULeQgZkrpGnIQMyV0DzmImVelCDmImVekCTmImWelCjmImWekCzmImUelDDmImUekDTmImXulDjmImXukDzmImVuGCDmImWuGCTmImUuGCjmImXOGCzmImVNDhhzEzLFhQw5i5tPQIQcxE4YPOYiZKUIOYl7bNCEHMa9rqpCDmNc0XchBzOuZMuQg5rVMG3IQ8zqmDjmIeQ3ThxzEPL8lQg5intsyIQcxz2upkIOY57RcyEHM81ky5CDmuSwbchDzPJYOOYh5DsuHHMQ8PiF/EPPYhHxEzOMS8gkxj0nIZ4h5PEK+QMxjEfIVYh6HkG8Q8xiEfAcx5yfkO4k5NyE/QMx5CflBYs5JyE8Qcz5CfpKYcxHyC8Sch5BfJOYchFyAmPsTciFi7kvIBYm5HyEXJuY+hFyBmNsTciVibkvIFYm5HSFXttsK2+/3bxunvh/mz8axv4fj/r0VVDxm/nc47p+H9bZx6v0Q87etIG9GRUJuS8yVCLk9MVcg5D7EXJiQ+xFzQULuS8yFCLk/MRcg5BzE/CIh5yHmFwg5FzE/Scj5iPkJQs5JzA8Scl5ifoCQcxPznYScn5jvIOQxiPkGIY9DzFcIeSxivkDI4xHzGUIek5hPCHlcYj4i5LGJ+YOQxyfmTcizWD5mIc9j6ZiFPJdlYxbyfJaMWchzWi5mIc9rqZiFPLdlYhby/JaIWchrmD5mIa9j6piFvJZpYxbyeqaMWchrmi5mIa9rqpiFvLZpYhYyU8QsZMLwMQuZT0PHLGSODRuzkDk1ZMxC5pzhYhYylwwVs5C5ZpiYhcwtQ8QsZO6RPmYhc6/UMQuZR6SNWcg8KmXMQuYZ6WIWMs9KFbOQeUWamIXMq1LELGRK6B6zkCmla8xCpqRuMQuZ0rrELGRqaB6zkKmlacxCpqZmMQuZ2prELGRaqB6zkGmlasxCpqVqMQuZ1qrELGR6+LoVdgj5x2HFvG9w2fsGAAAAAAAAAAAAAAAAACzhH8sFZqawpyetAAAAAElFTkSuQmCC @@ -238,9 +270,11 @@ iVBORw0KGgoAAAANSUhEUgAAALMAAACzCAYAAADCFC3zAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- + // -------- IndexHtmlStk Template Data ---------- -const String kAppWebTemplateIndexHtmlStkPath = 'web/index.html.stk'; +const String kAppWebTemplateIndexHtmlStkPath = + 'web/index.html.stk'; const String kAppWebTemplateIndexHtmlStkContent = ''' @@ -418,9 +452,11 @@ const String kAppWebTemplateIndexHtmlStkContent = ''' // -------------------------------------------------- + // -------- FaviconPngStk Template Data ---------- -const String kAppWebTemplateFaviconPngStkPath = 'web/favicon.png.stk'; +const String kAppWebTemplateFaviconPngStkPath = + 'web/favicon.png.stk'; const String kAppWebTemplateFaviconPngStkContent = ''' iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHaSURBVHgBpVTNasJAEN7dxLQl+FNEFBRR8VCQgo+gryCkh9499CnUg/gMvo3eFWw9eBLS4sWT2oOHRLOdWWLYxkRT+8GS3cnkm28mM0tIMOhpwzmn7plKdurawz9EdLtdNhqNWKvVekyn0ynLsghjTPg4jsNt26a6rnO09/v9r2Qy6UwmkwOlwoX7yZVqtWqA07v78uqKx+NmsVhsw179Jc4wDKVcLrejEvkXCHlBDlmdlkgkPm8lhKw+arWahipRKikUCspqtSqe2FOpFKnX6+QSZrMZ2W63Yr/b7Z6htshl45kOh8MnOWKj0eCXAD8vSKmOf54ho6qqnEREr9fDbjizZzIZikBCut/v6X/IENBeQikSck3TrnFdJJMghJ3V0L86nc5ZHbHOsk82m9WFUCTEzg8DkEVRhpOE6jhD57CUo5IR4tVQpMyCUg5KM0LKorH5crn8lqNhY4/HY9JsNkMVYWPLWK/XXutRmJQHGPQ5uXH0cGxLpdK9SNeVe8jlcgNyI2CWB6ZpHjwDjgxGyOfzb3+5JIBoXqlUXuG2uSOnHpQCUSi0slgs7qCNVAwCEHXZbDZYV+8sZpYxJxaLHaFc1nQ6PYLZCcsAy6BIT0U6eza83X2CBH4AHNJFlWlQookAAAAASUVORK5CYII= @@ -428,9 +464,11 @@ iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNS // -------------------------------------------------- + // -------- READMEMdStk Template Data ---------- -const String kAppWebTemplateREADMEMdStkPath = 'README.md.stk'; +const String kAppWebTemplateREADMEMdStkPath = + 'README.md.stk'; const String kAppWebTemplateREADMEMdStkContent = ''' # stacked_app @@ -454,9 +492,11 @@ samples, guidance on mobile development, and a full API reference. // -------------------------------------------------- + // -------- Main Template Data ---------- -const String kAppWebTemplateMainPath = 'lib/main.dart.stk'; +const String kAppWebTemplateMainPath = + 'lib/main.dart.stk'; const String kAppWebTemplateMainContent = ''' import 'package:flutter/material.dart'; @@ -509,6 +549,7 @@ class MyApp extends StatelessWidget { // -------------------------------------------------- + // -------- AppConstants Template Data ---------- const String kAppWebTemplateAppConstantsPath = @@ -525,9 +566,11 @@ const double kdDesktopMaxContentHeight = 750; // -------------------------------------------------- + // -------- UiHelpers Template Data ---------- -const String kAppWebTemplateUiHelpersPath = 'lib/ui/common/ui_helpers.dart.stk'; +const String kAppWebTemplateUiHelpersPath = + 'lib/ui/common/ui_helpers.dart.stk'; const String kAppWebTemplateUiHelpersContent = ''' import 'dart:math'; @@ -613,6 +656,40 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- + +// -------- AppStyles Template Data ---------- + +const String kAppWebTemplateAppStylesPath = + 'lib/ui/common/app_styles.dart.stk'; + +const String kAppWebTemplateAppStylesContent = ''' +import 'package:flutter/material.dart'; + +TextStyle get ktsHeading1 => const TextStyle( + fontSize: 80, + height: 0.95, + fontWeight: FontWeight.w800, + ); + +TextStyle get ktsHeading2 => const TextStyle( + fontSize: 40, + height: 0.95, + fontWeight: FontWeight.w800, + ); + +TextStyle get ktsBodyRegular => const TextStyle( + fontSize: 15, + ); + +TextStyle get ktsBodyLarge => const TextStyle( + fontSize: 20, + ); + +'''; + +// -------------------------------------------------- + + // -------- AppStrings Template Data ---------- const String kAppWebTemplateAppStringsPath = @@ -627,25 +704,30 @@ const String ksHomeBottomSheetDescription = // -------------------------------------------------- + // -------- AppColors Template Data ---------- -const String kAppWebTemplateAppColorsPath = 'lib/ui/common/app_colors.dart.stk'; +const String kAppWebTemplateAppColorsPath = + 'lib/ui/common/app_colors.dart.stk'; const String kAppWebTemplateAppColorsContent = ''' import 'package:flutter/material.dart'; const Color kcPrimaryColor = Color(0xFF9600FF); const Color kcPrimaryColorDark = Color(0xFF300151); +const Color kcBlack = Color(0xFF000000); const Color kcDarkGreyColor = Color(0xFF1A1B1E); const Color kcMediumGrey = Color(0xFF474A54); const Color kcLightGrey = Color.fromARGB(255, 187, 187, 187); const Color kcVeryLightGrey = Color(0xFFE3E3E3); +const Color kcWhite = Color(0xFFFFFFFF); const Color kcBackgroundColor = kcDarkGreyColor; '''; // -------------------------------------------------- + // -------- NoticeSheetModel Template Data ---------- const String kAppWebTemplateNoticeSheetModelPath = @@ -660,6 +742,7 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- + // -------- NoticeSheet Template Data ---------- const String kAppWebTemplateNoticeSheetPath = @@ -728,6 +811,7 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- + // -------- InfoAlertDialogModel Template Data ---------- const String kAppWebTemplateInfoAlertDialogModelPath = @@ -742,6 +826,7 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- + // -------- InfoAlertDialog Template Data ---------- const String kAppWebTemplateInfoAlertDialogPath = @@ -861,6 +946,7 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- + // -------- HomeViewDesktop Template Data ---------- const String kAppWebTemplateHomeViewDesktopPath = @@ -947,6 +1033,7 @@ class HomeViewDesktop extends ViewModelWidget { // -------------------------------------------------- + // -------- HomeViewMobile Template Data ---------- const String kAppWebTemplateHomeViewMobilePath = @@ -1033,6 +1120,7 @@ class HomeViewMobile extends ViewModelWidget { // -------------------------------------------------- + // -------- HomeView Template Data ---------- const String kAppWebTemplateHomeViewPath = @@ -1075,6 +1163,7 @@ class HomeView extends StackedView { // -------------------------------------------------- + // -------- HomeViewmodel Template Data ---------- const String kAppWebTemplateHomeViewmodelPath = @@ -1122,6 +1211,7 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- + // -------- HomeViewTablet Template Data ---------- const String kAppWebTemplateHomeViewTabletPath = @@ -1208,6 +1298,215 @@ class HomeViewTablet extends ViewModelWidget { // -------------------------------------------------- + +// -------- UnknownView Template Data ---------- + +const String kAppWebTemplateUnknownViewPath = + 'lib/ui/views/unknown/unknown_view.dart.stk'; + +const String kAppWebTemplateUnknownViewContent = ''' +import 'package:flutter/material.dart'; +import 'package:responsive_builder/responsive_builder.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_view.desktop.dart'; +import 'unknown_view.tablet.dart'; +import 'unknown_view.mobile.dart'; +import 'unknown_viewmodel.dart'; + +class UnknownView extends StackedView { + const UnknownView({super.key}); + + @override + Widget builder( + BuildContext context, + UnknownViewModel viewModel, + Widget? child, + ) { + return ScreenTypeLayout.builder( + mobile: (_) => const UnknownViewMobile(), + tablet: (_) => const UnknownViewTablet(), + desktop: (_) => const UnknownViewDesktop(), + ); + } + + @override + UnknownViewModel viewModelBuilder( + BuildContext context, + ) => + UnknownViewModel(); +} + +'''; + +// -------------------------------------------------- + + +// -------- UnknownViewDesktop Template Data ---------- + +const String kAppWebTemplateUnknownViewDesktopPath = + 'lib/ui/views/unknown/unknown_view.desktop.dart.stk'; + +const String kAppWebTemplateUnknownViewDesktopContent = ''' +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewDesktop extends ViewModelWidget { + const UnknownViewDesktop({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} + +'''; + +// -------------------------------------------------- + + +// -------- UnknownViewTablet Template Data ---------- + +const String kAppWebTemplateUnknownViewTabletPath = + 'lib/ui/views/unknown/unknown_view.tablet.dart.stk'; + +const String kAppWebTemplateUnknownViewTabletContent = ''' +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewTablet extends ViewModelWidget { + const UnknownViewTablet({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} + +'''; + +// -------------------------------------------------- + + +// -------- UnknownViewmodel Template Data ---------- + +const String kAppWebTemplateUnknownViewmodelPath = + 'lib/ui/views/unknown/unknown_viewmodel.dart.stk'; + +const String kAppWebTemplateUnknownViewmodelContent = ''' +import 'package:stacked/stacked.dart'; + +class UnknownViewModel extends BaseViewModel {} + +'''; + +// -------------------------------------------------- + + +// -------- UnknownViewMobile Template Data ---------- + +const String kAppWebTemplateUnknownViewMobilePath = + 'lib/ui/views/unknown/unknown_view.mobile.dart.stk'; + +const String kAppWebTemplateUnknownViewMobileContent = ''' +import 'package:{{packageName}}/ui/common/app_colors.dart'; +import 'package:{{packageName}}/ui/common/app_styles.dart'; +import 'package:{{packageName}}/ui/common/ui_helpers.dart'; +import 'package:flutter/material.dart'; +import 'package:stacked/stacked.dart'; + +import 'unknown_viewmodel.dart'; + +class UnknownViewMobile extends ViewModelWidget { + const UnknownViewMobile({super.key}); + + @override + Widget build(BuildContext context, UnknownViewModel viewModel) { + return Scaffold( + backgroundColor: kcBackgroundColor, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '404', + style: ktsHeading1.copyWith(color: kcWhite, letterSpacing: 20.0), + ), + verticalSpaceSmall, + Text( + 'PAGE NOT FOUND', + style: ktsBodyLarge.copyWith( + color: kcWhite, + letterSpacing: 20.0, + wordSpacing: 10.0, + ), + ), + ], + ), + ), + ); + } +} + +'''; + +// -------------------------------------------------- + + // -------- StartupViewmodel Template Data ---------- const String kAppWebTemplateStartupViewmodelPath = @@ -1235,6 +1534,7 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- + // -------- StartupView Template Data ---------- const String kAppWebTemplateStartupViewPath = @@ -1309,6 +1609,7 @@ class StartupView extends StackedView { // -------------------------------------------------- + // -------- ScaleOnHover Template Data ---------- const String kAppWebTemplateScaleOnHoverPath = @@ -1358,6 +1659,7 @@ class _ScaleOnHoverState extends State { // -------------------------------------------------- + // -------- TranslateOnHover Template Data ---------- const String kAppWebTemplateTranslateOnHoverPath = @@ -1414,15 +1716,18 @@ class _TranslateOnHoverState extends State { // -------------------------------------------------- + // -------- App Template Data ---------- -const String kAppWebTemplateAppPath = 'lib/app/app.dart.stk'; +const String kAppWebTemplateAppPath = + 'lib/app/app.dart.stk'; const String kAppWebTemplateAppContent = ''' import 'package:{{packageName}}/{{{bottomSheetsPath}}}/notice/notice_sheet.dart'; import 'package:{{packageName}}/{{{dialogsPath}}}/info_alert/info_alert_dialog.dart'; import 'package:{{packageName}}/{{{viewImportPath}}}/home/home_view.dart'; import 'package:{{packageName}}/{{{viewImportPath}}}/startup/startup_view.dart'; +import 'package:{{packageName}}/{{{viewImportPath}}}/unknown/unknown_view.dart'; import 'package:stacked/stacked_annotations.dart'; import 'package:stacked_services/stacked_services.dart'; // @stacked-import @@ -1432,6 +1737,11 @@ import 'package:stacked_services/stacked_services.dart'; CustomRoute(page: StartupView, initial: true), CustomRoute(page: HomeView), // @stacked-route + + CustomRoute(page: UnknownView, path: '/404'), + + /// When none of the above routes match, redirect to UnknownView + RedirectRoute(path: '*', redirectTo: '/404'), ], dependencies: [ LazySingleton(classType: BottomSheetService), @@ -1454,6 +1764,7 @@ class App {} // -------------------------------------------------- + // -------- HoverExtensions Template Data ---------- const String kAppWebTemplateHoverExtensionsPath = @@ -1496,9 +1807,11 @@ extension HoverExtensions on Widget { // -------------------------------------------------- + // -------- PubspecYamlStk Template Data ---------- -const String kAppWebTemplatePubspecYamlStkPath = 'pubspec.yaml.stk'; +const String kAppWebTemplatePubspecYamlStkPath = + 'pubspec.yaml.stk'; const String kAppWebTemplatePubspecYamlStkContent = ''' name: {{packageName}} @@ -1605,24 +1918,11 @@ flutter: // -------------------------------------------------- -// -------- SettingsJsonStk Template Data ---------- - -const String kAppWebTemplateSettingsJsonStkPath = '.vscode/settings.json.stk'; - -const String kAppWebTemplateSettingsJsonStkContent = ''' -{ - "explorer.fileNesting.enabled": true, - "explorer.fileNesting.patterns": { - "*.dart": "\${capture}.mobile.dart, \${capture}.tablet.dart, \${capture}.desktop.dart, \${capture}.form.dart" - }, -} -'''; - -// -------------------------------------------------- // -------- StackedJsonStk Template Data ---------- -const String kAppMobileTemplateStackedJsonStkPath = 'stacked.json.stk'; +const String kAppMobileTemplateStackedJsonStkPath = + 'stacked.json.stk'; const String kAppMobileTemplateStackedJsonStkContent = ''' { @@ -1647,6 +1947,7 @@ const String kAppMobileTemplateStackedJsonStkContent = ''' // -------------------------------------------------- + // -------- HomeViewmodelTest Template Data ---------- const String kAppMobileTemplateHomeViewmodelTestPath = @@ -1698,6 +1999,7 @@ void main() { // -------------------------------------------------- + // -------- NoticeSheetModelTest Template Data ---------- const String kAppMobileTemplateNoticeSheetModelTestPath = @@ -1720,6 +2022,7 @@ void main() { // -------------------------------------------------- + // -------- InfoAlertDialogModelTest Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelTestPath = @@ -1742,6 +2045,7 @@ void main() { // -------------------------------------------------- + // -------- TestHelpers Template Data ---------- const String kAppMobileTemplateTestHelpersPath = @@ -1831,9 +2135,11 @@ void _removeRegistrationIfExists() { // -------------------------------------------------- + // -------- READMEMdStk Template Data ---------- -const String kAppMobileTemplateREADMEMdStkPath = 'README.md.stk'; +const String kAppMobileTemplateREADMEMdStkPath = + 'README.md.stk'; const String kAppMobileTemplateREADMEMdStkContent = ''' # stacked_app @@ -1857,9 +2163,11 @@ samples, guidance on mobile development, and a full API reference. // -------------------------------------------------- + // -------- Main Template Data ---------- -const String kAppMobileTemplateMainPath = 'lib/main.dart.stk'; +const String kAppMobileTemplateMainPath = + 'lib/main.dart.stk'; const String kAppMobileTemplateMainContent = ''' import 'package:flutter/material.dart'; @@ -1906,6 +2214,7 @@ class MyApp extends StatelessWidget { // -------------------------------------------------- + // -------- UiHelpers Template Data ---------- const String kAppMobileTemplateUiHelpersPath = @@ -1995,6 +2304,7 @@ double getResponsiveFontSize(BuildContext context, // -------------------------------------------------- + // -------- AppStrings Template Data ---------- const String kAppMobileTemplateAppStringsPath = @@ -2009,6 +2319,7 @@ const String ksHomeBottomSheetDescription = // -------------------------------------------------- + // -------- AppColors Template Data ---------- const String kAppMobileTemplateAppColorsPath = @@ -2029,6 +2340,7 @@ const Color kcBackgroundColor = kcDarkGreyColor; // -------------------------------------------------- + // -------- NoticeSheetModel Template Data ---------- const String kAppMobileTemplateNoticeSheetModelPath = @@ -2043,6 +2355,7 @@ class NoticeSheetModel extends BaseViewModel {} // -------------------------------------------------- + // -------- NoticeSheet Template Data ---------- const String kAppMobileTemplateNoticeSheetPath = @@ -2111,6 +2424,7 @@ class NoticeSheet extends StackedView { // -------------------------------------------------- + // -------- InfoAlertDialogModel Template Data ---------- const String kAppMobileTemplateInfoAlertDialogModelPath = @@ -2125,6 +2439,7 @@ class InfoAlertDialogModel extends BaseViewModel {} // -------------------------------------------------- + // -------- InfoAlertDialog Template Data ---------- const String kAppMobileTemplateInfoAlertDialogPath = @@ -2244,6 +2559,7 @@ class InfoAlertDialog extends StackedView { // -------------------------------------------------- + // -------- HomeViewV1 Template Data ---------- const String kAppMobileTemplateHomeViewV1Path = @@ -2332,6 +2648,7 @@ class HomeView extends StatelessWidget { // -------------------------------------------------- + // -------- HomeView Template Data ---------- const String kAppMobileTemplateHomeViewPath = @@ -2427,6 +2744,7 @@ class HomeView extends StackedView { // -------------------------------------------------- + // -------- HomeViewmodel Template Data ---------- const String kAppMobileTemplateHomeViewmodelPath = @@ -2474,6 +2792,7 @@ class HomeViewModel extends BaseViewModel { // -------------------------------------------------- + // -------- StartupViewmodel Template Data ---------- const String kAppMobileTemplateStartupViewmodelPath = @@ -2503,6 +2822,7 @@ class StartupViewModel extends BaseViewModel { // -------------------------------------------------- + // -------- StartupViewV1 Template Data ---------- const String kAppMobileTemplateStartupViewV1Path = @@ -2568,6 +2888,7 @@ class StartupView extends StatelessWidget { // -------------------------------------------------- + // -------- StartupView Template Data ---------- const String kAppMobileTemplateStartupViewPath = @@ -2642,9 +2963,11 @@ class StartupView extends StackedView { // -------------------------------------------------- + // -------- App Template Data ---------- -const String kAppMobileTemplateAppPath = 'lib/app/app.dart.stk'; +const String kAppMobileTemplateAppPath = + 'lib/app/app.dart.stk'; const String kAppMobileTemplateAppContent = ''' import 'package:{{packageName}}/{{{bottomSheetsPath}}}/notice/notice_sheet.dart'; @@ -2682,9 +3005,11 @@ class App {} // -------------------------------------------------- + // -------- PubspecYamlStk Template Data ---------- -const String kAppMobileTemplatePubspecYamlStkPath = 'pubspec.yaml.stk'; +const String kAppMobileTemplatePubspecYamlStkPath = + 'pubspec.yaml.stk'; const String kAppMobileTemplatePubspecYamlStkContent = ''' name: {{packageName}} @@ -2788,6 +3113,7 @@ flutter: // -------------------------------------------------- + // -------- GenericDialogModelTest Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelTestPath = @@ -2810,6 +3136,7 @@ void main() { // -------------------------------------------------- + // -------- GenericDialogModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogModelPath = @@ -2824,6 +3151,7 @@ class {{dialogModelName}} extends BaseViewModel {} // -------------------------------------------------- + // -------- GenericDialogUseModel Template Data ---------- const String kDialogEmptyTemplateGenericDialogUseModelPath = @@ -2944,6 +3272,7 @@ class {{dialogName}} extends StackedView<{{dialogModelName}}> { // -------------------------------------------------- + // -------- GenericDialog Template Data ---------- const String kDialogEmptyTemplateGenericDialogPath = @@ -3053,6 +3382,7 @@ class {{dialogName}} extends StatelessWidget { // -------------------------------------------------- + // -------- GenericViewmodelTest Template Data ---------- const String kViewEmptyTemplateGenericViewmodelTestPath = @@ -3075,6 +3405,7 @@ void main() { // -------------------------------------------------- + // -------- GenericViewmodel Template Data ---------- const String kViewEmptyTemplateGenericViewmodelPath = @@ -3089,6 +3420,7 @@ class {{viewModelName}} extends BaseViewModel { // -------------------------------------------------- + // -------- GenericView Template Data ---------- const String kViewEmptyTemplateGenericViewPath = @@ -3126,6 +3458,7 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- + // -------- GenericViewV1 Template Data ---------- const String kViewEmptyTemplateGenericViewV1Path = @@ -3157,6 +3490,7 @@ class {{viewName}} extends StatelessWidget { // -------------------------------------------------- + // -------- GenericViewmodelTest Template Data ---------- const String kViewWebTemplateGenericViewmodelTestPath = @@ -3179,6 +3513,7 @@ void main() { // -------------------------------------------------- + // -------- GenericViewmodel Template Data ---------- const String kViewWebTemplateGenericViewmodelPath = @@ -3193,6 +3528,7 @@ class {{viewModelName}} extends BaseViewModel { // -------------------------------------------------- + // -------- GenericViewMobile Template Data ---------- const String kViewWebTemplateGenericViewMobilePath = @@ -3227,6 +3563,7 @@ class {{viewName}}Mobile extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- + // -------- GenericViewTablet Template Data ---------- const String kViewWebTemplateGenericViewTabletPath = @@ -3261,6 +3598,7 @@ class {{viewName}}Tablet extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- + // -------- GenericView Template Data ---------- const String kViewWebTemplateGenericViewPath = @@ -3303,6 +3641,7 @@ class {{viewName}} extends StackedView<{{viewModelName}}> { // -------------------------------------------------- + // -------- GenericViewDesktop Template Data ---------- const String kViewWebTemplateGenericViewDesktopPath = @@ -3337,6 +3676,7 @@ class {{viewName}}Desktop extends ViewModelWidget<{{viewModelName}}> { // -------------------------------------------------- + // -------- GenericServiceTest Template Data ---------- const String kServiceEmptyTemplateGenericServiceTestPath = @@ -3359,6 +3699,7 @@ void main() { // -------------------------------------------------- + // -------- GenericService Template Data ---------- const String kServiceEmptyTemplateGenericServicePath = @@ -3372,6 +3713,7 @@ class {{serviceName}} { // -------------------------------------------------- + // -------- GenericSheetModelTest Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelTestPath = @@ -3394,6 +3736,7 @@ void main() { // -------------------------------------------------- + // -------- GenericSheetModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetModelPath = @@ -3408,6 +3751,7 @@ class {{sheetModelName}} extends BaseViewModel {} // -------------------------------------------------- + // -------- GenericSheetUseModel Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetUseModelPath = @@ -3478,6 +3822,7 @@ class {{sheetName}} extends StackedView<{{sheetModelName}}> { // -------------------------------------------------- + // -------- GenericSheet Template Data ---------- const String kBottomSheetEmptyTemplateGenericSheetPath = @@ -3536,3 +3881,4 @@ class {{sheetName}} extends StatelessWidget { '''; // -------------------------------------------------- +