storefaces static method

Future<UserStore> storefaces(
  1. String name,
  2. List facelist
)

Implementation

static Future<UserStore> storefaces(String name, List facelist) async {
  final params = {
    "Face_data": {"username": name, "password": "123", "facedata": facelist}
  };

  String token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVmlyZW5kcmEgc2hpbHBrYXIiLCJhZ2VudElEIjoiNjM4NDU1YzA1ZjEyYzI3OWZlMThlMzQ2Iiwib3JnSUQiOiI2Mzg0NTFkMjVmMTJjMjc5ZmUxOGUyZDEiLCJ1c2VybmFtZSI6InZpcmVuZHJhQGdtYWlsLmNvbSIsImlhdCI6MTY4MzU0MDM4NH0.yMiYAuzVO102VanUvO04u9RJiYzyDluDtGFEPcsM1tY";

  http.Response responce = await http.post(
      Uri.parse("http://43.205.35.164:5000/v1/DID/Store_Face_Data"),
      headers: {
        "Content-Type": "application/json",
        "Authorization": "Bearer $token"
      },
      body: json.encode(params));
  // print('state'+params.toString());
  // print('statestore'+responce.body);

  if (responce.statusCode == 200) {
    var data = jsonDecode(responce.body);
    UserStore user = UserStore.fromJson(data);
    return user;
  } else {
    var data = jsonDecode(responce.body);
    UserStore user = UserStore.fromJson(data);
    return user;
  }
}