Answers for "when click FLATbutton in flutter cHANGE COLOR"

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
2

flutter flotingactionbutton color

floatingActionButton: FloatingActionButton(
        child: const Icon(Icons.add),
        backgroundColor: Colors.pink,
        foregroundColor: Colors.black,
        splashColor: Colors.orange,
        focusColor: Colors.blue,
        hoverColor: Colors.red,
      ),
Posted by: Guest on August-20-2021

Code answers related to "when click FLATbutton in flutter cHANGE COLOR"

Browse Popular Code Answers by Language