configureIconsCenter method

Future configureIconsCenter({
  1. String? buttonColorHex,
  2. String? iconColorHex,
  3. String? fontColorHex,
  4. String? fontMessageColorHex,
})

Implementation

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

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

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

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