Skip to content

Difficulty with Settings().onStringChanged #24

@SubutaDan

Description

@SubutaDan

Hello,

I am enjoying working with shared_preferences_settings. Thanks for making it available.

I have run into a possible issue when using the example code in my app for the first time after uninstalling the app (which flushes its storage) and then reinstalling it. I encounter a failed assertion in the Settings().onStringChanged example, apparently because "value" is null when the screen is being drawn. If I hack a non-null value in for "value" like this:

 childBuilder: (BuildContext context, String value) {
            //return Text(value);
            return Text("Gleeb");
          }

and hot reload then the problem goes away. If I revert the hack and hot reload again, the problem reappears.

Note that I have commented out the provider and auth_provider imports as they appear to be unused.

Can you suggest what I might be doing wrong or let me know how to resolve this?

Thanks.

-Dan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions