Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashbook.dualTheme() doesn't assign any value to the variable theme #90

Open
bahag-desouzacastror opened this issue Aug 29, 2022 · 0 comments

Comments

@bahag-desouzacastror
Copy link

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),
              ),

Screenshot 2022-08-29 at 17 02 01

You can see in the printscreen that the private variable _dualTheme exists with both themes assigned, but the variable theme remains unassigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant