userProfile method

  1. @override
Future<Map<String, dynamic>> userProfile(
  1. String token
)
override

Implementation

@override
Future<Map<String, dynamic>> userProfile(String token) async {
  try {
    final raw = await methodChannel.invokeMethod<String>('userProfile', {
      "token": token,
    });
    if (raw != null) {
      // final map = jsonDecode(raw);
      // return map;
      return {
        "fullName": raw,
      };
    }
    throw Exception("user not found");
  } on PlatformException catch (e) {
    throw Exception(e.toString());
  } catch (e) {
    throw Exception("raw data parse failed: ${e.toString()}");
  }
}