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

AppLifeCycleState, no constant named suspending #19

Closed
nyck33 opened this issue Nov 7, 2021 · 2 comments
Closed

AppLifeCycleState, no constant named suspending #19

nyck33 opened this issue Nov 7, 2021 · 2 comments

Comments

@nyck33
Copy link
Contributor

nyck33 commented Nov 7, 2021

There's no constant named 'suspending' in 'AppLifecycleState'.
Try correcting the name to the name of an existing constant, or defining a constant named 'suspending'.

counter example main.dart
line 116

///Handle app lifecycle events, almost the same as [update] function
Upd<Model, Message> lifeCycleUpdate(AppLifecycleState appState, Model model) {
  switch (appState) {
    case AppLifecycleState.inactive:
    case AppLifecycleState.paused:
    case AppLifecycleState.suspending:
    //case AppLifecycleState.detached:
      return Upd(model.copyWith(autoIncrement: false));
    case AppLifecycleState.resumed:
    default:
      return Upd(model);
  }
}

I'm going to try replacing suspending with detached but please let me know what you think.

@nyck33
Copy link
Contributor Author

nyck33 commented Nov 7, 2021

Also in the same counter example main.dart
line 137 or 138

body: Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Text(
            '${model.counter}',
            style: Theme.of(context).textTheme.headline1, //display1,
          ),
          Padding(
            child: RaisedButton.icon(
              label: Text('Increment'),
              icon: Icon(Icons.add),
              onPressed:
.
.
.

I guess display1 is outdated so I changed to headline1

@p69
Copy link
Owner

p69 commented Nov 8, 2021

@nyck33 Thanks for the bringing it up.
Yes, AppLifecycleState.suspending should be replaced with AppLifecycleState.detached and display1 -> headline1.
Please open a PR if you don't mind.

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

2 participants