Skip to content

Commit

Permalink
Merge pull request #27 from fdeoliveirasantos/exposes-l10n-related-pr…
Browse files Browse the repository at this point in the history
…operties

exposes l10n-related properties
  • Loading branch information
Josiassejod1 authored Dec 8, 2023
2 parents 6070705 + 0ce378f commit 3703f33
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/src/flutterbook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class FlutterBook extends StatefulWidget {
/// dropdown will appear in the editor tabs.
final List<FlutterBookTheme>? themes;

final Locale? locale;
final Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates;
final LocaleListResolutionCallback? localeListResolutionCallback;
final LocaleResolutionCallback? localeResolutionCallback;
final Iterable<Locale>? supportedLocales;

const FlutterBook({
Key? key,
required this.categories,
Expand All @@ -49,6 +55,11 @@ class FlutterBook extends StatefulWidget {
this.header,
this.headerPadding = const EdgeInsets.fromLTRB(20, 16, 20, 8),
this.themes,
this.locale,
this.localizationsDelegates,
this.localeListResolutionCallback,
this.localeResolutionCallback,
this.supportedLocales,
}) : super(key: key);

@override
Expand Down Expand Up @@ -99,6 +110,12 @@ class _FlutterBookState extends State<FlutterBook> {
title: 'Flutterbook',
debugShowCheckedModeBanner: false,
theme: activeTheme,
locale: widget.locale,
localizationsDelegates: widget.localizationsDelegates,
localeListResolutionCallback: widget.localeListResolutionCallback,
localeResolutionCallback: widget.localeResolutionCallback,
supportedLocales:
widget.supportedLocales ?? const <Locale>[Locale('en', 'US')],
builder: (context, child) {
return StyledScaffold(
body: Row(
Expand Down

0 comments on commit 3703f33

Please sign in to comment.