Search code examples
flutterflutter-providerflutter-streambuilder

Flutter Error: Instance member 'user' can't be accessed using static access


I/m facing this issue. Can anyone assist? Thanks First page

Second page. Both pages are shown below


Solution

  • In order to access a member via static access it needs to be marked as static like so:

    static final myStaticFinalVariable;
    

    Alternatively, you must instantiate the class first by creating an instance () to call an instance method.

    AuthService().user