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

Set up provider in the app #19

Open
Samaritan1011001 opened this issue Feb 11, 2021 · 2 comments
Open

Set up provider in the app #19

Samaritan1011001 opened this issue Feb 11, 2021 · 2 comments

Comments

@Samaritan1011001
Copy link
Owner

Samaritan1011001 commented Feb 11, 2021

Following the managers/helpers/model architecture, add initial provider set up to the app

https://blog.codemagic.io/flutter-tutorial-app-arhitecture-beginners/
https://pub.dev/packages/provider
https://flutter.dev/docs/development/data-and-backend/state-mgmt/simple

@Amein-Eskinder
Copy link

hey @Samaritan1011001 can you look at this, i've been stuck here for a while https://t.co/T3yVelwSff?amp=1

@Samaritan1011001
Copy link
Owner Author

Samaritan1011001 commented Feb 11, 2021

@muhammed-amein I don't have enough reputation on SO to comment on the question so I'll ask here.
You have two MaterialApps. May I ask why?

You can try giving the Provider to the ListTile instead of in the beginning like this

ChangeNotifierProvider(
      create: (context)=>AppData(),
      child: ListTile(
        leading: Icon(Icons.local_taxi_outlined),
        title: Text("My Gooshs".tr().toString()),
        onTap: () {
          Navigator.push(context,
              MaterialPageRoute(builder: (context) => HistoryScreen()));
        },
      ),
    )

Also, you can use a simple Provider instead of MultiProvider since you only have one Provider to pass on.

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