Skip to content

Commit

Permalink
fix: replace Scaffold with ColoredBox (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoussefRaafatNasry committed Jun 28, 2023
1 parent 35681ed commit ee8f77d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/widgetbook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

- **FIX**: Replace the `Scaffold` around use-cases with a `ColoredBox` below the `Theme` widget. ([#789](https://github.com/widgetbook/widgetbook/pull/789))

## 3.0.0

Check out the [migration guide](https://docs.widgetbook.io/migration/2.4.0-to-3.0.0) for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class CupertinoThemeAddon extends ThemeAddon<CupertinoThemeData> {
themeBuilder: (context, theme, child) {
return CupertinoTheme(
data: theme,
child: child,
child: ColoredBox(
color: theme.scaffoldBackgroundColor,
child: child,
),
);
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ class MaterialThemeAddon extends ThemeAddon<ThemeData> {
themeBuilder: (context, theme, child) {
return Theme(
data: theme,
child: child,
child: ColoredBox(
color: theme.scaffoldBackgroundColor,
child: child,
),
);
},
);
Expand Down
14 changes: 6 additions & 8 deletions packages/widgetbook/lib/src/workbench/workbench.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ class Workbench extends StatelessWidget {
newSetting,
);
},
child: Scaffold(
body: UseCaseBuilder(
key: ValueKey(state.uri),
builder: (context) {
return WidgetbookState.of(context).useCase?.builder(context) ??
const SizedBox.shrink();
},
),
child: UseCaseBuilder(
key: ValueKey(state.uri),
builder: (context) {
return WidgetbookState.of(context).useCase?.builder(context) ??
const SizedBox.shrink();
},
),
),
),
Expand Down

0 comments on commit ee8f77d

Please sign in to comment.