Reputation: 521
I would like to change border color of OutlinedButton. Could you tell me how to do it?
OutlinedButton(
onPressed: null,
style: ButtonStyle(
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
),
),
child: const Text("Kontynuuj jako gość",
style: TextStyle(fontSize: 20, color: Color(0xffffffff)),
textAlign: TextAlign.center),
),
I tried Cannot change border color in OutlinedButton but it does not work.
Upvotes: 2
Views: 1846
Reputation: 3862
Specify side parameter of a ButtonStyle
ButtonStyle(
side: MaterialStateProperty.all(BorderSide(color: Colors.deepOrange)),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
side: BorderSide(color: Colors.deepOrange),
borderRadius: BorderRadius.circular(25.0),
),
),
)
Upvotes: 2
Reputation: 328
OutlinedButton(
onPressed: null,
style: OutlinedButton.styleFrom(
side: BorderSide(color: Colors.red, width: 5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25))),
child: const Text("Kontynuuj jako gość",
style: TextStyle(fontSize: 20, color: Color(0xffffffff)),
textAlign: TextAlign.center),
),
Upvotes: 2