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

provider: ^4.0.0 Flutter Performance refreshing #305

Closed
q876625596 opened this issue Dec 25, 2019 · 12 comments
Closed

provider: ^4.0.0 Flutter Performance refreshing #305

q876625596 opened this issue Dec 25, 2019 · 12 comments

Comments

@q876625596
Copy link

@q876625596 q876625596 commented Dec 25, 2019

After upgrading provider ^ 4.0.0, Flutter Performance keeps refreshing even without any operation.

@mono0926

This comment has been minimized.

Copy link

@mono0926 mono0926 commented Dec 25, 2019

I also confirmed this problem.
It is reproduced at https://github.com/rrousselGit/provider/tree/master/packages/provider/example, and I suspect that all applications which uses provider 4.0.0 are affected this problem.

There were no problems at version 3.2.0:
https://github.com/rrousselGit/provider/tree/v3.2.0/packages/provider/example

@rrousselGit

This comment has been minimized.

Copy link
Owner

@rrousselGit rrousselGit commented Dec 25, 2019

What are you talking about by performance keepks refreshing?

@mono0926

This comment has been minimized.

Copy link

@mono0926 mono0926 commented Dec 25, 2019

@rrousselGit

This refreshing started moving after upgrading to 4.0.0 on my project and example.

a

@q876625596

This comment has been minimized.

Copy link
Author

@q876625596 q876625596 commented Dec 25, 2019

您在谈论什么让性能刷新呢?

ChangeNotifierProvider.value(
      value: value,
      child: Consumer(
        builder: (BuildContext context, S data, Widget child) {
          return Container();
        },
      ),
    )

I just added this code and did nothing.

@isanimu

This comment has been minimized.

Copy link

@isanimu isanimu commented Dec 25, 2019

I also confirmed this.

Even with this simple code

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        StreamProvider<String>.value(
          value: Stream.empty(),
        ),
      ],
      child: MaterialApp(
        title: '',
        home: Container(),
      ),
    );
  }
}

Crazy high cpu usage by iOS Simulator.

ss

@rrousselGit

This comment has been minimized.

Copy link
Owner

@rrousselGit rrousselGit commented Dec 25, 2019

Ah that's actually a misuse of SchedulerBinding to infer if the listen flag of Provider.of

It's actually a fairly critical bug, and I'll have to disable that inference and make a hot-fix

@pqsky7

This comment has been minimized.

Copy link

@pqsky7 pqsky7 commented Dec 26, 2019

I still have this issue after changing the .yaml file to 'provider: ^4.0.0-hotfix.1' , is this the proper way to get the updates?

@rrousselGit

This comment has been minimized.

Copy link
Owner

@rrousselGit rrousselGit commented Dec 26, 2019

Make sure you ran pub get and that the lock file correctly says it uses the hot fix version

@pqsky7

This comment has been minimized.

Copy link

@pqsky7 pqsky7 commented Dec 26, 2019

Make sure you ran pub get and that the lock file correctly says it uses the hot fix version

it worked, many thx

@isanimu

This comment has been minimized.

Copy link

@isanimu isanimu commented Dec 28, 2019

@pqsky7

I still have this issue after changing the .yaml file to 'provider: ^4.0.0-hotfix.1' , is this the proper way to get the updates?

Something like this should work. Once the newest version is released you can remove the overrides.

dependencies:
  provider: ^4.0.0

dependency_overrides:
  provider: 4.0.0-hotfix.1
@rrousselGit

This comment has been minimized.

Copy link
Owner

@rrousselGit rrousselGit commented Dec 28, 2019

A 4.0.1 is coming in a matter of minutes.

Which means ^4.0.0 will properly get the new version

@eggzotic

This comment has been minimized.

Copy link

@eggzotic eggzotic commented Jan 1, 2020

Great thx - was hunting down the cause of this issue for last few days also. Really killed my dev env when running 2 emulators. Provider had always behaved so well before this. Great to have it back to normal again :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.