-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Description
I'm trying to access the theme from dashbook and I started receiving null pointers. And them I realised that the constructor Dashbook.dualTheme doesn't assign any value to the variable theme.
This scenario works as expected
final dashbook = Dashbook(
theme: BahagTheme.light,
);
dashbook.storiesOf('Colors').decorator(CenterDecorator()).add(
'Foundation',
(context) => Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
Text(
'COLORS',
style: dashbook.theme!.textTheme.headline1!
.copyWith(fontSize: 28, color: Colors.black),
),
This scenario doesn't work as expected
final dashbook = Dashbook.dualTheme(
light: BahagTheme.light,
dark: BahagTheme.dark,
);
dashbook.storiesOf('Colors').decorator(CenterDecorator()).add(
'Foundation',
(context) => Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
Text(
'COLORS',
style: dashbook.theme!.textTheme.headline1!
.copyWith(fontSize: 28, color: Colors.black),
),You can see in the printscreen that the private variable _dualTheme exists with both themes assigned, but the variable theme remains unassigned.
Metadata
Metadata
Assignees
Labels
No labels
