You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.1 KiB
Dart
39 lines
1.1 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:doctor_app_flutter/client/app_client.dart';
|
|
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
class HospitalProvider with ChangeNotifier {
|
|
Future<Map> getProjectsList() async {
|
|
const url = GET_PROJECTS;
|
|
var info = {
|
|
"LanguageID": 2,
|
|
"stamp": "2020-02-26T13:51:44.111Z",
|
|
"IPAdress": "11.11.11.11",
|
|
"VersionID": 1.2,
|
|
"Channel": 9,
|
|
"TokenID": "",
|
|
"SessionID": "i1UJwCTSqt",
|
|
"IsLoginForDoctorApp": true
|
|
};
|
|
// try {
|
|
// final response = await AppClient.post(url, body: json.encode(info));
|
|
// return Future.value(json.decode(response.body));
|
|
// } catch (error) {
|
|
// throw error;
|
|
// // print('error');
|
|
// }
|
|
|
|
await BaseAppClient.post(url,
|
|
onSuccess: ( response, statusCode) {
|
|
return Future.value(response);
|
|
},
|
|
onFailure: (String error, int statusCode) {
|
|
throw error;
|
|
},
|
|
body: info);
|
|
}
|
|
}
|