second commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart';
|
||||
import '../../../Model/Response/Getcustomerbynumber/Getcustomerbynumberresponse.dart';
|
||||
|
||||
class GetCustomersByNumberProvider{
|
||||
|
||||
Future<GetCustomerByNumber?> getCustomerByNumber(String urldata,) async {
|
||||
GetCustomerByNumber? getCustomerByNumber;
|
||||
try {
|
||||
|
||||
final url = Uri.parse('$urldata');
|
||||
|
||||
final response = await get(url, headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
// 'Authorization': '$token',
|
||||
});
|
||||
print('getCustomerByNumber!!!!!!!!${response.body}');
|
||||
print('getCustomerByNumberproviderurldata!!!!!!!!${urldata.toString()}');
|
||||
Map<String, dynamic> parsedJson = json.decode(response.body.toString());
|
||||
|
||||
getCustomerByNumber = GetCustomerByNumber.fromJson(parsedJson);
|
||||
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
print("error");
|
||||
}
|
||||
return getCustomerByNumber;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user