NyController class

Base NyController

Inheritance

Constructors

NyController({BuildContext? context, NyRequest? request})

Properties

context BuildContext?
The BuildContext from the widget
getter/setter pairoverride
hashCode int
The hash code for this object.
no setterinherited
request NyRequest?
The request object
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
singleton bool
Set this to true if you want to use a singleton controller
no setter
state String?
The name of the state
getter/setter pairoverride

Methods

changeLanguage(String language, {bool restartState = true}) → void
Update the language in the application
confirmAction(dynamic action(), {required String title, String dismissText = "Cancel"}) → void
Perform a confirm action
construct(BuildContext context) → dynamic
Initialize your controller with this method. It contains same BuildContext as the NyStatefulWidget.
inherited
data({String? key}) → dynamic
Returns any data passed through a Navigator or routeTo method.
inherited
lockRelease(String name, {required Function perform, bool shouldSetState = true}) → void
Perform a lock release
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop({dynamic result}) → dynamic
Pop the page
queryParameters({String? key}) → dynamic
Returns any query parameters passed in a route e.g. /my-page?hello=world Result {"hello": "world"}
inherited
refreshPage() → dynamic
Refreshes 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.
toString() String
A string representation of this object.
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, bool showAlert = true, Duration? alertDuration, ToastNotificationStyleType alertStyle = ToastNotificationStyleType.WARNING, required dynamic onSuccess()?, dynamic onFailure(Exception exception)?, String? lockRelease}) → void
Validate data from your widget.

Operators

operator ==(Object other) bool
The equality operator.
inherited