import 'package:fis_ui/define.dart';
import 'package:get/get.dart';

typedef FPageBuilder = FWidget Function();

/// 页面路由
///
/// [name] 路由地址
///
/// [pageBuilder] 页面构建器
///
/// [title] 标题
///
/// [binding] 依赖绑定 - 使用已定义的继承自[Bindings]的类实例，或者使用[BindingsBuilder.put]
///
/// [transition] 转场动画
///
/// [transitionDuration] 转场动画时长
///
/// [children] 子路由
///
/// [middlewares] 中间件
///
/// [navigatorId] 导航ID - 在[]中定义
class FRouteSetting<T> extends GetPage<T> {
  FRouteSetting(
    String name,
    FWidget Function() pageBuilder, {
    String? title,
    Bindings? binding,
    // List<Bindings> bindings = const [],
    Transition? transition,
    Duration? transitionDuration,
    CustomTransition? customTransition,
    List<FRouteSetting>? children,
    List<GetMiddleware>? middlewares,
    bool fullscreenDialog = false,
    this.navigatorId,
  }) : super(
          name: name,
          page: pageBuilder,
          title: title,
          binding: binding,
          // bindings: bindings,
          transition: transition,
          transitionDuration: transitionDuration,
          customTransition: customTransition,
          children: children ?? const [],
          middlewares: middlewares,
          fullscreenDialog: fullscreenDialog,
          popGesture: false,
        );

  /// 导航ID
  final int? navigatorId;
}
