Not able to run stripe_sdk example in flutter

181

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
Share:
181
Admin
Author by

Admin

Updated on December 27, 2022

Comments

  • Admin
    Admin over 1 year

    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( ^^^^^^^^^^^^^^^^^
  • Admin
    Admin over 3 years
    But will it run on android and iOS?
  • chunhunghan
    chunhunghan over 3 years
    Yes. ScaffoldMessenger is part of Flutter framework. it can run on Android and iOS
  • chunhunghan
    chunhunghan over 3 years
    you can use flutter doctor to check your current version
  • Admin
    Admin over 3 years
    But I won't be able to integrate with the flutter app build in flutter stable version. how should I do that? Because the app build in stable version won't run under master version for the same.
  • chunhunghan
    chunhunghan over 3 years
    @michaeljohnson, Need to reproduce, could you post minimum reproduce code to a new question and error message you encounter. to allow more people can help you.