Skip to content

Commit

Permalink
feat: Change background to white
Browse files Browse the repository at this point in the history
  • Loading branch information
witwash committed Feb 7, 2024
1 parent 98c2600 commit f56bfb1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class RouterAwareStory extends Story {
name: name,
wrapperBuilder: (context, child) => child as Widget,
builder: (context) => MaterialApp.router(
theme: ThemeData.light(),
theme: ThemeData.light()
.copyWith(scaffoldBackgroundColor: Colors.white),
darkTheme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
routerDelegate: router.delegate(initialRoutes: initialRoutes),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Widget _buildWrapper(BuildContext context, Widget? child) =>
child: Row(
children: [
Material(
color: Colors.transparent,
child: DecoratedBox(
decoration: const BoxDecoration(
border: Border(right: BorderSide(color: Colors.black12)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Widget _buildStoryWrapper(BuildContext context, Widget? child) {
: SizedBox(
width: double.infinity,
child: Material(
color: Colors.transparent,
child: SafeArea(
bottom: false,
child: Padding(
Expand Down
1 change: 1 addition & 0 deletions packages/storybook_flutter/lib/src/plugins/knobs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Widget _buildWrapper(BuildContext context, Widget? child) =>
Expanded(child: child ?? const SizedBox.shrink()),
RepaintBoundary(
child: Material(
color: Colors.transparent,
child: DecoratedBox(
decoration: const BoxDecoration(
border: Border(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class _PluginPanelState extends State<PluginPanel> {
onGenerateRoute: (_) => MaterialPageRoute<void>(
builder: (context) => PointerInterceptor(
child: Material(
color: Colors.transparent,
child: childBuilder(context),
),
),
Expand Down
14 changes: 8 additions & 6 deletions packages/storybook_flutter/lib/src/storybook.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:storybook_flutter/src/story.dart';

/// Use this wrapper to wrap each story into a [MaterialApp] widget.
Widget materialWrapper(BuildContext _, Widget? child) => MaterialApp(
theme: ThemeData.light(),
theme: ThemeData.light().copyWith(scaffoldBackgroundColor: Colors.white),
darkTheme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
home: Scaffold(body: Center(child: child)),
Expand Down Expand Up @@ -94,9 +94,7 @@ class _StorybookState extends State<Storybook> {
);

return GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
onTap: FocusManager.instance.primaryFocus?.unfocus,
child: MediaQuery.fromView(
view: View.of(context),
child: Nested(
Expand All @@ -106,7 +104,7 @@ class _StorybookState extends State<Storybook> {
...widget.plugins
.map((p) => p.wrapperBuilder)
.whereType<TransitionBuilder>()
.map((builder) => SingleChildBuilder(builder: builder))
.map((builder) => SingleChildBuilder(builder: builder)),
],
child: widget.showPanel
? Stack(
Expand All @@ -117,6 +115,7 @@ class _StorybookState extends State<Storybook> {
Expanded(child: currentStory),
RepaintBoundary(
child: Material(
color: Colors.transparent,
child: SafeArea(
top: false,
child: CompositedTransformTarget(
Expand Down Expand Up @@ -167,7 +166,10 @@ class CurrentStory extends StatelessWidget {
if (story == null) {
return const Directionality(
textDirection: TextDirection.ltr,
child: Material(child: Center(child: Text('Select story'))),
child: Material(
color: Colors.transparent,
child: Center(child: Text('Select story')),
),
);
}

Expand Down

0 comments on commit f56bfb1

Please sign in to comment.