DecoratedRoute<B extends BLoC, T> constructor
DecoratedRoute<B extends BLoC, T> ({
- Key? key,
- required Widget screen,
- B? bloc,
- CloseKeyboardConfig? autoCloseKeyboard = const CloseKeyboardConfig(),
- InitCallback<
B> ? init, - LateInitCallback<
B> ? onLateinit, - bool animate = true,
- bool withForm = false,
- TabControllerConfig? tabControllerConfig,
- VoidCallback? onDisposed,
- WillPopCallback? onWillPop,
- SystemUiOverlayStyle? systemUiOverlayStyle,
- Widget animationBuilder()?,
- bool autoDispose = true,
- BoxDecoration decorationBuilder()?,
- WidgetBuilder? backgroundBuilder,
- WidgetBuilder? foregroundBuilder,
- PrimaryScrollControllerConfig? primaryScrollControllerConfig,
- required String routeName,
- bool fullscreenDialog = false,
- bool maintainState = true,
Implementation
DecoratedRoute({
Key? key,
required this.screen,
B? bloc,
this.autoCloseKeyboard = const CloseKeyboardConfig(),
this.init,
this.onLateinit,
this.animate = true,
this.withForm = false,
@Deprecated('使用localNavigatorConfig代替') this.withLocalNavigator = false,
this.localNavigatorConfig,
this.tabControllerConfig,
this.onDisposed,
this.onWillPop,
this.systemUiOverlayStyle,
this.animationBuilder,
this.autoDispose = true,
this.decorationBuilder,
this.backgroundBuilder,
this.foregroundBuilder,
this.primaryScrollControllerConfig,
required String routeName,
super.fullscreenDialog,
super.maintainState,
}) : _bloc = bloc ?? get(), // 如果没有显式指定就从DI容器寻找
super(
builder: (context) => screen,
settings: RouteSettings(name: routeName),
);