import 'dart:convert';

import 'package:http/http.dart';

import '../../../Model/Response/Admintoken/Admintokenresponse.dart';

class GetAdminTokenProvider{

  Future<GetAdminToken?> getAdminToken(String urldata,) async {
    GetAdminToken? getAdminToken;
    try {

      final url = Uri.parse('$urldata');

      final response = await get(url, headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json',
      });
      print('GetAdminToken!!!!!!!!${response.body}');
      print('GetAdminTokenproviderurldata!!!!!!!!${urldata.toString()}');
      Map<String, dynamic> parsedJson = json.decode(response.body.toString());

      getAdminToken = GetAdminToken.fromJson(parsedJson);

    } catch (e) {
      print(e.toString());
      print('printinerrorcatch${e.toString()}');
      print("error");
    }
    return getAdminToken;
  }

}