NyController class
Base NyController
- Inheritance
-
- Object
- BaseController
- NyController
Constructors
- NyController({BuildContext? context, NyRequest? request})
Properties
- context ↔ BuildContext?
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- request ↔ NyRequest?
-
getter/setter pairinherited
-
routeGuards
↔ List<
RouteGuard> -
List of route guards
getter/setter pairinherited
- 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?
-
getter/setter pairinherited
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<
T> ({dynamic defaultValue}) → T? -
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
-
setState(
{required dynamic setState()}) → dynamic - Set the state of 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
anddata
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