appServiceSign method

Future<ApperviceSignResponse> appServiceSign({
  1. required String message,
  2. required String address,
})
inherited

Implementation

Future<ApperviceSignResponse> appServiceSign(
    {required String message, required String address}) async {
  var url = Uri.parse(address);
  var body = jsonEncode({
    "message": "hello",
  });

  var headers = {'Content-Type': 'application/json'};

  print("body=$body");

  var responseB = await http.post(url, headers: headers, body: body);

  final responseBody = await responseB.bodyBytes;
  var response = utf8.decode(responseBody);

  print("response=$response");
  Map<String, dynamic> data = jsonDecode(response);
  return ApperviceSignResponse.fromJson(data as Map<String, dynamic>);
}