configureCustomHeader method

Future configureCustomHeader({
  1. String? buttonColorHex,
  2. String? iconColorHex,
  3. String? fontColorHex,
})

Implementation

Future<dynamic> configureCustomHeader({
  String? buttonColorHex,
  String? iconColorHex,
  String? fontColorHex,
}) async {
  Map<String, dynamic> params = {};
  if (buttonColorHex != null) params['buttonColor'] = buttonColorHex;
  if (iconColorHex != null) params['iconColor'] = iconColorHex;
  if (fontColorHex != null) params['fontColor'] = fontColorHex;

  if (params.isEmpty) {
    throw Exception("At least one parameter is required");
  }

  try {
    channel.invokeMethod(
      "configureCustomHeader",
      params,
    );

    return true;
  } catch (_) {
    return null;
  }
}