getStringForKey static method

Future<String?> getStringForKey(
  1. String variableKey,
  2. String defaultValue
)

Returns the String value for the variableKey.

defaultValue is the the value returned in case user has not become a part of campaign/variation.

Implementation

static Future<String?> getStringForKey(
    String variableKey, String defaultValue) async {
  try {
    Map<String, dynamic> arguments = <String, dynamic>{
      "variableKey": variableKey,
      "defaultValue": defaultValue
    };

    final String stringValue =
        await _channel.invokeMethod('stringForKey', arguments);
    return stringValue;
  } catch (e) {
    print(e);
    return null;
  }
}