Ad

Not Able To Run Stripe_sdk Example In Flutter

I am trying to run the stripe_sdk dependency with flutter and using firebase. But I am getting build error while running the example of the sdk. Below are the error details. How should I resolve it?

../lib/src/ui/screens/payment_methods_screen.dart:151:39: Error: The getter 'ScaffoldMessenger' isn't defined for the class 'PaymentMethodsList'.

  • 'PaymentMethodsList' is from 'package:stripe_sdk/src/ui/screens/payment_methods_screen.dart' ('../lib/src/ui/screens/payment_methods_screen.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'ScaffoldMessenger'. ScaffoldMessenger.of(rootContext).showSnackBar(SnackBar( ^^^^^^^^^^^^^^^^^
Ad

Answer

According to document https://flutter.dev/docs/release/breaking-changes/scaffold-messenger
ScaffoldMessenger Landed in version: 1.23.0-13.0.pre In stable release: not yet

current release version is 1.22.5 , 12/11/2020
You can do

flutter channel master
flutter upgrade
Ad
source: stackoverflow.com
Ad