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.
		
		
		
		
		
			
		
			
				
	
	
		
			36 lines
		
	
	
		
			956 B
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			36 lines
		
	
	
		
			956 B
		
	
	
	
		
			Dart
		
	
import 'dart:convert';
 | 
						|
 | 
						|
import 'package:flutter/cupertino.dart';
 | 
						|
import 'package:http/http.dart' as http;
 | 
						|
 | 
						|
const GET_PROJECTS =
 | 
						|
    'https://hmgwebservices.com/Services/Lists.svc/REST/GetProjectForDoctorAPP';
 | 
						|
 | 
						|
class ProjectsProvider with ChangeNotifier {
 | 
						|
  Future<Map> getProjectsList() async {
 | 
						|
    Map<String, String> requestHeaders = {
 | 
						|
      'Content-type': 'application/json',
 | 
						|
      'Accept': 'application/json',
 | 
						|
    };
 | 
						|
    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 http.post(url,
 | 
						|
          headers: requestHeaders, body: json.encode(info));
 | 
						|
      return Future.value(json.decode(response.body));
 | 
						|
    } catch (error) {
 | 
						|
      throw error;
 | 
						|
      // print('error');
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |