to method

void to({
  1. String? routeName,
  2. Map<String, dynamic>? args,
})

Navigates to the specified route with optional args.

If a valid context and route name are provided, this method navigates to the specified route with optional args.

Implementation

void to({String? routeName, Map<String,dynamic>? args}) {
  if (routeName != null) {
    Navigator.pushNamed(context, routeName, arguments: args);
  }
}