Describe the bug
Giving a ButtonStyle to either Button or FilledButton does not have any effect on descendent Text widgets. It is also not applied if the ButtonStyle is defined in the app's top-level theme data.
I have encountered this behavior on fluent_ui v4.15.1 and v4.13.0
To Reproduce
Here is a minimally-reproduceable code sample.
import 'package:fluent_ui/fluent_ui.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return FluentApp(
home: ScaffoldPage(
content: Center(
child: FilledButton(
style: ButtonStyle(
textStyle: WidgetStatePropertyAll(TextStyle(color: Colors.black)),
),
onPressed: () {},
child: const Text('Press Me'),
),
),
),
);
}
}
In this example, I would expect the button's text to be black, but it stays the default color of white.
Expected behavior
I expect to be able to give my app's top-level theme data a ButtonStyle with a specified ButtonStyle.textStyle that is applied to the buttons' descendent text. This bug prevents me from easily and consistently theming my app's buttons.
Describe the bug
Giving a ButtonStyle to either
ButtonorFilledButtondoes not have any effect on descendentTextwidgets. It is also not applied if the ButtonStyle is defined in the app's top-level theme data.I have encountered this behavior on
fluent_uiv4.15.1 and v4.13.0To Reproduce
Here is a minimally-reproduceable code sample.
In this example, I would expect the button's text to be black, but it stays the default color of white.
Expected behavior
I expect to be able to give my app's top-level theme data a
ButtonStylewith a specifiedButtonStyle.textStylethat is applied to the buttons' descendent text. This bug prevents me from easily and consistently theming my app's buttons.