createShortLink method

  1. @override
Future<Map<String, dynamic>?> createShortLink({
  1. required String longLink,
  2. String name = "",
  3. String shortLinkId = "",
})
override

Implementation

@override
Future<Map<String, dynamic>?> createShortLink(
    {required String longLink,
    String name = "",
    String shortLinkId = ""}) async {
  try {
    final result = await methodChannel.invokeMethod<Map>('createShortLink', {
      'longLink': longLink,
      'name': name,
      'shortLinkId': shortLinkId,
    });
    Map<String, dynamic> data = {};
    if (result != null) {
      result.forEach((key, value) {
        if (key is String) {
          data[key] = value;
        }
      });
    }
    return data;
  } catch (e) {
    // //print(e);
  }
  return null;
}