CKApp class

High-level Material app wrapper that automatically applies CKCoreUI themes.

CKApp is a drop-in replacement for MaterialApp that handles theme resolution based on the specified brand and system brightness.

Example:

CKApp(
  brand: ckcoreBrand.castleKeep,
  home: HomePage(),
  title: 'My App',
)

For routing solutions like GoRouter, use CKApp.router:

CKApp.router(
  brand: ckcoreBrand.castleKeep,
  routerConfig: goRouter,
)
Inheritance

Constructors

CKApp({required ckcoreBrand brand, Key? key, Brightness? brightness, bool responsive = false, GlobalKey<NavigatorState>? navigatorKey, Widget? home, Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{}, String? initialRoute, RouteFactory? onGenerateRoute, RouteFactory? onUnknownRoute, List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[], TransitionBuilder? builder, String title = '', GenerateAppTitle? onGenerateTitle, Color? color, ThemeData? theme, ThemeData? darkTheme, ThemeData? highContrastTheme, ThemeData? highContrastDarkTheme, ThemeMode themeMode = ThemeMode.system, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<LogicalKeySet, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, String? restorationScopeId, ScrollBehavior? scrollBehavior, bool useInheritedMediaQuery = false})
Creates a CKApp.
const
CKApp.delegate({required ckcoreBrand brand, required RouterDelegate<Object> routerDelegate, required RouteInformationParser<Object> routeInformationParser, RouteInformationProvider? routeInformationProvider, Key? key, Brightness? brightness, bool responsive = false, TransitionBuilder? builder, String title = '', GenerateAppTitle? onGenerateTitle, Color? color, ThemeData? theme, ThemeData? darkTheme, ThemeData? highContrastTheme, ThemeData? highContrastDarkTheme, ThemeMode themeMode = ThemeMode.system, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<LogicalKeySet, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, String? restorationScopeId, ScrollBehavior? scrollBehavior, bool useInheritedMediaQuery = false})
Creates a CKApp for routing scenarios using separate router components.
const
CKApp.router({required ckcoreBrand brand, required RouterConfig<Object> routerConfig, Key? key, Brightness? brightness, bool responsive = false, TransitionBuilder? builder, String title = '', GenerateAppTitle? onGenerateTitle, Color? color, ThemeData? theme, ThemeData? darkTheme, ThemeData? highContrastTheme, ThemeData? highContrastDarkTheme, ThemeMode themeMode = ThemeMode.system, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<LogicalKeySet, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, String? restorationScopeId, ScrollBehavior? scrollBehavior, bool useInheritedMediaQuery = false})
Creates a CKApp for routing scenarios.
const

Properties

actions → Map<Type, Action<Intent>>?
See MaterialApp.actions.
final
brand → ckcoreBrand
The design system brand to use for automatic theme generation.
final
brightness → Brightness?
Optional brightness override. If not specified, follows system brightness.
final
builder → TransitionBuilder?
See MaterialApp.builder.
final
checkerboardOffscreenLayers → bool
See MaterialApp.checkerboardOffscreenLayers.
final
checkerboardRasterCacheImages → bool
See MaterialApp.checkerboardRasterCacheImages.
final
color → Color?
See MaterialApp.color.
final
darkTheme → ThemeData?
Optional dark theme override. If not provided, auto-generated from brand.
final
debugShowCheckedModeBanner → bool
See MaterialApp.debugShowCheckedModeBanner.
final
debugShowMaterialGrid → bool
See MaterialApp.debugShowMaterialGrid.
final
hashCode → int
The hash code for this object.
no setterinherited
highContrastDarkTheme → ThemeData?
See MaterialApp.highContrastDarkTheme.
final
highContrastTheme → ThemeData?
See MaterialApp.highContrastTheme.
final
home → Widget?
See MaterialApp.home.
final
initialRoute → String?
See MaterialApp.initialRoute.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale → Locale?
See MaterialApp.locale.
final
localeListResolutionCallback → LocaleListResolutionCallback?
See MaterialApp.localeListResolutionCallback.
final
localeResolutionCallback → LocaleResolutionCallback?
See MaterialApp.localeResolutionCallback.
final
localizationsDelegates → Iterable<LocalizationsDelegate>?
See MaterialApp.localizationsDelegates.
final
See MaterialApp.navigatorKey.
final
See MaterialApp.navigatorObservers.
final
onGenerateRoute → RouteFactory?
See MaterialApp.onGenerateRoute.
final
onGenerateTitle → GenerateAppTitle?
See MaterialApp.onGenerateTitle.
final
onUnknownRoute → RouteFactory?
See MaterialApp.onUnknownRoute.
final
responsive → bool
Whether to wrap the app in a responsive layout provider.
final
restorationScopeId → String?
See MaterialApp.restorationScopeId.
final
routes → Map<String, WidgetBuilder>
See MaterialApp.routes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior → ScrollBehavior?
See MaterialApp.scrollBehavior.
final
shortcuts → Map<LogicalKeySet, Intent>?
See MaterialApp.shortcuts.
final
showPerformanceOverlay → bool
See MaterialApp.showPerformanceOverlay.
final
showSemanticsDebugger → bool
See MaterialApp.showSemanticsDebugger.
final
supportedLocales → Iterable<Locale>
See MaterialApp.supportedLocales.
final
theme → ThemeData?
Optional theme override. If not provided, auto-generated from brand.
final
themeMode → ThemeMode
See MaterialApp.themeMode.
final
title → String
See MaterialApp.title.
final
useInheritedMediaQuery → bool
See MaterialApp.useInheritedMediaQuery.
final

Methods

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