Skip to content

Commit

Permalink
chore: Replace builder with home.
Browse files Browse the repository at this point in the history
  • Loading branch information
coire1 committed May 6, 2024
1 parent 6351156 commit 56901ec
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ part 'brand_state.dart';
/// child: BlocBuilder<BrandBloc, BrandState>(
/// builder: (context, state) {
/// return MaterialApp(
/// builder: (context, state) => Scaffold(
/// body: Row(
/// children: [
/// MaterialButton(
/// color: Theme.of(context).primaryColor,
/// onPressed: () {
/// context.read<BrandBloc>().add(
/// const BrandChangedEvent(BrandKey.catalyst),
/// );
/// },
/// child: const Text('Switch to Catalyst Theme'),
/// ),
/// ],
/// home: Builder(
/// builder: (context) => Scaffold(
/// body: Row(
/// children: [
/// MaterialButton(
/// color: Theme.of(context).primaryColor,
/// onPressed: () {
/// context.read<BrandBloc>().add(
/// const BrandChangedEvent(BrandKey.catalyst),
/// );
/// },
/// child: const Text('Switch to Catalyst Theme'),
/// ),
/// ],
/// ),
/// ),
/// ),
/// theme: ThemeBuilder.buildTheme(state.brandKey),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,32 @@ void main() {
child: BlocBuilder<BrandBloc, BrandState>(
builder: (context, state) {
return MaterialApp(
builder: (context, state) => Scaffold(
body: Row(
children: [
MaterialButton(
key: catalystKey,
color: Theme.of(context).primaryColor,
onPressed: () {
context.read<BrandBloc>().add(
const BrandChangedEvent(BrandKey.catalyst),
);
},
child: const Text('Catalyst'),
),
MaterialButton(
key: dummyKey,
color: Theme.of(context).primaryColor,
child: const Text('Dummy'),
onPressed: () {
context.read<BrandBloc>().add(
const BrandChangedEvent(BrandKey.dummy),
);
},
),
],
home: Builder(
builder: (context) => Scaffold(
body: Row(
children: [
MaterialButton(
key: catalystKey,
color: Theme.of(context).primaryColor,
onPressed: () {
context.read<BrandBloc>().add(
const BrandChangedEvent(BrandKey.catalyst),
);
},
child: const Text('Catalyst'),
),
MaterialButton(
key: dummyKey,
color: Theme.of(context).primaryColor,
child: const Text('Dummy'),
onPressed: () {
context.read<BrandBloc>().add(
const BrandChangedEvent(BrandKey.dummy),
);
},
),
],
),
),
),
theme: ThemeBuilder.buildTheme(state.brandKey),
Expand Down

0 comments on commit 56901ec

Please sign in to comment.