The ButtonStyle.side property is a MaterialStateProperty<BorderSide> which can resolve to a non-default color for the disabled state. Here's an example that specifies the OutlinedButton's style directly. You could also specify an OutlinedButtonTheme.
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: OutlinedButton(
onPressed: null,
style: ButtonStyle(
side: MaterialStateProperty.resolveWith<BorderSide>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return BorderSide(width: 2, color: Colors.green);
}
return null; // defer to the default for OutlinedButton
}),
),
),
),
);
}
}
void main() {
runApp(MaterialApp(home: Home()));
}
Hi, people, Is there a way to specify the border color in "disabled" state of the new OutlinedButton in a theme specification? The text color is changing to grey without me doing anything specfic for the OutlinedButtonTheme