AppConfig class
全局App配置 Created by Arthur on 8/3/2022.
Constructors
-
AppConfig({required ThemeData theme, required Map<
String, PageBuilder> routers, String homeName = Navigator.defaultRouteName, Widget failedPage = const Scaffold(), TransitionBuilder? transitionBuilder, String title = "", MediaQueryBuilder? mediaQueryBuilder, Iterable<LocalizationsDelegate> ? localizationsDelegates, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], List<NavigatorObserver> observers = const [], ContextGetBuilder? contextGetBuilder, SystemUiOverlayStyle? systemUiOverlayStyle, LifeCycleCallback? lifeCycleCallback, ScrollBehavior? scrollBehavior})
Properties
- contextGetBuilder → ContextGetBuilder?
-
项目widget.build时构建器
final
- failedPage → Widget
-
错误页
当跳转路由失败的时候
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- homeName → String
-
首页名称
默认为"/"
即Navigator.defaultRouteName
final
- lifeCycleCallback → LifeCycleCallback?
-
监听APP的生命周期回调
final
- localeResolutionCallback → LocaleResolutionCallback?
-
区域分辨回调
当传入的是不支持的语种,可以根据这个回调,返回相近,并且支持的语种
final
-
localizationsDelegates
→ Iterable<
LocalizationsDelegate> ? -
-------- 多语言相关 --------
本地化委托
本地化委托,用于更改Flutter Widget默认的提示语,按钮text等
final
- mediaQueryBuilder → MediaQueryBuilder?
-
媒体查询解析类
可以设置一些统一的配置
textScaleFactor 构建树内部字体倍数 1.0 - 不随系统设置改变
final
-
observers
→ List<
NavigatorObserver> -
导航代理
final
-
routers
→ Map<
String, PageBuilder> -
返回命名路由表
key为路由名称,value为路由对应的页面
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBehavior → ScrollBehavior?
-
描述Scrollable小部件的行为方式
默认使用
NotGlowingMaterialScrollBehaviorfinal -
supportedLocales
→ Iterable<
Locale> -
支持区域,传入支持的语种数组
final
- systemUiOverlayStyle → SystemUiOverlayStyle?
-
系统UI
final
- theme → ThemeData
-
APP主题
final
- title → String
-
App 快照描述
Android: 标题出现在任务管理器的应用程序快照上方,当用户按下“最近的应用程序”按钮时会显示这些快照
iOS: 无效
final
- transitionBuilder → TransitionBuilder?
-
Widget构造器
用于在Navigator上方插入小部件的构建器
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited