NyPage<T extends BaseController> class
- Inheritance
-
- Available extensions
Methods
-
boot()
→ dynamic
-
The boot method called within init.
You may override this method for making asynchronous awaits.
In your build method, you can use the
afterLoad
method
like in the below example.
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeAreaWidget(
child: afterLoad(child: () => Container()
)
);
}
This will then only display the widget after the boot method has completed.
-
build(BuildContext context)
→ Widget
-
Build your UI
-
changeLanguage(String language, {bool restartState = true})
→ void
-
Update the language in the application
-
createElement()
→ StatefulElement
-
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState()
→ State<StatefulWidget>
-
Creates the mutable state for this widget at a given location in the tree.
override
-
data({String? key})
→ dynamic
-
Returns data that's sent via the Navigator or routeTo method.
inherited
-
debugDescribeChildren()
→ List<DiagnosticsNode>
-
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(DiagnosticPropertiesBuilder properties)
→ void
-
Add additional properties associated with the node.
inherited
-
init()
→ dynamic
-
Initialize your widget in init.
-
loading(BuildContext context)
→ Widget
-
This widget is used whenever your widget uses the boot
method to load data. When data is loading via a Future in
the boot method, this widget will be displayed to the user.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
queryParameters()
→ dynamic
-
Returns query params
inherited
-
refreshPage({dynamic setState()?})
→ void
-
Refresh the page
-
showToastCustom({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Display a custom Toast message.
-
showToastDanger({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Error" for the title, you
only need to provide a
description
.
-
showToastInfo({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Info" for the title, you
only need to provide a
description
.
-
showToastOops({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Oops" for the title, you
only need to provide a
description
.
-
showToastSorry({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Sorry" for the title, you
only need to provide a
description
.
-
showToastSuccess({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Success" for the title, you
only need to provide a
description
.
-
showToastWarning({String? title, required String description, ToastNotificationStyleType? style})
→ void
-
Displays a Toast message containing "Warning" for the title, you
only need to provide a
description
.
-
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style})
→ DiagnosticsNode
-
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString({DiagnosticLevel minLevel = DiagnosticLevel.info})
→ String
-
A string representation of this object.
inherited
-
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug})
→ String
-
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug})
→ String
-
Returns a one-line detailed description of the object.
inherited
-
toStringShort()
→ String
-
A short, textual description of this widget.
inherited
-
updatePageState(String action, dynamic data)
→ void
-
Updates the page state
Provide an
action
and data
to call a method in the NyState.
-
validate({required Map<String, dynamic> rules, Map<String, dynamic>? data, Map<String, dynamic> messages = const {}, bool showAlert = true, Duration? alertDuration, ToastNotificationStyleType alertStyle = ToastNotificationStyleType.WARNING, required dynamic onSuccess()?, dynamic onFailure(Exception exception)?, String? lockRelease})
→ void
-
Validate data from your widget.