@@ -367,3 +367,64 @@ typedef FFErrorWidgetBuilder = Widget Function(
367367 Object error,
368368 StackTrace stackTrace,
369369);
370+
371+ /// GoRouter
372+ ///
373+ class FFGoRouterRouteSettings extends RouteSettings {
374+ const FFGoRouterRouteSettings ({
375+ required String name,
376+ required this .builder,
377+ Object ? arguments,
378+ this .showStatusBar,
379+ this .routeName,
380+ this .pageRouteType,
381+ this .description,
382+ this .exts,
383+ this .codes,
384+ }) : super (
385+ name: name,
386+ arguments: arguments,
387+ );
388+
389+ factory FFGoRouterRouteSettings .notFound (Widget notFoundWidget) {
390+ return FFGoRouterRouteSettings (
391+ name: FFRoute .notFoundName,
392+ routeName: FFRoute .notFoundRouteName,
393+ builder: (_) => notFoundWidget,
394+ );
395+ }
396+
397+ /// to support something can't write in annotation
398+ /// it will be hadnled as a code when generate route
399+ final Map <String , dynamic >? codes;
400+
401+ /// The builder return the page
402+ final GoRouterPageBuilder builder;
403+
404+ /// The Widget base on this route
405+ //final Widget? widget;
406+
407+ /// Whether show status bar.
408+ final bool ? showStatusBar;
409+
410+ /// The route name to track page
411+ final String ? routeName;
412+
413+ /// The type of page route
414+ final PageRouteType ? pageRouteType;
415+
416+ /// The description of route
417+ final String ? description;
418+
419+ /// The extend arguments
420+ final Map <String , dynamic >? exts;
421+
422+ /// Whether the setting is targeting the not found route.
423+ bool get isNotFound =>
424+ name == FFRoute .notFoundName && routeName == FFRoute .notFoundRouteName;
425+ }
426+
427+ /// The builder return the page
428+ typedef GoRouterPageBuilder = Widget Function (
429+ Map <String , dynamic > safeArguments,
430+ );
0 commit comments