auth method

Future<void> auth({
  1. required String email,
  2. required String password,
})

Implementation

Future<void> auth({required String email, required String password}) async {
  var res = await http.post(
    Uri.parse('$baseurl/auth/login'),
    headers: <String, String>{
      'Content-Type': 'application/json',
    },
    body: jsonEncode(<String, String>{"email": email, "password": password}),
  );

  var data = AuthRes.fromJson(jsonDecode(res.body));
  shiprocketToken = data.token;
}