JunnysoftApp class

dev_kit 默认应用壳。

统一挂载本地化、路由、Provider、ISpect 面板、全局错误处理和主题配置。

Inheritance
Available extensions

Constructors

JunnysoftApp({Key? key, required String appName, List<DraggablePanelButtonItem> consolePanelButtons = const <DraggablePanelButtonItem>[], bool debugShowCheckedModeBanner = true, Widget? home, Iterable<LocalizationsDelegate<Object>>? localizationsDelegates, VoidCallback? onInit, RouteFactory? onGenerateRoute, List<SingleChildWidget>? providers, Map<String, WidgetBuilder>? routes, ThemeData? theme, ThemeData? darkTheme, ThemeMode? themeMode, Iterable<Locale>? supportedLocales})
创建 dev_kit 默认应用壳。
const

Properties

appName String
应用名称
final
consolePanelButtons List<DraggablePanelButtonItem>
控制台面板按钮
final
darkTheme ThemeData?
夜间模式主题数据
final
debugShowCheckedModeBanner bool
是否展示debug标签
final
hashCode int
The hash code for this object.
no setterinherited
home Widget?
启动页
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
localizationsDelegates Iterable<LocalizationsDelegate<Object>>?
默认配置的语言包
final
onGenerateRoute RouteFactory?
路由生成器
final
onInit VoidCallback?
需要初始化的内容
final
providers List<SingleChildWidget>?
全局的provider
final
routes Map<String, WidgetBuilder>?
自定义route路径
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLocales Iterable<Locale>?
默认支持的语言类型
final
theme ThemeData?
主题数据
final
themeMode ThemeMode?
主题模式(light/dark/system) 默认为 null,跟随系统主题
final

Methods

buildPageRoute<T>({RouteSettings? settings, bool maintainState = true, bool fullscreenDialog = false, bool opaque = true}) PageRoute<T>

Available on Widget, provided by the JunnyWidgetExtension extension

构建PageRoute
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<JunnysoftApp>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

restart([BuildContext? context]) bool
软重启应用(重建 MaterialApp 子树,重置导航栈)