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.
doctor_app_flutter/lib/providers/hospital_provider.dart

42 lines
1.1 KiB
Dart

import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import '../interceptor/http_interceptor.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
const GET_PROJECTS = BASE_URL + 'Lists.svc/REST/GetProjectForDoctorAPP';
class HospitalProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
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 client.post(url, body: json.encode(info));
return Future.value(json.decode(response.body));
} catch (error) {
throw error;
// print('error');
}
}
}