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

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll 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