I have some outdated parts in my main.dart, i would like to update them, but need a little help because my knowledge is apparently insufficient, hope someone can help me :-)
in this part the snack bar is out of date, as you can see in the message.
'showSnackBar' is deprecated and shouldn't be used. Use ScaffoldMessenger.showSnackBar. This feature was deprecated after v1.23.0-14.0.pre..
This is the associated code of my main.dart
Navigator.of(context, rootNavigator: true).pop('dialog');
Magazin.scaffoldKey.currentState!.showSnackBar(SnackBar(
content: Text('BEIM LADEN DER POST-DATEN IST EIN FEHLER AUFGETRETEN!'),
duration: Duration(seconds: 5),
));
I found this therad here in the forum but it didn't really help me ... 'showSnackBar' is deprecated and shouldn't be used
you can use this code .if rest of your code work currently this code doesn't have any problem
Navigator.of(context, rootNavigator: true).pop('dialog');
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content:Text('BEIM LADEN DER POST-DATEN IST EIN FEHLER AUFGETRETEN!'),
duration: Duration(seconds: 2),
),
);