register method

Future<String> register(
  1. Map<String, dynamic> json
)

Implementation

Future<String> register(Map<String, dynamic> json) async {
  Response resp = await _userProvider.register(json);
  dynamic body = resp.body;
  final prefs = GetStorage();

  dynamic convertBody = convertUtf8ToObject(body);
  ServerRespDto serverRespDto = ServerRespDto.fromJson(convertBody);

  if (serverRespDto.code == 1) {
    Map<String, dynamic> data = serverRespDto.data;
    prefs.write("beacon_id", data["beacon_id"]);
  } else {}

  return serverRespDto.msg;
}