Skip to content

Commit

Permalink
⚡ Add support to override localization delegates (#12)
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
DavidRG13 committed Jun 22, 2020
1 parent 95b0992 commit 2485d20
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/src/storybook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Storybook extends StatelessWidget {
Key key,
this.children = const [],
this.theme,
this.localizationDelegates
}) : super(key: key);

/// Theme override
Expand All @@ -47,11 +48,15 @@ class Storybook extends StatelessWidget {
/// Stories in the storybook.
final List<Story> children;

/// Localizations Delegates override
final List<LocalizationsDelegate> localizationDelegates;

@override
Widget build(BuildContext context) => Provider.value(
value: children,
child: MaterialApp(
theme: theme ?? Theme.of(context),
localizationsDelegates: localizationDelegates,
onGenerateRoute: (settings) => StoryRoute(
settings: settings,
builder: (_) => StoryPageWrapper(
Expand Down

0 comments on commit 2485d20

Please sign in to comment.