setConfig method

  1. @override
Future<bool> setConfig({
  1. required String appId,
  2. required String appSecret,
  3. required String serverAppId,
  4. required String serverEncodingKey,
  5. required String serverToken,
  6. required int companyId,
  7. required bool isAgreePrivacy,
  8. String? serverUrl,
})
override

Implementation

@override
Future<bool> setConfig(
    {required String appId,
    required String appSecret,
    required String serverAppId,
    required String serverEncodingKey,
    required String serverToken,
    required int companyId,
    required bool isAgreePrivacy,
    String? serverUrl}) async {
  Map<String, dynamic> config = {
    if (serverUrl != null) 'serverUrl': serverUrl,
    "appId": appId,
    "appSecret": appSecret,
    "serverAppId": serverAppId,
    "serverEncodingKey": serverEncodingKey,
    "serverToken": serverToken,
    "companyId": companyId,
    "isAgreePrivacy": isAgreePrivacy
  };
  config.removeWhere((key, value) => value == null);
  final result = await methodChannel.invokeMethod<bool>('setConfig', config);
  return result ?? false;
}