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.
35 lines
995 B
Dart
35 lines
995 B
Dart
import 'dart:convert';
|
|
|
|
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 =
|
|
'https://hmgwebservices.com/Services/Lists.svc/REST/GetProjectForDoctorAPP';
|
|
|
|
class ProjectsProvider 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');
|
|
}
|
|
}
|
|
}
|