Skip to content

Commit

Permalink
v5.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Nov 23, 2023
1 parent df1bed0 commit 26fdcc4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
## [5.10.0] - 2023-11-23

* Ability to set routes as the initialPage using **--initial** E.g. `metro make:page dashboard --initial`
* Ability to set routes as the authPage using **--auth** E.g. `metro make:page dashboard --auth`
* Update pubspec.yaml

## [5.9.0] - 2023-11-22

* New ability to create dio Interceptors using Metro. E.g. `metro make:interceptor auth_token`
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Expand Up @@ -235,15 +235,15 @@ packages:
path: ".."
relative: true
source: path
version: "5.9.0"
version: "5.10.0"
nylo_support:
dependency: transitive
description:
name: nylo_support
sha256: c20052ebd9849fa4c6908dcf0f693437647bbd56761f2cb39a3e504e0ad947e9
sha256: "32c64a6861a5ea621aa1f77254c3a18b9d61cfd67ec501cea4178b7ff3579819"
url: "https://pub.dev"
source: hosted
version: "5.15.0"
version: "5.16.0"
page_transition:
dependency: transitive
description:
Expand Down
33 changes: 30 additions & 3 deletions lib/metro/metro.dart
Expand Up @@ -845,6 +845,18 @@ _makePage(List<String> arguments) async {
help: 'Creates a new page with a controller',
negatable: false,
);
parser.addFlag(
authPageFlag,
abbr: 'a',
help: 'Creates a new page that will be the auth page',
negatable: false,
);
parser.addFlag(
initialPageFlag,
abbr: 'i',
help: 'Creates a new page that will be the initial page',
negatable: false,
);
parser.addFlag(
forceFlag,
abbr: 'f',
Expand All @@ -859,10 +871,19 @@ _makePage(List<String> arguments) async {
bool? hasForceFlag = argResults[forceFlag];

bool shouldCreateController = false;
if (argResults["controller"]) {
if (argResults[controllerFlag]) {
shouldCreateController = true;
}

bool initialPage = false;
if (argResults[initialPageFlag]) {
initialPage = true;
}
bool authPage = false;
if (argResults[authPageFlag]) {
authPage = true;
}

if (argResults.arguments.first.trim() == "") {
MetroConsole.writeInRed('You cannot create a page with an empty string');
exit(1);
Expand All @@ -876,15 +897,21 @@ _makePage(List<String> arguments) async {
String stubPageAndController =
pageWithControllerStub(className: classReCase);
await MetroService.makePage(className.snakeCase, stubPageAndController,
forceCreate: hasForceFlag ?? false, addToRoute: true);
forceCreate: hasForceFlag ?? false,
addToRoute: true,
isInitialPage: initialPage,
isAuthPage: authPage);

String stubController = controllerStub(controllerName: classReCase);
await MetroService.makeController(className.snakeCase, stubController,
forceCreate: hasForceFlag ?? false);
} else {
String stubPage = pageStub(className: classReCase);
await MetroService.makePage(className.snakeCase, stubPage,
forceCreate: hasForceFlag ?? false, addToRoute: true);
forceCreate: hasForceFlag ?? false,
addToRoute: true,
isInitialPage: initialPage,
isAuthPage: authPage);
}
}

Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Expand Up @@ -233,10 +233,10 @@ packages:
dependency: "direct main"
description:
name: nylo_support
sha256: c20052ebd9849fa4c6908dcf0f693437647bbd56761f2cb39a3e504e0ad947e9
sha256: "32c64a6861a5ea621aa1f77254c3a18b9d61cfd67ec501cea4178b7ff3579819"
url: "https://pub.dev"
source: hosted
version: "5.15.0"
version: "5.16.0"
page_transition:
dependency: "direct main"
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
@@ -1,6 +1,6 @@
name: nylo_framework
description: Micro-framework for Flutter that's built to simplify app development for Flutter projects.
version: 5.9.0
version: 5.10.0
homepage: https://nylo.dev
repository: https://github.com/nylo-core/framework/tree/5.x
issue_tracker: https://github.com/nylo-core/framework/issues
Expand All @@ -16,7 +16,7 @@ environment:

dependencies:
flutter_dotenv: ^5.1.0
nylo_support: ^5.15.0
nylo_support: ^5.16.0
theme_provider: ^0.6.0
page_transition: ^2.1.0
collection: ^1.17.1
Expand Down

0 comments on commit 26fdcc4

Please sign in to comment.