Answers for "border color in textbutton in flutter"

4

textbutton background color flutter

// first way (most upvoted)
TextButton(
    child: Text('test'),
    style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.red)),
    onPressed: () {},
),

// second way 
TextButton(
  child: Text('Example'),
  onPressed: () {},
  style: TextButton.styleFrom(backgroundcolor: Colors.red),
)

// third way
TextButton(
  onPressed: () {},
  child: Container(
    padding: EdgeInsets.fromLTRB(30, 10, 30, 10),
    color: Colors.red,
    child: Text(""),
  ),
)
Posted by: Guest on June-15-2021
0

flutter border around textbutton

OutlinedButton(
  onPressed: null,
  style: ButtonStyle(
    shape: MaterialStateProperty.all(
      RoundedRectangleBorder(
      	borderRadius: BorderRadius.circular(30.0),
      )
	),
  ),
  child: const Text("Button text"),
);
Posted by: Guest on September-19-2021

Code answers related to "border color in textbutton in flutter"

Browse Popular Code Answers by Language