setNavigationBarColor method

Future<void> setNavigationBarColor(
  1. {String? hexColor,
  2. double? red,
  3. double? green,
  4. double? blue,
  5. double? alpha}
)

Implementation

Future<void> setNavigationBarColor(
    {String? hexColor,
    double? red,
    double? green,
    double? blue,
    double? alpha}) async {
  if (Platform.isAndroid) {
    try {
      await _channel.invokeMethod('setNavigationBarColor', <String, dynamic>{
        'navColor': hexColor,
      });
    } catch (e) {
      print(e.toString());
    }
  } else if (Platform.isIOS) {
    try {
      await _channel.invokeMethod('setNavigationBarColor', <String, dynamic>{
        'red': red,
        'green': green,
        'blue': blue,
        'alpha': alpha
      });
    } catch (e) {
      print(e.toString());
    }
  }
}