Provider: context.read<MyModel>() : The method 'read' isn't defined for the type 'BuildContext'.

Created on 17 May 2020  Â·  2Comments  Â·  Source: rrousselGit/provider

Hello,

I need some help i dont underdstand why the method read cant be called !

Error : The method 'read' isn't defined for the type 'BuildContext'.

I followed the sample here provider sample but in my code it gives me the error shown.

Thanks.

Most helpful comment

You need to use provider 4.1.0 and import provider

On Sun, May 17, 2020, 10:34 SamBe.ng notifications@github.com wrote:

Hello,

I need some help i dont underdstand why the method read cant be called !

Error : The method 'read' isn't defined for the type 'BuildContext'.

I followed the sample here provider sample
https://github.com/rrousselGit/provider/blob/master/example/lib/main.dart
but in my code it gives me the error shown.

Thanks.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rrousselGit/provider/issues/454, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEZ3I3KKLPBFL6VIFJDUMLTRR6VS5ANCNFSM4NDJVKEA
.

All 2 comments

You need to use provider 4.1.0 and import provider

On Sun, May 17, 2020, 10:34 SamBe.ng notifications@github.com wrote:

Hello,

I need some help i dont underdstand why the method read cant be called !

Error : The method 'read' isn't defined for the type 'BuildContext'.

I followed the sample here provider sample
https://github.com/rrousselGit/provider/blob/master/example/lib/main.dart
but in my code it gives me the error shown.

Thanks.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rrousselGit/provider/issues/454, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEZ3I3KKLPBFL6VIFJDUMLTRR6VS5ANCNFSM4NDJVKEA
.

Awesome and thanks for replying so fast ! u are awesome bro and thanks for the library it is an amazing tool !!

Was this page helpful?
0 / 5 - 0 ratings