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
Paystack null safety version is not initializing on flutter 2 #95
Comments
Hi @Codesait can you add a snippet of how you're calling the plugin? A runnable snippet will help. |
@Codesait can you add a full widget that I can run? Also, include the part where you call the plugin to make payment. |
@Wilburt I have the same error too! |
@Anyitechs can you add a runnable snippet of how you're calling the plugin? |
@Wilburt Okay, give me a second. |
`import 'package:flutter_paystack/flutter_paystack.dart'; .........../// final GlobalKey scaffoldKey = new GlobalKey(); @OverRide String getReference() { ///paystack payment Map accessCode = await createAccessCode( setState(() { // _closeBottomSheet2(); Charge charge = Charge()
} on TimeoutException catch () { @OverRide GestureDetector( |
@Wilburt Please note that I'm using the It will be nice if you can update the |
@Anyitechs I will advise you to bump flutter_paystack to the latest version and override the troublesome dependency as I am waiting on johnpryan/tripledes-dart#14 to support Flutter 2 for rave_flutter. |
I had to look deep into the package code before I concluded that the error was not from the package. What worked for me is to put an
@Wilburt I think this detail should be added in the documentation on pub.dev and the Github |
@benjaminudoh10 It is not possible to await in I tried this and it worked:
Make sure you always call the same instance of the plugin. Incase you need to run an await in the |
Still getting the same error. Using flutter_paystack: ^1.0.5+1 final plugin = PaystackPlugin(); @OverRide |
This has been fixed. Update to the latest version and reopen this issue if the problem persists. |
E/flutter (23171): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Paystack SDK has not been initialized. The SDK has to be initialized before use
E/flutter (23171): #0 PaystackPlugin._validateSdkInitialized (package:flutter_paystack/src/common/paystack.dart:143:7)
E/flutter (23171): #1 PaystackPlugin.publicKey (package:flutter_paystack/src/common/paystack.dart:61:5)
E/flutter (23171): #2 PaystackPlugin.checkout (package:flutter_paystack/src/common/paystack.dart:130:22)
E/flutter (23171): #3 payStackPay (package:proptor/payment_methods/payStack.dart:41:44)
E/flutter (23171): #4 _PaymentMethodsState.build... (package:proptor/screens/payment_methods.dart:167:48)
E/flutter (23171): #5 _rootRun (dart:async/zone.dart:1346:47)
E/flutter (23171): #6 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (23171): #7 _FutureListener.handleWhenComplete (dart:async/future_impl.dart:176:18)
E/flutter (23171): #8 Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:674:39)
E/flutter (23171): #9 Future._propagateToListeners (dart:async/future_impl.dart:730:37)
E/flutter (23171): #10 Future._completeWithValue (dart:async/future_impl.dart:539:5)
E/flutter (23171): #11 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:577:7)
E/flutter (23171): #12 _rootRun (dart:async/zone.dart:1354:13)
E/flutter (23171): #13 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (23171): #14 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter (23171): #15 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1202:23)
E/flutter (23171): #16 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (23171): #17 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
E/flutter (23171):
The text was updated successfully, but these errors were encountered: