Open Samaritan1011001 opened 3 years ago
hey @Samaritan1011001 can you look at this, i've been stuck here for a while https://t.co/T3yVelwSff?amp=1
@muhammed-amein I don't have enough reputation on SO to comment on the question so I'll ask here.
You have two MaterialApp
s. 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.
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