|
|
|
|
@ -19,18 +19,24 @@ class ServiceReportAssistantsEmployeeProvider extends ChangeNotifier {
|
|
|
|
|
// like 400 customer request failed
|
|
|
|
|
// 500 service not available
|
|
|
|
|
int _stateCode;
|
|
|
|
|
|
|
|
|
|
int get stateCode => _stateCode;
|
|
|
|
|
|
|
|
|
|
set setStateCode(int statusCode) => _stateCode = statusCode;
|
|
|
|
|
|
|
|
|
|
// contain user data
|
|
|
|
|
// when user not login or register _user = null
|
|
|
|
|
List<AssistantEmployees> _assistantEmployees;
|
|
|
|
|
|
|
|
|
|
List<AssistantEmployees> get assistantEmployees => _assistantEmployees;
|
|
|
|
|
|
|
|
|
|
// when categories in-process _loading = true
|
|
|
|
|
// done _loading = true
|
|
|
|
|
// failed _loading = false
|
|
|
|
|
bool _loading;
|
|
|
|
|
|
|
|
|
|
bool get isLoading => _loading;
|
|
|
|
|
|
|
|
|
|
set isLoading(bool isLoading) {
|
|
|
|
|
_loading = isLoading;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
@ -41,14 +47,14 @@ class ServiceReportAssistantsEmployeeProvider extends ChangeNotifier {
|
|
|
|
|
/// return state code if request complete may be 200, 404 or 403
|
|
|
|
|
/// for more details check http state manager
|
|
|
|
|
/// lib\controllers\http_status_manger\http_status_manger.dart
|
|
|
|
|
Future<int> getAssistantEmployees() async {
|
|
|
|
|
Future<int> getAssistantEmployees(num assetId) async {
|
|
|
|
|
if (_loading == true) return -2;
|
|
|
|
|
_loading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
Response response;
|
|
|
|
|
try {
|
|
|
|
|
response = await ApiManager.instance.get(
|
|
|
|
|
"${URLs.getEngineers}",
|
|
|
|
|
"${URLs.getEngineers}&assetId=$assetId",
|
|
|
|
|
);
|
|
|
|
|
// response = await get(
|
|
|
|
|
// Uri.parse(
|
|
|
|
|
|