AppInitializer class

应用基础初始化器 负责 Flutter 框架层面的基础初始化 这些初始化逻辑是通用的,可以在不同项目中复用

Constructors

AppInitializer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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

Static Methods

configureDebugPrint() → void
配置 debugPrint 输出 确保在 iOS 调试时也能看到日志输出 WHY: iOS 上 debugPrint 默认输出可能被 Xcode 过滤,需要配置以确保可见性
ensureFlutterBinding() → void
初始化 Flutter 绑定 确保在调用任何 Flutter 功能之前完成绑定初始化
initialize() Future<void>
执行所有基础初始化 按照依赖顺序执行各项初始化任务
setHighRefreshRate() Future<void>
设置高刷新率 在支持的设备上启用高刷新率显示
setScreenOrientation({List<DeviceOrientation> orientations = const [DeviceOrientation.portraitUp]}) Future<void>
设置屏幕方向 orientations 允许的屏幕方向列表