Android - CardForm wouldn't accept style on light themed app
See original GitHub issueDescribe the bug
Using CardForm element on android, when having the app on light theme (Theme.MaterialComponents.Light.NoActionBar
), when using the app on a device using dark mode the input text will stay white, making it invisible.
adding a black background only for this form is of course not an option, since it will not go with the rest of the app.
we cannot look into the source code of the elements used, so changing them to fit the app design is also not an option.
how can we tap into the style of those components?
To Reproduce Steps to reproduce the behavior:
- Add the library to your app like advised in the library readme file.
- Add material components to the app main style
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
- Add card form element to your component :
<CardForm onFormComplete={card => { }} style={{ height: Platform.OS === "ios" ? 200 : 300, }} cardStyle={{}} />
- run the app on android device being set to dark mode.
Expected behavior The component will catch the main theme to be “light” and accordingly, use light theme color, with no regards to the device dark/light mode.
Screenshots
This is how it looks in iOS : (expected behaviour)
this is how it looks in android:
Smartphone (please complete the following information):
- Device: Galaxy S20
- OS: android 11
- Browser NA
- Version NA
PS: I couldn’t find any documentation on how to tackle design on this component. if you can reference me please to a documentation on the matter, so I can make the android styling more matching to our app style, that would be greatly helpful
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:7
Similar issue on iOS but vice versa. When the phone is set to a dark theme, the text and placeholders are not visible.
we observe the same on the flutter_stripe library. There is no way to configure the text color at the moment. Would be great to have this fixed since the widget is quite difficult to use now.