import 'package:flutter/material.dart';
import 'package:get/get.dart';

typedef VPageBuilder = Widget Function();

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

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