Answers for "flutter button style"

3

text button flutter style

TextButton(
	child: Text('Text'),
    style: TextButton.styleFrom(primary: Colors.blue),
    onPressed: () {
    	print('Pressed');
    },
)
Posted by: Guest on June-08-2021
1

flutter button style

ElevatedButton(
  style: ButtonStyle(
    backgroundColor: MaterialStateProperty.resolveWith<Color>(
      (Set<MaterialState> states) {
        if (states.contains(MaterialState.pressed))
          return Theme.of(context).colorScheme.primary.withOpacity(0.5);
        return null; // Use the component's default.
      },
    ),
  ),
)
Posted by: Guest on April-21-2021

Browse Popular Code Answers by Language