route<T> method

Route<T> route<T>(
  1. RouteSettings settings
)

Implementation

Route<T> route<T>(RouteSettings settings) {
  return MaterialPageRoute(
    settings: settings,
    builder: (context) {
      final routeDataGeneralLibFlutter = RouteDataGeneralLibFlutter.auto(
          context: context, settings: settings);
      try {
        for (final routeMapGeneralLibFlutter in routers.entries) {
          if (routeMapGeneralLibFlutter.key.toLowerCase() ==
              routeDataGeneralLibFlutter.path.toLowerCase()) {
            final child = routeMapGeneralLibFlutter.value(
                context, routeDataGeneralLibFlutter);
            if (child != null) {
              return anyDataToWidget(data: child, context: context);
            }
          }
        }
        return anyDataToWidget(
            data: onNotFoundRoute(context, routeDataGeneralLibFlutter),
            context: context);
      } catch (e) {
        return onErrorRoute(context, routeDataGeneralLibFlutter);
      }
    },
  );
}