-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from nylo-core/master
v0.6.0 changes
- Loading branch information
Showing
24 changed files
with
630 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
String controllerStub({String controllerName}) => ''' | ||
import 'controller.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
class ${controllerName}Controller extends Controller { | ||
${controllerName}Controller(); | ||
@override | ||
construct(BuildContext context) { | ||
} | ||
} | ||
'''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:nylo_framework/plugin/nylo_plugin.dart'; | ||
import 'package:nylo_framework/router/router.dart'; | ||
|
||
class Nylo { | ||
NyRouter router; | ||
ThemeData themeData; | ||
Nylo({this.router, this.themeData}); | ||
|
||
use(NyPlugin plugin) { | ||
plugin.initPackage(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:nylo_framework/nylo.dart'; | ||
|
||
class NyPlugin { | ||
Nylo nyloApp; | ||
initPackage(Nylo nylo) { | ||
nyloApp = nylo; | ||
this.construct(); | ||
} | ||
|
||
construct() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:meta/meta.dart'; | ||
|
||
class RouteNotFoundError extends Error { | ||
final String name; | ||
|
||
RouteNotFoundError({ | ||
@required this.name, | ||
}); | ||
|
||
@override | ||
String toString() { | ||
return "** Route '$name' not found! Make sure you are not using the wrong name" | ||
" or have registered the route."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:nylo_framework/router/models/base_arguments.dart'; | ||
import 'package:page_transition/page_transition.dart'; | ||
|
||
class ArgumentsWrapper { | ||
BaseArguments baseArguments; | ||
PageTransitionType pageTransitionType; | ||
Duration transitionDuration; | ||
|
||
ArgumentsWrapper( | ||
{this.baseArguments, this.transitionDuration, this.pageTransitionType}); | ||
|
||
ArgumentsWrapper copyWith( | ||
{BaseArguments baseArguments, PageTransitionType pageTransitionType}) { | ||
return ArgumentsWrapper( | ||
baseArguments: baseArguments ?? this.baseArguments, | ||
transitionDuration: transitionDuration ?? this.transitionDuration, | ||
pageTransitionType: pageTransitionType ?? this.pageTransitionType); | ||
} | ||
|
||
@override | ||
String toString() { | ||
return 'ArgumentsWrapper{baseArguments: $baseArguments, ' | ||
'transitionDuration: $transitionDuration, '; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
abstract class BaseArguments {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'package:nylo_framework/router/models/base_arguments.dart'; | ||
|
||
class NyArgument extends BaseArguments { | ||
dynamic data; | ||
NyArgument(this.data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:nylo_framework/router/ui/page_not_found.dart'; | ||
|
||
/// Options to configure a Nylo Router instance. | ||
class NyRouterOptions { | ||
final bool handleNameNotFoundUI; | ||
final Widget notFoundPage; | ||
final Duration transitionDuration; | ||
|
||
/// Should display logs in console. Nylo Router prints some useful logs | ||
/// which can be helpful during development. | ||
/// | ||
/// By default logs are disabled i.e. value is set to [false]. | ||
final bool isLoggingEnabled; | ||
|
||
/// A navigator key lets NyRouter grab the [NavigatorState] from a [MaterialApp] | ||
/// or a [CupertinoApp]. All navigation operations (push, pop, etc) are carried | ||
/// out using this [NavigatorState]. | ||
/// | ||
/// This is the same [NavigatorState] that is returned by [Navigator.of(context)] | ||
/// (when there is only a single [Navigator] in Widget tree, i.e. from [MaterialApp] | ||
/// or [CupertinoApp]). | ||
final GlobalKey<NavigatorState> navigatorKey; | ||
|
||
const NyRouterOptions({ | ||
this.notFoundPage = const PageNotFound(), | ||
this.handleNameNotFoundUI = false, | ||
this.isLoggingEnabled = false, | ||
this.transitionDuration = const Duration(milliseconds: 300), | ||
this.navigatorKey, | ||
}) : assert(handleNameNotFoundUI != null); | ||
} |
Oops, something went wrong.