Skip to content

Commit

Permalink
Handle supported locales properties (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Klingsbo <[email protected]>
  • Loading branch information
martinfrouin and spydon authored Feb 26, 2024
1 parent 9ebe0ad commit 8c30a87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/widgets/widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Dashbook extends StatefulWidget {
final bool autoPinStoriesOnLargeScreen;
final GlobalKey<NavigatorState>? navigatorKey;
final List<LocalizationsDelegate<dynamic>>? localizationsDelegates;
final List<Locale> supportedLocales;

/// Called whenever a new chapter is selected.
final OnChapterChange? onChapterChange;
Expand All @@ -65,6 +66,7 @@ class Dashbook extends StatefulWidget {
this.navigatorKey,
this.onChapterChange,
this.localizationsDelegates,
this.supportedLocales = const <Locale>[Locale('en', 'US')],
}) : _dualTheme = null,
_multiTheme = null,
super(key: key);
Expand All @@ -80,6 +82,7 @@ class Dashbook extends StatefulWidget {
this.navigatorKey,
this.onChapterChange,
this.localizationsDelegates,
this.supportedLocales = const <Locale>[Locale('en', 'US')],
}) : _dualTheme = _DashbookDualTheme(
dark: dark,
light: light,
Expand All @@ -99,6 +102,7 @@ class Dashbook extends StatefulWidget {
this.navigatorKey,
this.onChapterChange,
this.localizationsDelegates,
this.supportedLocales = const <Locale>[Locale('en', 'US')],
}) : _multiTheme =
_DashbookMultiTheme(themes: themes, initialTheme: initialTheme),
theme = null,
Expand Down Expand Up @@ -208,6 +212,7 @@ class _DashbookState extends State<Dashbook> {
title: widget.title,
theme: _currentTheme,
localizationsDelegates: widget.localizationsDelegates,
supportedLocales: widget.supportedLocales,
onGenerateRoute: (settings) {
return MaterialPageRoute<void>(
builder: (context) {
Expand Down

0 comments on commit 8c30a87

Please sign in to comment.