flutterflutter-theme

How to change the keyboard color to dark on Android in Flutter?


My app uses dark theme as

ThemeData.dark().copyWith( ... ),

that defined for theme property of MaterialApp.

Since the keyboardAppearance property only works on iOS, it doesn't seem to be possible to do the same on Android. Or is there a way to do this?


Solution

  • in terms of docs, this functionality doesn't exist for android, unfortunately. This only works for ios:https://api.flutter.dev/flutter/material/TextField/keyboardAppearance.html

    And also there is an issue opened on GitHub about that: https://github.com/flutter/flutter/issues/75521

    This explains that we can't make a decision in terms of the keyboard's theme from an app. The keyboard is a standalone application, and it's up to the keyboard to decide which theme it would take. It could have been implemented to follow the device's dark mode settings (e.g. Samsung Galaxy's default keyboard), or it could just provide its own settings to change themes dynamically.