Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

i have installed flutter 3.0.0 . now i am getting error that outlinedbutton isn’t defined for the type.
Error: Method not found: ‘OutlineButton’.
lib/appUtils/app_utility.dart:233

                            OutlineButton(
                            ^^^^^^^^^^^^^

: Error: Method not found: ‘OutlineButton’.
lib/appUtils/app_utility.dart:255
OutlineButton(

                            ^^^^^^^^^^^^^

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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 :

OutlinedButton(
    style: OutlinedButton.styleFrom(
        shape: StadiumBorder(),
            side: BorderSide(
              width: 2,
              color: Theme.of(context).colorScheme.primary,
            ),
        ),
    onPressed: () { dismissDialog(); },
    child: Text('New Outlined Button'),
),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading