CoreKit class

The root widget for a CoreKit-powered Flutter app (standard navigator).

Drop-in replacement for MaterialApp that additionally bootstraps CkTransport, CkStorage, CkAuthService and responsive-screen scaling.

Use CoreKit.router when using a declarative routing package (go_router, etc.). Use CoreKit.builder when wrapping an existing MaterialApp.router.

Example:

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  final _nav = GlobalKey<NavigatorState>();
  @override
  Widget build(BuildContext context) => CoreKit(
    navigatorKey: _nav,
    config: AppConfig(),
    home: const HomeScreen(),
  );
}
Inheritance
Available extensions

Constructors

CoreKit({Key? key, required CoreKitConfig config, required GlobalKey<NavigatorState> navigatorKey, bool ensureScreenSize = true, ThemeData? theme, ThemeData? darkTheme, ThemeMode? themeMode, String title = '', String? restorationScopeId, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool showPerformanceOverlay = false, bool checkerboardOffscreenLayers = false, bool checkerboardRasterCacheImages = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Duration themeAnimationDuration = const Duration(milliseconds: 300), Curve themeAnimationCurve = Curves.easeInOut, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, bool debugShowMaterialGrid = false, Widget? home, Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{}, String? initialRoute, RouteFactory? onGenerateRoute, RouteFactory? onUnknownRoute, List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[], ScrollBehavior? scrollBehavior})
const
CoreKit.builder({Key? key, required CoreKitConfig config, required GlobalKey<NavigatorState> navigatorKey, required Widget app(CorkitInitBuilder builder)?, bool ensureScreenSize = true})
const
CoreKit.router({Key? key, required CoreKitConfig config, required RouterConfig<Object>? routerConfig, required GlobalKey<NavigatorState> navigatorKey, bool ensureScreenSize = true, ThemeData? theme, ThemeData? darkTheme, ThemeMode? themeMode, String title = '', String? restorationScopeId, ScrollBehavior? scrollBehavior, Locale? locale, Duration themeAnimationDuration = const Duration(milliseconds: 300), Curve themeAnimationCurve = Curves.easeInOut, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool showPerformanceOverlay = false, bool checkerboardOffscreenLayers = false, bool checkerboardRasterCacheImages = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, bool debugShowMaterialGrid = false})
const

Properties

actions → Map<Type, Action<Intent>>?
final
app → Widget Function(CorkitInitBuilder builder)?
final
center → Widget

Available on Widget, provided by the Alignments extension

no setter
checkerboardOffscreenLayers → bool
final
checkerboardRasterCacheImages → bool
final
config → CoreKitConfig
final
darkTheme → ThemeData?
final
debugShowCheckedModeBanner → bool
final
debugShowMaterialGrid → bool
final
end → Widget

Available on Widget, provided by the Alignments extension

no setter
ensureScreenSize → bool
final
hashCode → int
The hash code for this object.
no setterinherited
home → Widget?
final
initialRoute → String?
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale → Locale?
final
localeListResolutionCallback → LocaleListResolutionCallback?
final
localeResolutionCallback → LocaleResolutionCallback?
final
localizationsDelegates → Iterable<LocalizationsDelegate>?
final
marginZero → Widget

Available on Widget, provided by the WidgetMarginX extension

no setter
final
final
onGenerateRoute → RouteFactory?
final
onUnknownRoute → RouteFactory?
final
paddingZero → Widget

Available on Widget, provided by the WidgetPaddingX extension

no setter
restorationScopeId → String?
final
routerConfig → RouterConfig<Object>?
final
routes → Map<String, WidgetBuilder>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior → ScrollBehavior?
final
shortcuts → Map<ShortcutActivator, Intent>?
final
showPerformanceOverlay → bool
final
showSemanticsDebugger → bool
final
sliverBox → Widget

Available on Widget, provided by the WidgetSliverBoxX extension

no setter
start → Widget

Available on Widget, provided by the Alignments extension

no setter
supportedLocales → Iterable<Locale>
final
theme → ThemeData?
final
themeAnimationCurve → Curve
final
themeAnimationDuration → Duration
final
themeMode → ThemeMode?
final
title → String
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<CoreKit>
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
marginAll(double margin) → Widget

Available on Widget, provided by the WidgetMarginX extension

marginOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget

Available on Widget, provided by the WidgetMarginX extension

marginSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Widget

Available on Widget, provided by the WidgetMarginX extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paddingAll(double padding) → Widget

Available on Widget, provided by the WidgetPaddingX extension

paddingOnly({double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget

Available on Widget, provided by the WidgetPaddingX extension

paddingSymmetric({double horizontal = 0.0, double vertical = 0.0}) → Widget

Available on Widget, provided by the WidgetPaddingX extension

toAr(num width, num height) → Widget

Available on Widget, provided by the WidgetAspectRatio extension

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