mono0926/adaptive_dialog

showConfirmationDialog doesn't apply AlertDialogAction.textStyle

JCKodel opened this issue · 3 comments

While showing a showConfirmationDialog and providing some AlertDialogAction to actions property, the textStyle is not applied (in Android or iOS styles).

Tried to copy textTheme from current theme (Theme.of(context)), tried TextStyle(fontSize: 8, color: Colors.green), nothing works.

For Android, the options are always black/white and bold (my intent was to remove the bold)

I also couldn't figure out how to change colors. Expecting OK button to be iOS-blue, and cancel to be red. Both are green(my primary color)
image

@mirkancal

It is not related to this issue.

It follows your theme, and you can also change like this:

builder: (context, child) => Theme(
data: ThemeData(
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Colors.orange,
),
),
// If this is commented out, the color for cupertino will be default blue/red.
cupertinoOverrideTheme: const CupertinoThemeData(
primaryColor: Colors.purple,
),
),
child: child,
),

If after making those adjustments you still cannot achieve what you intend, I recommend that you use the following API etc. directly without this package:
showCupertinoDialog function - cupertino library - Dart API

@mono0926 thank you, makes sense. I didn't realize it was using cupertino theme.