import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; // SharedPreferences sharedPref = new SharedPreferences(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } AppSharedPreferences sharedPref = new AppSharedPreferences(); const String GET_SHARED_RECORD_BY_STATUS = '/Authentication.svc/REST/GetAllSharedRecordsByStatus'; class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; dynamic authenticatedUser; Future getSharedRecordByStatus() async { try { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); request.status = 0; await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; }, body: request.toJson()); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); } catch (error) { print(error); throw error; } } }