Open vgavrilovikj opened 4 months ago
@vgavrilovikj
Does this fix the problem? https://github.com/mono0926/adaptive_dialog?tab=readme-ov-file#the-input-text-color-same-with-backgound-when-using-cupertinotextinputdialog
@mono0926 But it's effect for whole project. How to custom only DialogTextField? Sorry for my bad English.
@devnta
You can change the theme partially like this: https://github.com/mono0926/adaptive_dialog/blob/382f98164d081bbf9e76895aef001ef5c25f8dcf/example/lib/pages/alert_page.dart#L130-L142
@mono0926 Thanks for your reply. I will try it and report the result.
@mono0926
final result = await showTextInputDialog(
context: context,
textFields: [
DialogTextField(
hintText: LocaleKeys.enter_bmi_value.tr(),
)
],
builder: (context, child) {
return 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,
textTheme: CupertinoTextThemeData(
textStyle: TextStyle(
color: Colors.white,
),
),
),
),
child: child,
);
},
);
Not work in dark theme
I have the same issue.
Here's my code for the textinputdialog:
This works great - however when the app is in dark mode it shows black text on a black background - I want to change the color of the text of the DialogTextField, the initialText to be white and hintText to have lightgray color...
How can I achieve this?
P.S. Would be good to add some more documentation regarding the package and it's configutations