KataglyphisAppShell<T> class

The application shell both Kataglyphis Flutter apps are built on.

It owns everything the two main.dart files used to duplicate line for line: the AnimationController/CurvedAnimation pair, the width-breakpoint block in didChangeDependencies, the four handle* callbacks, the theme pair, the localization delegate list and the FutureBuilder -> AppAttributes -> RoutesCreator -> MaterialApp.router tail. The apps keep only what genuinely differs: how they load their settings, and which app-owned types those settings turn into.

Three inconsistencies between the two copies were resolved here, once:

  • AppSettings.supportedLocales is null-checked rather than forced with !. AppSettings.fromJsonFile defaults a missing supportedLocales key to the empty list, so the bang was never the crash it looked like - it was an empty supportedLocales handed to MaterialApp and a RangeError one line later. fallbackLocales covers that case instead.
  • MaterialApp.locale follows the selected language index. Pinning it to the first supported locale (as OmniAccelerANT did) left the visible UI switching - Localizations.override inside this package's pages still worked - while onGenerateTitle stayed stuck on the first language, which made the language menu look half broken.
  • The failure screen is wrapped in a MaterialApp. A bare Material subtree has no Directionality above it at this point in the tree, so rendering one throws while trying to report the original error.
Inheritance

Constructors

KataglyphisAppShell({Key? key, required AppShellDataLoader<T> loadBootstrapData, required AppShellBindingBuilder<T> buildBinding, List<LocalizationsDelegate> appLocalizationsDelegates = const <LocalizationsDelegate<dynamic>>[], String fontFamily = kAppShellFontFamily, ThemeMode initialThemeMode = ThemeMode.dark, ColorSeed initialColorSeed = ColorSeed.baseColor, List<Locale> fallbackLocales = const <Locale>[Locale('en')], AppShellLoadingBuilder? loadingBuilder, AppShellErrorBuilder? errorBuilder})
const

Properties

appLocalizationsDelegates List<LocalizationsDelegate>
The app's own delegates - typically its generated AppLocalizations.
final
buildBinding AppShellBindingBuilder<T>
Turns the loaded data into an AppAttributes and a RoutesCreator.
final
errorBuilder AppShellErrorBuilder?
Overrides the default failure screen.
final
fallbackLocales List<Locale>
Used when AppSettings.supportedLocales is null or empty.
final
fontFamily String
Font family for both generated themes.
final
hashCode int
The hash code for this object.
no setterinherited
initialColorSeed ColorSeed
Seed colour before the user touches the colour menu.
final
initialThemeMode ThemeMode
Theme mode before the user touches the brightness switch.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadBootstrapData AppShellDataLoader<T>
Runs once, from initState.
final
loadingBuilder AppShellLoadingBuilder?
Overrides the default progress indicator.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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