From 8c30a87d4c0d03bff96db35899a88f41dd2f3240 Mon Sep 17 00:00:00 2001 From: Martin Frouin Date: Mon, 26 Feb 2024 10:15:10 +0100 Subject: [PATCH] Handle supported locales properties (#107) Co-authored-by: Lukas Klingsbo --- lib/src/widgets/widget.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/widgets/widget.dart b/lib/src/widgets/widget.dart index cf4db37..ff3494b 100644 --- a/lib/src/widgets/widget.dart +++ b/lib/src/widgets/widget.dart @@ -52,6 +52,7 @@ class Dashbook extends StatefulWidget { final bool autoPinStoriesOnLargeScreen; final GlobalKey? navigatorKey; final List>? localizationsDelegates; + final List supportedLocales; /// Called whenever a new chapter is selected. final OnChapterChange? onChapterChange; @@ -65,6 +66,7 @@ class Dashbook extends StatefulWidget { this.navigatorKey, this.onChapterChange, this.localizationsDelegates, + this.supportedLocales = const [Locale('en', 'US')], }) : _dualTheme = null, _multiTheme = null, super(key: key); @@ -80,6 +82,7 @@ class Dashbook extends StatefulWidget { this.navigatorKey, this.onChapterChange, this.localizationsDelegates, + this.supportedLocales = const [Locale('en', 'US')], }) : _dualTheme = _DashbookDualTheme( dark: dark, light: light, @@ -99,6 +102,7 @@ class Dashbook extends StatefulWidget { this.navigatorKey, this.onChapterChange, this.localizationsDelegates, + this.supportedLocales = const [Locale('en', 'US')], }) : _multiTheme = _DashbookMultiTheme(themes: themes, initialTheme: initialTheme), theme = null, @@ -208,6 +212,7 @@ class _DashbookState extends State { title: widget.title, theme: _currentTheme, localizationsDelegates: widget.localizationsDelegates, + supportedLocales: widget.supportedLocales, onGenerateRoute: (settings) { return MaterialPageRoute( builder: (context) {