koukibadr / Cherry-Toast

https://pub.dev/packages/cherry_toast
MIT License
21 stars 14 forks source link

method 'addpostframecallback' cannot be called on 'widgetsbinding?' because it is potentially null. #30

Open IhabZaidi opened 1 year ago

IhabZaidi commented 1 year ago

Just a quick mark for who will face this issue When you install the package at first time you may face this issue "error: method 'addpostframecallback' cannot be called on 'widgetsbinding?' because it is potentially null.... bla bla". to solve this issue you need to make change in the file named "cherrytoast.dart" in the line 370 from this : `WidgetsBinding.instance.addPostFrameCallback(() { to this : WidgetsBinding.instance?.addPostFrameCallback((_) { // as you can see we need to add ? mark here` save the file and now you good to go. happy coding

Flutter version : 2.10.3

koukibadr commented 1 year ago

@IhabZaidi a new version has been published you can update your dependencies