Flutter, Try correcting the name of an existing method, or defining a method named flat button, raised button

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Error:

Try correcting to the name of an existing method, or defining a method named ‘OutlineButton’ in flutter 3.0.0. it isn’t defined for the type

Solution 1:

Yes. That is a breaking change. And it is listed up top in the breaking changes documentation:

The FlatButton, RaisedButton and OutlineButton widgets have been replaced by TextButton, ElevatedButton, and OutlinedButtonrespectively.

source

Flutter – The method ‘forEach’ isn’t defined for the type, The method ‘forEach’ isn’t defined for the type ‘Object’. Try correcting the name to the name of an existing method, or defining a method named ‘forEach’. The method isn’t defined for the type class. 0. Agora local view showing blank screen on Flutter. 0.
Try correcting the name to the name of an existing method, or defining a method named ‘configure’
Question:
I got this error when I try to run flutter app.
The method ‘configure’ isn’t defined for the type ‘FirebaseMessaging’. Try correcting the name to the name of an existing method, or defining a method named ‘configure’.

Solution 2:

That widget have been changed to OutlinedButton .

Old Widget was : OutlineButton
Old Theme was : ButtonTheme
New Widget is : OutlinedButton
New Theme is : OutlinedButtonTheme
Here’s an example :

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x