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

The method 'RaisedButton' isn't defined for the class

lib/main.dart:90:15: Error: The getter ‘RaisedButton’ isn’t defined for the class ‘_girisState’.

  • ‘_girisState’ is from ‘package:flutterapp/main.dart’ (‘lib/main.dart’).
    Try correcting the name to the name of an existing getter, or defining a getter or field named ‘RaisedButton’.
    RaisedButton.icon(
    ^^^^^^^^^^^^
    lib/main.dart:99:15: Error: The method ‘RaisedButton’ isn’t defined for the class ‘_girisState’.
  • ‘_girisState’ is from ‘package:flutterapp/main.dart’ (‘lib/main.dart’).
    Try correcting the name to the name of an existing method, or defining a method named ‘RaisedButton’.
    RaisedButton(
    ^^^^^^^^^^^^

My code

              RaisedButton.icon(
                onPressed: () {
                  _handleSignIn();
                },
                color: Colors.blue,
                textColor: Colors.white,
                label: Text("Google Giris Yap"),
                icon: Icon(Icons.sentiment_very_satisfied),
              ),
              RaisedButton(
                child: Text("Daha Karpuz Kesecektik :("),
                color: Colors.blue,
                textColor: Colors.white,
                onPressed: () {
                  SystemChannels.platform.invokeMethod('SystemNavigator.pop');
                },

i think i should change the button but there’s a wrong with that, im not good with flutter can anyone help ?

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

i tried to change to elvated button but its didnt work

>Solution :

ElevatedButton don’t have exact same property as RaisedButton had.
But you can do everything which you were doing with RaisedButton like below

ElevatedButton(
        onPressed: () {
          _handleSignIn();
        },
       //Styles contains all the design related to button
        style: ButtonStyle(
          backgroundColor: MaterialStatePropertyAll(Colors.blue),
        ),
        //Child is basically what you want to display inside button It can be Text, Row, Column, or Icon.
        child: Row(
          children: const [
            Text("Google Giris Yap", style: TextStyle(color: Colors.white),),
            Icon(Icons.sentiment_very_satisfied),
          ],
        ),
      )
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