Output Screenshot:
SOLUTION
TextButton(
child: Text('test'),
style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
onPressed: () {},
),
TextButton( style: TextButton.styleFrom(backgroundColor: Colors.red), ),
TextButton(
onPressed: () {},
child: Container(
padding: EdgeInsets.fromLTRB(30, 10, 30, 10),
color: Colors.red,
child: Text(""),
),
)
TextButton(
child: Text('Example'),
onPressed: () {},
style: TextButton.styleFrom(backgroundColor: Colors.red),
)
Full Summary:
style: ButtonStyle--backgroundColor: MaterialStateProperty.all
TextButton.styleFrom
TextButton--Container
TextButton---TextButton.styleFrom
Refrence
Click here
Oldest comments (0)