what are the parameters for elevated button widget

Viewed 37

Please I'm getting errors under the parameters I used for my 'ElevatedButton' ....Need help please

child: ElevatedButton(
            elevation: 5.0,
            color: mainColor,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(30.0),
            ),
2 Answers

ElevatedButton required parameter are onPressed and child and you can use ElevatedButton as:

 ElevatedButton(
                onPressed: () {},
                child: Text('Elevated Button'),
                style: ElevatedButton.styleFrom(
                  elevation: 5.0,
                  primary: Colors.red,
                  shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(30.0),
                  ),
                ),
              ),
Related