Change default text color of CupertinoAlertDialog to theme primary color (#111785)
This commit is contained in:
@@ -1713,7 +1713,7 @@ class CupertinoDialogAction extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
TextStyle style = _kCupertinoDialogActionStyle.copyWith(
|
||||
color: CupertinoDynamicColor.resolve(
|
||||
isDestructiveAction ? CupertinoColors.systemRed : CupertinoColors.systemBlue,
|
||||
isDestructiveAction ? CupertinoColors.systemRed : CupertinoTheme.of(context).primaryColor,
|
||||
context,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -125,6 +125,23 @@ void main() {
|
||||
expect(widget.style.color!.withAlpha(255), CupertinoColors.systemRed.color);
|
||||
});
|
||||
|
||||
testWidgets('Dialog default action style', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
CupertinoTheme(
|
||||
data: const CupertinoThemeData(
|
||||
primaryColor: CupertinoColors.systemGreen,
|
||||
),
|
||||
child: boilerplate(const CupertinoDialogAction(
|
||||
child: Text('Ok'),
|
||||
)),
|
||||
),
|
||||
);
|
||||
|
||||
final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle));
|
||||
|
||||
expect(widget.style.color!.withAlpha(255), CupertinoColors.systemGreen.color);
|
||||
});
|
||||
|
||||
testWidgets('Dialog dark theme', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
CupertinoApp(
|
||||
|
||||
Reference in New Issue
Block a user