code clean, unused files removed.
parent
002172ab87
commit
3ee2b66fbf
@ -0,0 +1,37 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
final libDir = Directory('lib');
|
||||||
|
if (!libDir.existsSync()) {
|
||||||
|
print('No lib/ directory found.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final dartFiles = libDir.listSync(recursive: true).whereType<File>().where((file) => file.path.endsWith('.dart')).toList();
|
||||||
|
|
||||||
|
final allContent = StringBuffer();
|
||||||
|
for (final file in dartFiles) {
|
||||||
|
allContent.write(await file.readAsString());
|
||||||
|
}
|
||||||
|
|
||||||
|
final unusedFiles = <String>[];
|
||||||
|
|
||||||
|
for (final file in dartFiles) {
|
||||||
|
final filename = file.uri.pathSegments.last;
|
||||||
|
final basename = filename.replaceAll('.dart', '');
|
||||||
|
|
||||||
|
if (!allContent.toString().contains(basename) && !allContent.toString().contains(filename)) {
|
||||||
|
unusedFiles.add(file.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unusedFiles.isEmpty) {
|
||||||
|
print('🎯 No unused files found!');
|
||||||
|
} else {
|
||||||
|
print('⚡️ Unused Dart files:${unusedFiles.length}');
|
||||||
|
|
||||||
|
for (int i=0; i<unusedFiles.length; i++) {
|
||||||
|
print('${i+1}- ${unusedFiles[i]}');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,123 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
// import 'package:test_sa/models/visits/ppm.dart';
|
|
||||||
// import 'package:test_sa/models/visits/ppm_search.dart';
|
|
||||||
// import 'package:test_sa/models/visits/visits_group.dart';
|
|
||||||
//
|
|
||||||
// class PreventiveMaintenanceVisitsProvider extends ChangeNotifier {
|
|
||||||
// // number of items call in each request
|
|
||||||
// final pageItemNumber = 10;
|
|
||||||
//
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// visits = null;
|
|
||||||
// nextPage = true;
|
|
||||||
// stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int stateCode;
|
|
||||||
//
|
|
||||||
// // true if there is next page in product list and false if not
|
|
||||||
// bool nextPage = true;
|
|
||||||
//
|
|
||||||
// // list of user requests
|
|
||||||
// List<Visit> visits;
|
|
||||||
//
|
|
||||||
// // when requests in-process _loading = true
|
|
||||||
// // done _loading = true
|
|
||||||
// // failed _loading = false
|
|
||||||
// bool isLoading;
|
|
||||||
//
|
|
||||||
// VisitsSearch visitsSearch = VisitsSearch();
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getVisits({
|
|
||||||
// required String host,
|
|
||||||
// required User user,
|
|
||||||
// // VisitsSearch visitsSearch,
|
|
||||||
// }) async {
|
|
||||||
// if (isLoading == true) return -2;
|
|
||||||
// isLoading = true;
|
|
||||||
// Response response;
|
|
||||||
// //userId = 397.toString(); // testing id to view data
|
|
||||||
// try {
|
|
||||||
// response = await get(
|
|
||||||
// Uri.parse(
|
|
||||||
// "${host + URLs.getPreventiveMaintenanceVisits}?uid=${user.id}&token=${user.token}&page=${(visits?.length ?? 0) ~/ pageItemNumber}${visitsSearch?.toMap()}",
|
|
||||||
// ),
|
|
||||||
// headers: {"Content-Type": "application/json; charset=utf-8"});
|
|
||||||
// } catch (error) {
|
|
||||||
// isLoading = false;
|
|
||||||
// stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List requestsListJson = json.decode(utf8.decode(response.bodyBytes));
|
|
||||||
// List<Visit> _visits = requestsListJson.map((request) => Visit.fromJson(request)).toList();
|
|
||||||
// visits ??= [];
|
|
||||||
// visits.addAll(_visits);
|
|
||||||
// if (_visits.length == pageItemNumber) {
|
|
||||||
// nextPage = true;
|
|
||||||
// } else {
|
|
||||||
// nextPage = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// isLoading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> updateGroupOfVisits({
|
|
||||||
// required String host,
|
|
||||||
// required User user,
|
|
||||||
// VisitsGroup group,
|
|
||||||
// }) async {
|
|
||||||
// Response response;
|
|
||||||
// Map<String, String> body = group.toJson();
|
|
||||||
// // body["token"] = user.token ?? "";
|
|
||||||
// // body["uid"] = user.id;
|
|
||||||
// //userId = 397.toString(); // testing id to view data
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.put(URLs.updatePreventiveMaintenanceVisits, body: body);
|
|
||||||
//
|
|
||||||
// stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// // group.visits.forEach((visit) {
|
|
||||||
// // visit.status = group.status;
|
|
||||||
// // visit.actualDate = group.date.toString().split(" ").first;
|
|
||||||
// // });
|
|
||||||
// group.ppms.clear();
|
|
||||||
// notifyListeners();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// isLoading = false;
|
|
||||||
// stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class AssignedToProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getEmployees,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class EngineersProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Employee> _items;
|
|
||||||
//
|
|
||||||
// List<Employee> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getEngineers,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body);
|
|
||||||
// _items = categoriesListJson.map((type) => Employee.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class GasCylinderSizesProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _loading = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({
|
|
||||||
// String host,
|
|
||||||
// User user,
|
|
||||||
// }) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getGasCylinderSize,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class GasCylinderTypesProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _loading = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({
|
|
||||||
// String host,
|
|
||||||
// User user,
|
|
||||||
// }) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getGasCylinderType,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class GasStatusProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _loading = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({
|
|
||||||
// String host,
|
|
||||||
// User user,
|
|
||||||
// }) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getGasStatus,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class GasTypesProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _loading = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({
|
|
||||||
// String host,
|
|
||||||
// User user,
|
|
||||||
// }) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getGasTypes,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class PentryStatusProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getPentryStatus,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List listJson = json.decode(response.body)["data"];
|
|
||||||
// _items = listJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class PentryTaskStatusProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getPentryTaskStatus,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _items = categoriesListJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class PentryVisitStatusProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getPentryVisitStatus,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List listJson = json.decode(response.body)["data"];
|
|
||||||
// _items = listJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestDefectTypesProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceReportDefectTypes,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List listJson = json.decode(response.body)["data"];
|
|
||||||
// _items = listJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// @Deprecated("Use the one inside lib/providers folder")
|
|
||||||
// class ServiceRequestPriorityProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _items = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _items;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _items;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceReportPriority,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List listJson = json.decode(response.body)["data"];
|
|
||||||
// _items = listJson.map((type) => Lookup.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
//
|
|
||||||
// class ServiceReportUsersProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _engineers = null;
|
|
||||||
// _loading = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Employee> _engineers;
|
|
||||||
//
|
|
||||||
// List<Employee> get engineers => _engineers;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getAllUsers() async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get("${URLs.getEngineers}");
|
|
||||||
// // response = await get(
|
|
||||||
// // Uri.parse(
|
|
||||||
// // URLs.getServiceReportLastCalls
|
|
||||||
// // +(serviceStatus == null ? "" : "?service_status=$serviceStatus")
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List usersListJson = json.decode(response.body);
|
|
||||||
// _engineers = usersListJson.map((type) => Employee.fromJson(type)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceFirstActionProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _statuses = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _statuses;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _statuses;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceFirstAction,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
|
|
||||||
/// Loan availability not required
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceLoanAvailabilityProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _statuses = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _statuses;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _statuses;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceLoanAvailability,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestStatusProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _statuses = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _statuses;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _statuses;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceRequestStatus,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestedThroughProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _statuses = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _statuses;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _statuses;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceRequestThrough,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Lookup getDefaultItem() {
|
|
||||||
// return items?.firstWhere((element) => element.name.toLowerCase().contains("app"));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,78 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/urls.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/user.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestTypeProvider extends ChangeNotifier {
|
|
||||||
// //reset provider data
|
|
||||||
// void reset() {
|
|
||||||
// _statuses = null;
|
|
||||||
// _stateCode = null;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // state code of current request to defied error message
|
|
||||||
// // like 400 customer request failed
|
|
||||||
// // 500 service not available
|
|
||||||
// int _stateCode;
|
|
||||||
//
|
|
||||||
// int get stateCode => _stateCode;
|
|
||||||
//
|
|
||||||
// // contain user data
|
|
||||||
// // when user not login or register _user = null
|
|
||||||
// List<Lookup> _statuses;
|
|
||||||
//
|
|
||||||
// List<Lookup> get items => _statuses;
|
|
||||||
//
|
|
||||||
// // 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();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// return -2 if request in progress
|
|
||||||
// /// return -1 if error happen when sending request
|
|
||||||
// /// 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> getData({String host, User user}) async {
|
|
||||||
// if (_loading == true) return -2;
|
|
||||||
// _loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(
|
|
||||||
// URLs.getServiceRequestTypes,
|
|
||||||
// );
|
|
||||||
// _stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// _statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
|
|
||||||
// }
|
|
||||||
// _loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// _loading = false;
|
|
||||||
// _stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Lookup getDefaultItem() {
|
|
||||||
// return items?.firstWhere((element) => element.name.toLowerCase().contains("maintenance"));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'asset.dart';
|
|
||||||
// import 'asset_transfer.dart';
|
|
||||||
//
|
|
||||||
// class AssetTransferSearch extends AssetTransfer {
|
|
||||||
// Asset asset;
|
|
||||||
// int pageNumber = 10, pageSize;
|
|
||||||
// bool mostRecent;
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toSearch() {
|
|
||||||
// final map = <String, dynamic>{};
|
|
||||||
// map['pageSize'] = pageSize;
|
|
||||||
// map['pageNumber'] = pageNumber;
|
|
||||||
// map['id'] = id;
|
|
||||||
// map['transferNo'] = transferNo;
|
|
||||||
// map['transferCode'] = transferCode;
|
|
||||||
// map['assetId'] = assetId;
|
|
||||||
// map['destSiteId'] = destSiteId;
|
|
||||||
// map['destBuildingId'] = destBuildingId;
|
|
||||||
// map['destFloorId'] = destFloorId;
|
|
||||||
// map['destDepartmentId'] = destDepartmentId;
|
|
||||||
// map['destRoomId'] = destRoomId;
|
|
||||||
// map['senderSiteId'] = senderSiteId;
|
|
||||||
// map['senderBuildingId'] = senderBuildingId;
|
|
||||||
// map['senderFloorId'] = senderFloorId;
|
|
||||||
// map['senderDepartmentId'] = senderDepartmentId;
|
|
||||||
// map['senderRoom'] = senderRoom;
|
|
||||||
// map['senderAssignedEmployeeId'] = senderAssignedEmployeeId;
|
|
||||||
// map['receiverAssignedEmployeeId'] = receiverAssignedEmployeeId;
|
|
||||||
// map['mostRecent'] = mostRecent;
|
|
||||||
// map['assetNumber'] = asset?.assetNumber;
|
|
||||||
// map['assetSerialNo'] = asset?.assetSerialNo;
|
|
||||||
// map['siteName'] = asset?.site?.custName;
|
|
||||||
//
|
|
||||||
// /// TODO : the below parameters need to be discussed
|
|
||||||
// // map['relatedToEmployeeId'] = "";
|
|
||||||
// // map['assetGroup'] = {
|
|
||||||
// // "id": 1,
|
|
||||||
// // "name": "",
|
|
||||||
// // "code": "",
|
|
||||||
// // };
|
|
||||||
// return map;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:io';
|
|
||||||
//
|
|
||||||
// import 'package:test_sa/models/department.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
//
|
|
||||||
// import '../timer_model.dart';
|
|
||||||
//
|
|
||||||
// @Deprecated("Use asset_transfer.dart instead of this one")
|
|
||||||
// class DeviceTransferInfo {
|
|
||||||
// String userId;
|
|
||||||
// String comment;
|
|
||||||
// Hospital client;
|
|
||||||
// Department department;
|
|
||||||
// String workingHours;
|
|
||||||
//
|
|
||||||
// // DateTime startDate;
|
|
||||||
// // DateTime endDate;
|
|
||||||
// String travelingHours;
|
|
||||||
// String userName;
|
|
||||||
// String engSignature;
|
|
||||||
// List<File> attachments;
|
|
||||||
// String assignedEmployeeName;
|
|
||||||
// Lookup status;
|
|
||||||
// TimerModel timer;
|
|
||||||
//
|
|
||||||
// DeviceTransferInfo({
|
|
||||||
// this.userId,
|
|
||||||
// this.comment,
|
|
||||||
// this.department,
|
|
||||||
// this.client,
|
|
||||||
// this.userName,
|
|
||||||
// this.travelingHours,
|
|
||||||
// // this.startDate,
|
|
||||||
// // this.endDate,
|
|
||||||
// this.workingHours,
|
|
||||||
// this.engSignature,
|
|
||||||
// this.status,
|
|
||||||
// this.assignedEmployeeName,
|
|
||||||
// this.timer,
|
|
||||||
// this.attachments,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// Map<String, String> toJson(bool isSender) {
|
|
||||||
// Map<String, String> body = {};
|
|
||||||
// final baseKey = isSender ? "sender_" : "receiver_";
|
|
||||||
//
|
|
||||||
// if (comment != null && comment.isNotEmpty) body["${baseKey}comment"] = comment;
|
|
||||||
// if (workingHours != null && workingHours.isNotEmpty) body["${baseKey}working_hours"] = workingHours;
|
|
||||||
// // if (startDate != null) body["${baseKey}start_date"] = startDate?.toIso8601String();
|
|
||||||
// // if (endDate != null) body["${baseKey}end_date"] = endDate?.toIso8601String();
|
|
||||||
// if (timer?.startAt != null) body["${baseKey}start_date"] = timer?.startAt?.toIso8601String();
|
|
||||||
// if (timer?.endAt != null) body["${baseKey}end_date"] = timer?.endAt?.toIso8601String();
|
|
||||||
// if (travelingHours != null && travelingHours.isNotEmpty) body["${baseKey}travel_hours"] = travelingHours;
|
|
||||||
// if (status != null) body["${baseKey}status"] = status.id.toString();
|
|
||||||
// if (engSignature != null && engSignature.isNotEmpty) body["${baseKey}image"] = engSignature;
|
|
||||||
// return body;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// bool validate() {
|
|
||||||
// if (client == null) return false;
|
|
||||||
// if (department == null) return false;
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// fromDetails(DeviceTransferInfo old, {bool withSignature = true}) {
|
|
||||||
// userId = old.userId;
|
|
||||||
// userName = old.userName;
|
|
||||||
// client = Hospital.fromHospital(old.client);
|
|
||||||
// department = Department.fromDepartment(old.department);
|
|
||||||
// workingHours = old.workingHours;
|
|
||||||
// attachments = old.attachments ?? [];
|
|
||||||
// // startDate = old.startDate;
|
|
||||||
// // endDate = old.endDate;
|
|
||||||
// timer = old.timer;
|
|
||||||
// travelingHours = old.travelingHours;
|
|
||||||
// comment = old.comment;
|
|
||||||
// if (withSignature) engSignature = old.engSignature;
|
|
||||||
// status = old.status;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // factory DeviceTransferInfo.fromJson(Map<String, dynamic> parsedJson, String key) {
|
|
||||||
// // return DeviceTransferInfo(
|
|
||||||
// // workingHours: parsedJson["${key}working_hours"],
|
|
||||||
// // // startDate: parsedJson["${key}start_date"],
|
|
||||||
// // // endDate: parsedJson["${key}end_date"],
|
|
||||||
// // timer: TimerModel(
|
|
||||||
// // startAt: DateTime.tryParse(parsedJson["${key}start_date"] ?? ""),
|
|
||||||
// // endAt: DateTime.tryParse(parsedJson["${key}end_date"] ?? ""),
|
|
||||||
// // durationInSecond: ((parsedJson["${key}working_hours"] ?? 0) * 60 * 60).toInt(),
|
|
||||||
// // ),
|
|
||||||
// // travelingHours: parsedJson["${key}travel_hours"],
|
|
||||||
// // userName: parsedJson["${key}name"],
|
|
||||||
// // signature: parsedJson["${key}image"],
|
|
||||||
// // userId: parsedJson["${key}id"],
|
|
||||||
// // comment: parsedJson["${key}comment"],
|
|
||||||
// // assignedEmployeeName: parsedJson["${key}AssignedEmployeeName"],
|
|
||||||
// // client: Hospital(id: parsedJson["${key}SiteId"], name: parsedJson["${key}SiteName"]),
|
|
||||||
// // department: Department(
|
|
||||||
// // id: parsedJson["${key}DepartmentId"],
|
|
||||||
// // name: parsedJson["${key}DepartmentName"],
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import '../hospital.dart';
|
|
||||||
// import 'asset.dart';
|
|
||||||
//
|
|
||||||
// @Deprecated("Use asset_transfer_search.dart instead of this one")
|
|
||||||
// class DeviceTransferSearch {
|
|
||||||
// Asset device;
|
|
||||||
// String title, room;
|
|
||||||
// bool mostRecent;
|
|
||||||
// Hospital hospital;
|
|
||||||
// Buildings building;
|
|
||||||
// List<Buildings> buildingsList;
|
|
||||||
// Floors floor;
|
|
||||||
// List<Floors> floorsList;
|
|
||||||
// Departments department;
|
|
||||||
// List<Departments> departmentsList;
|
|
||||||
//
|
|
||||||
// DeviceTransferSearch({
|
|
||||||
// this.device,
|
|
||||||
// this.hospital,
|
|
||||||
// this.building,
|
|
||||||
// this.floor,
|
|
||||||
// this.department,
|
|
||||||
// this.room,
|
|
||||||
// this.title,
|
|
||||||
// this.mostRecent = true,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toMap() {
|
|
||||||
// Map<String, dynamic> search = {};
|
|
||||||
// if (title != null && title.isNotEmpty) {
|
|
||||||
// search["transferCode"] = title;
|
|
||||||
// }
|
|
||||||
// if (device != null) {
|
|
||||||
// search["assetId"] = device.id;
|
|
||||||
// }
|
|
||||||
// if (mostRecent != null) {
|
|
||||||
// search["mostRecent"] = mostRecent;
|
|
||||||
// }
|
|
||||||
// if (hospital?.id != null) {
|
|
||||||
// search["destSiteId"] = hospital.id;
|
|
||||||
// }
|
|
||||||
// if (building?.id != null) {
|
|
||||||
// search["destBuildingId"] = building.id;
|
|
||||||
// }
|
|
||||||
// if (floor?.id != null) {
|
|
||||||
// search["destFloorId"] = floor.id;
|
|
||||||
// }
|
|
||||||
// if (department?.id != null) {
|
|
||||||
// search["destDepartmentId"] = department.id;
|
|
||||||
// }
|
|
||||||
// if (room != null && room.isNotEmpty) {
|
|
||||||
// search["destRoom"] = department.id;
|
|
||||||
// }
|
|
||||||
// return search;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void fromSearch(DeviceTransferSearch newSearch) {
|
|
||||||
// title = newSearch.title;
|
|
||||||
// room = newSearch.room;
|
|
||||||
// mostRecent = newSearch.mostRecent;
|
|
||||||
// device = newSearch.device;
|
|
||||||
// hospital = newSearch.hospital;
|
|
||||||
// building = newSearch.building;
|
|
||||||
// floor = newSearch.floor;
|
|
||||||
// department = newSearch.department;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// enum TranslationKeys {
|
|
||||||
// login,
|
|
||||||
// enterCredsToLogin,
|
|
||||||
// forgotPassword,
|
|
||||||
// password,
|
|
||||||
// username,
|
|
||||||
// requiredField,
|
|
||||||
// passwordLengthMessage,
|
|
||||||
// overview,
|
|
||||||
// myRequests,
|
|
||||||
// myAssets,
|
|
||||||
// contactUs,
|
|
||||||
// welcome,
|
|
||||||
// openWhatsapp,
|
|
||||||
// liveChat,
|
|
||||||
// callUs,
|
|
||||||
// gasRefillRequest,
|
|
||||||
// transferRequest,
|
|
||||||
// serviceRequest,
|
|
||||||
// newServiceRequest,
|
|
||||||
// search,
|
|
||||||
// filter,
|
|
||||||
// newGasRefillRequest,
|
|
||||||
// newTransferRequest,
|
|
||||||
// submitRequest,
|
|
||||||
// select,
|
|
||||||
// gasType,
|
|
||||||
// quantity,
|
|
||||||
// cylinderType,
|
|
||||||
// cylinderSize,
|
|
||||||
// department,
|
|
||||||
// httpError,
|
|
||||||
// tryAgain,
|
|
||||||
// destinationSite,
|
|
||||||
// add,
|
|
||||||
// site,
|
|
||||||
// onlyNumbers,
|
|
||||||
// youHaveToSelect,
|
|
||||||
// building,
|
|
||||||
// floor,
|
|
||||||
// createdSuccessfully,
|
|
||||||
// failedToCompleteRequest,
|
|
||||||
// youHaveToAddRequests,
|
|
||||||
// assetNo,
|
|
||||||
// manufacture,
|
|
||||||
// model,
|
|
||||||
// serialNumber,
|
|
||||||
// device,
|
|
||||||
// pickAsset,
|
|
||||||
// }
|
|
||||||
@ -1,751 +0,0 @@
|
|||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
//
|
|
||||||
// class WorkOrderDetail {
|
|
||||||
// WorkOrder? data;
|
|
||||||
// String? message;
|
|
||||||
// String? title;
|
|
||||||
// String? innerMessage;
|
|
||||||
// int? responseCode;
|
|
||||||
// bool? isSuccess;
|
|
||||||
//
|
|
||||||
// WorkOrderDetail({this.data, this.message, this.title, this.innerMessage, this.responseCode, this.isSuccess});
|
|
||||||
//
|
|
||||||
// factory WorkOrderDetail.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return WorkOrderDetail(
|
|
||||||
// data: json['data'] == null ? null : WorkOrder.fromJson(json['data']),
|
|
||||||
// message: json['message'],
|
|
||||||
// title: json['title'],
|
|
||||||
// innerMessage: json['innerMessage'],
|
|
||||||
// responseCode: json['responseCode'],
|
|
||||||
// isSuccess: json['isSuccess'],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {
|
|
||||||
// 'data': data?.toJson(),
|
|
||||||
// 'message': message,
|
|
||||||
// 'title': title,
|
|
||||||
// 'innerMessage': innerMessage,
|
|
||||||
// 'responseCode': responseCode,
|
|
||||||
// 'isSuccess': isSuccess,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class WorkOrder {
|
|
||||||
// String? workOrderNo;
|
|
||||||
// WorkOrderCreatedBy? workOrderCreatedBy;
|
|
||||||
// DateTime? requestedDate;
|
|
||||||
// Asset? asset;
|
|
||||||
// Lookup? assetGroup;
|
|
||||||
// Lookup? manufacturer;
|
|
||||||
// Lookup? model;
|
|
||||||
// Lookup? assetNDModel;
|
|
||||||
// Site? site;
|
|
||||||
// Lookup? building;
|
|
||||||
// Lookup? floor;
|
|
||||||
// Lookup? department;
|
|
||||||
// dynamic room;
|
|
||||||
// Lookup? assetType;
|
|
||||||
// AssignedEmployee? assignedEmployee;
|
|
||||||
// dynamic lastActivityStatus;
|
|
||||||
// Lookup? status;
|
|
||||||
// Lookup? nextStep;
|
|
||||||
// dynamic assetVerificationType;
|
|
||||||
// List<WorkOrderContactPerson>? workOrderContactPerson;
|
|
||||||
// EquipmentStatus? equipmentStatus;
|
|
||||||
// Priority? priority;
|
|
||||||
// RequestedThrough? requestedThrough;
|
|
||||||
// TypeOfRequest? typeofRequest;
|
|
||||||
// dynamic loanAvailablity;
|
|
||||||
// dynamic assetLoan;
|
|
||||||
// dynamic safety;
|
|
||||||
// ProblemDescription? problemDescription;
|
|
||||||
// String? comments;
|
|
||||||
// String? voiceNote;
|
|
||||||
// List<dynamic>? workOrderAttachments;
|
|
||||||
// dynamic returnToService;
|
|
||||||
// dynamic serviceType;
|
|
||||||
// dynamic failureReasone;
|
|
||||||
// dynamic solution;
|
|
||||||
// dynamic totalWorkingHours;
|
|
||||||
// List<WorkOrderHistory>? workOrderHistory;
|
|
||||||
// List<dynamic>? activityMaintenances;
|
|
||||||
// List<dynamic>? activitySpareParts;
|
|
||||||
// List<dynamic>? activityAssetToBeRetireds;
|
|
||||||
//
|
|
||||||
// WorkOrder({
|
|
||||||
// this.workOrderNo,
|
|
||||||
// this.workOrderCreatedBy,
|
|
||||||
// this.requestedDate,
|
|
||||||
// this.asset,
|
|
||||||
// this.assetGroup,
|
|
||||||
// this.manufacturer,
|
|
||||||
// this.model,
|
|
||||||
// this.assetNDModel,
|
|
||||||
// this.site,
|
|
||||||
// this.building,
|
|
||||||
// this.floor,
|
|
||||||
// this.department,
|
|
||||||
// this.room,
|
|
||||||
// this.assetType,
|
|
||||||
// this.assignedEmployee,
|
|
||||||
// this.lastActivityStatus,
|
|
||||||
// this.status,
|
|
||||||
// this.nextStep,
|
|
||||||
// this.assetVerificationType,
|
|
||||||
// this.workOrderContactPerson,
|
|
||||||
// this.equipmentStatus,
|
|
||||||
// this.priority,
|
|
||||||
// this.requestedThrough,
|
|
||||||
// this.typeofRequest,
|
|
||||||
// this.loanAvailablity,
|
|
||||||
// this.assetLoan,
|
|
||||||
// this.safety,
|
|
||||||
// this.problemDescription,
|
|
||||||
// this.comments,
|
|
||||||
// this.voiceNote,
|
|
||||||
// this.workOrderAttachments,
|
|
||||||
// this.returnToService,
|
|
||||||
// this.serviceType,
|
|
||||||
// this.failureReasone,
|
|
||||||
// this.solution,
|
|
||||||
// this.totalWorkingHours,
|
|
||||||
// this.workOrderHistory,
|
|
||||||
// this.activityMaintenances,
|
|
||||||
// this.activitySpareParts,
|
|
||||||
// this.activityAssetToBeRetireds,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// factory WorkOrder.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return WorkOrder(
|
|
||||||
// workOrderNo: json['workOrderNo'],
|
|
||||||
// workOrderCreatedBy: WorkOrderCreatedBy.fromJson(json['workOrderCreatedBy']),
|
|
||||||
// requestedDate: DateTime.parse(json['requestedDate']),
|
|
||||||
// asset: Asset.fromJson(json['asset']),
|
|
||||||
// assetGroup: json['assetGroup'] ?? Lookup.fromJson(json['assetGroup']),
|
|
||||||
// manufacturer: json['manufacturer'] ?? Lookup.fromJson(json['manufacturer']),
|
|
||||||
// model: json['model'] ?? Lookup.fromJson(json['model']),
|
|
||||||
// assetNDModel: json['assetNDModel'] ?? Lookup.fromJson(json['assetNDModel']),
|
|
||||||
// site: Site.fromJson(json['site']),
|
|
||||||
// building: json['building'] ?? Lookup.fromJson(json['building']),
|
|
||||||
// floor: json['floor'] ?? Lookup.fromJson(json['floor']),
|
|
||||||
// department: json['department'] ?? Lookup.fromJson(json['department']),
|
|
||||||
// room: json['room'],
|
|
||||||
// assetType: json['assetType'] ?? Lookup.fromJson(json['assetType']),
|
|
||||||
// assignedEmployee: AssignedEmployee.fromJson(json['assignedEmployee']),
|
|
||||||
// lastActivityStatus: json['lastActivityStatus'],
|
|
||||||
// status: json['status'] ?? Lookup.fromJson(json['status']),
|
|
||||||
// nextStep: json['nextStep'] ?? Lookup.fromJson(json['nextStep']),
|
|
||||||
// assetVerificationType: json['assetVerificationType'],
|
|
||||||
// workOrderContactPerson: (json['workOrderContactPerson'] as List).map((i) => WorkOrderContactPerson.fromJson(i)).toList(),
|
|
||||||
// equipmentStatus: EquipmentStatus.fromJson(json['equipmentStatus']),
|
|
||||||
// priority: Priority.fromJson(json['priority']),
|
|
||||||
// requestedThrough: RequestedThrough.fromJson(json['requestedThrough']),
|
|
||||||
// typeofRequest: TypeOfRequest.fromJson(json['typeofRequest']),
|
|
||||||
// loanAvailablity: json['loanAvailablity'],
|
|
||||||
// assetLoan: json['assetLoan'],
|
|
||||||
// safety: json['safety'],
|
|
||||||
// problemDescription: ProblemDescription.fromJson(json['problemDescription']),
|
|
||||||
// comments: json['comments'],
|
|
||||||
// voiceNote: json['voiceNote'],
|
|
||||||
// workOrderAttachments: json['workOrderAttachments'] as List,
|
|
||||||
// returnToService: json['returnToService'],
|
|
||||||
// serviceType: json['serviceType'],
|
|
||||||
// failureReasone: json['failureReasone'],
|
|
||||||
// solution: json['solution'],
|
|
||||||
// totalWorkingHours: json['totalWorkingHours'],
|
|
||||||
// workOrderHistory: (json['workOrderHistory'] as List).map((i) => WorkOrderHistory.fromJson(i)).toList(),
|
|
||||||
// activityMaintenances: json['activityMaintenances'] as List,
|
|
||||||
// activitySpareParts: json['activitySpareParts'] as List,
|
|
||||||
// activityAssetToBeRetireds: json['activityAssetToBeRetireds'] as List,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {
|
|
||||||
// 'workOrderNo': workOrderNo,
|
|
||||||
// 'workOrderCreatedBy': workOrderCreatedBy?.toJson(),
|
|
||||||
// 'requestedDate': requestedDate?.toIso8601String(),
|
|
||||||
// 'asset': asset?.toJson(),
|
|
||||||
// 'assetGroup': assetGroup?.toJson(),
|
|
||||||
// 'manufacturer': manufacturer?.toJson(),
|
|
||||||
// 'model': model?.toJson(),
|
|
||||||
// 'assetNDModel': assetNDModel?.toJson(),
|
|
||||||
// 'site': site?.toJson(),
|
|
||||||
// 'building': building?.toJson(),
|
|
||||||
// 'floor': floor?.toJson(),
|
|
||||||
// 'department': department?.toJson(),
|
|
||||||
// 'room': room,
|
|
||||||
// 'assetType': assetType?.toJson(),
|
|
||||||
// 'assignedEmployee': assignedEmployee?.toJson(),
|
|
||||||
// 'lastActivityStatus': lastActivityStatus,
|
|
||||||
// 'status': status?.toJson(),
|
|
||||||
// 'nextStep': nextStep?.toJson(),
|
|
||||||
// 'assetVerificationType': assetVerificationType,
|
|
||||||
// 'workOrderContactPerson': workOrderContactPerson?.map((i) => i.toJson()).toList(),
|
|
||||||
// 'equipmentStatus': equipmentStatus?.toJson(),
|
|
||||||
// 'priority': priority?.toJson(),
|
|
||||||
// 'requestedThrough': requestedThrough?.toJson(),
|
|
||||||
// 'typeofRequest': typeofRequest?.toJson(),
|
|
||||||
// 'loanAvailablity': loanAvailablity,
|
|
||||||
// 'assetLoan': assetLoan,
|
|
||||||
// 'safety': safety,
|
|
||||||
// 'problemDescription': problemDescription?.toJson(),
|
|
||||||
// 'comments': comments,
|
|
||||||
// 'voiceNote': voiceNote,
|
|
||||||
// 'workOrderAttachments': workOrderAttachments,
|
|
||||||
// 'returnToService': returnToService,
|
|
||||||
// 'serviceType': serviceType,
|
|
||||||
// 'failureReasone': failureReasone,
|
|
||||||
// 'solution': solution,
|
|
||||||
// 'totalWorkingHours': totalWorkingHours,
|
|
||||||
// 'workOrderHistory': workOrderHistory?.map((i) => i.toJson()).toList(),
|
|
||||||
// 'activityMaintenances': activityMaintenances,
|
|
||||||
// 'activitySpareParts': activitySpareParts,
|
|
||||||
// 'activityAssetToBeRetireds': activityAssetToBeRetireds,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class WorkOrderCreatedBy {
|
|
||||||
// String? id;
|
|
||||||
// String? userName;
|
|
||||||
//
|
|
||||||
// WorkOrderCreatedBy({this.id, this.userName});
|
|
||||||
//
|
|
||||||
// factory WorkOrderCreatedBy.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return WorkOrderCreatedBy(id: json['id'], userName: json['userName']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'userName': userName};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class Asset {
|
|
||||||
// int? id;
|
|
||||||
// String? assetNumber;
|
|
||||||
//
|
|
||||||
// Asset({this.id, this.assetNumber});
|
|
||||||
//
|
|
||||||
// factory Asset.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return Asset(id: json['id'], assetNumber: json['assetNumber']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'assetNumber': assetNumber};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class WorkOrderContactPerson {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
// String? employeeId;
|
|
||||||
// String? position;
|
|
||||||
// String? extension;
|
|
||||||
// String? email;
|
|
||||||
// String? mobilePhone;
|
|
||||||
// ContactUser? contactUser;
|
|
||||||
//
|
|
||||||
// WorkOrderContactPerson({this.id, this.name, this.employeeId, this.position, this.extension, this.email, this.mobilePhone, this.contactUser});
|
|
||||||
//
|
|
||||||
// factory WorkOrderContactPerson.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return WorkOrderContactPerson(
|
|
||||||
// id: json['id'],
|
|
||||||
// name: json['name'],
|
|
||||||
// employeeId: json['employeeId'],
|
|
||||||
// position: json['position'],
|
|
||||||
// extension: json['extension'],
|
|
||||||
// email: json['email'],
|
|
||||||
// mobilePhone: json['mobilePhone'],
|
|
||||||
// contactUser: json['contactUser'] == null ? null : ContactUser.fromJson(json['contactUser']),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {
|
|
||||||
// 'id': id,
|
|
||||||
// 'name': name,
|
|
||||||
// 'employeeId': employeeId,
|
|
||||||
// 'position': position,
|
|
||||||
// 'extension': extension,
|
|
||||||
// 'email': email,
|
|
||||||
// 'mobilePhone': mobilePhone,
|
|
||||||
// 'contactUser': contactUser?.toJson(),
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class ContactUser {
|
|
||||||
// String? id;
|
|
||||||
// String? userName;
|
|
||||||
//
|
|
||||||
// ContactUser({this.id, this.userName});
|
|
||||||
//
|
|
||||||
// factory ContactUser.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return ContactUser(id: json['id'], userName: json['userName']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'userName': userName};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class AssignedEmployee {
|
|
||||||
// String? id;
|
|
||||||
// String? userName;
|
|
||||||
//
|
|
||||||
// AssignedEmployee({this.id, this.userName});
|
|
||||||
//
|
|
||||||
// factory AssignedEmployee.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return AssignedEmployee(id: json['id'], userName: json['userName']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'userName': userName};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class Site {
|
|
||||||
// int? id;
|
|
||||||
// String? siteName;
|
|
||||||
//
|
|
||||||
// Site({this.id, this.siteName});
|
|
||||||
//
|
|
||||||
// factory Site.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return Site(id: json['id'], siteName: json['siteName']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'siteName': siteName};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ///
|
|
||||||
//
|
|
||||||
// // class AssetGroup {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// //
|
|
||||||
// // AssetGroup({this.id, this.name});
|
|
||||||
// //
|
|
||||||
// // factory AssetGroup.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return AssetGroup(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Manufacturer {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// //
|
|
||||||
// // Manufacturer({this.id, this.name});
|
|
||||||
// //
|
|
||||||
// // factory Manufacturer.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Manufacturer(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Model {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// //
|
|
||||||
// // Model({this.id, this.name});
|
|
||||||
// //
|
|
||||||
// // factory Model.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Model(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class AssetNDModel {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// //
|
|
||||||
// // AssetNDModel({this.id, this.name});
|
|
||||||
// //
|
|
||||||
// // factory AssetNDModel.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return AssetNDModel(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Building {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // Building({this.id, this.name, this.value});
|
|
||||||
// //
|
|
||||||
// // factory Building.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Building(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Floor {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // Floor({this.id, this.name, this.value});
|
|
||||||
// //
|
|
||||||
// // factory Floor.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Floor(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Department {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// //
|
|
||||||
// // Department({this.id, this.name});
|
|
||||||
// //
|
|
||||||
// // factory Department.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Department(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class AssetType {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // AssetType({this.id, this.name, this.value});
|
|
||||||
// //
|
|
||||||
// // factory AssetType.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return AssetType(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class Status {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // Status({this.id, this.name, this.value});
|
|
||||||
// //
|
|
||||||
// // factory Status.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Status(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class NextStep {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // NextStep({this.id, this.name, this.value});
|
|
||||||
// //
|
|
||||||
// // factory NextStep.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return NextStep(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
//
|
|
||||||
// class EquipmentStatus {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
// int? value;
|
|
||||||
//
|
|
||||||
// EquipmentStatus({this.id, this.name, this.value});
|
|
||||||
//
|
|
||||||
// factory EquipmentStatus.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return EquipmentStatus(id: json['id'], name: json['name'], value: json['value']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'name': name, 'value': value};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class Priority {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
// int? value;
|
|
||||||
//
|
|
||||||
// Priority({this.id, this.name, this.value});
|
|
||||||
//
|
|
||||||
// factory Priority.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return Priority(id: json['id'], name: json['name'], value: json['value']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'name': name, 'value': value};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class RequestedThrough {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
//
|
|
||||||
// RequestedThrough({this.id, this.name});
|
|
||||||
//
|
|
||||||
// factory RequestedThrough.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return RequestedThrough(id: json['id'], name: json['name']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'name': name};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class TypeOfRequest {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
//
|
|
||||||
// TypeOfRequest({this.id, this.name});
|
|
||||||
//
|
|
||||||
// factory TypeOfRequest.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return TypeOfRequest(id: json['id'], name: json['name']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'name': name};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class ProblemDescription {
|
|
||||||
// int? id;
|
|
||||||
// String? name;
|
|
||||||
//
|
|
||||||
// ProblemDescription({this.id, this.name});
|
|
||||||
//
|
|
||||||
// factory ProblemDescription.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return ProblemDescription(id: json['id'], name: json['name']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'name': name};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class WorkOrderHistory {
|
|
||||||
// int? id;
|
|
||||||
// Lookup? workOrderStatus;
|
|
||||||
// dynamic activityStatus; // Since activityStatus is null, it's dynamic
|
|
||||||
// String? date;
|
|
||||||
// HistoryUser? user;
|
|
||||||
// Lookup? step;
|
|
||||||
// dynamic fixRemotelyStartTime; // Since it's null, it's dynamic
|
|
||||||
// dynamic fixRemotelyEndTime; // Since it's null, it's dynamic
|
|
||||||
// dynamic fixRemotelyWorkingHours; // Since it's null, it's dynamic
|
|
||||||
// String? comments;
|
|
||||||
// dynamic needAVisitDateTime; // Since it's null, it's dynamic
|
|
||||||
//
|
|
||||||
// WorkOrderHistory(
|
|
||||||
// {this.id,
|
|
||||||
// this.workOrderStatus,
|
|
||||||
// this.activityStatus,
|
|
||||||
// this.date,
|
|
||||||
// this.user,
|
|
||||||
// this.step,
|
|
||||||
// this.fixRemotelyStartTime,
|
|
||||||
// this.fixRemotelyEndTime,
|
|
||||||
// this.fixRemotelyWorkingHours,
|
|
||||||
// this.comments,
|
|
||||||
// this.needAVisitDateTime});
|
|
||||||
//
|
|
||||||
// factory WorkOrderHistory.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return WorkOrderHistory(
|
|
||||||
// id: json['id'],
|
|
||||||
// //json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
|
|
||||||
// workOrderStatus: json['workorderStatus'] ?? Lookup.fromJson(json['workorderStatus']),
|
|
||||||
// activityStatus: json['activityStatus'],
|
|
||||||
// date: json['date'],
|
|
||||||
// user: HistoryUser.fromJson(json['user']),
|
|
||||||
// step: json['step'] ?? Lookup.fromJson(json['step']),
|
|
||||||
// fixRemotelyStartTime: json['fixRemotlyStartTime'],
|
|
||||||
// fixRemotelyEndTime: json['fixRemotlyEndTime'],
|
|
||||||
// fixRemotelyWorkingHours: json['fixRemotlyWorkingHours'],
|
|
||||||
// comments: json['comments'] ?? "",
|
|
||||||
// needAVisitDateTime: json['needAVisitDateTime'],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {
|
|
||||||
// 'id': id,
|
|
||||||
// // Lookup.fromJson(json['workorderStatus'])
|
|
||||||
// 'workorderStatus': workOrderStatus?.toJson(),
|
|
||||||
// 'activityStatus': activityStatus,
|
|
||||||
// 'date': date,
|
|
||||||
// 'user': user?.toJson(),
|
|
||||||
// 'step': step?.toJson(),
|
|
||||||
// 'fixRemotelyStartTime': fixRemotelyStartTime,
|
|
||||||
// 'fixRemotelyEndTime': fixRemotelyEndTime,
|
|
||||||
// 'fixRemotelyWorkingHours': fixRemotelyWorkingHours,
|
|
||||||
// 'comments': comments,
|
|
||||||
// 'needAVisitDateTime': needAVisitDateTime,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // class WorkOrderStatus {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // WorkOrderStatus({
|
|
||||||
// // this.id,
|
|
||||||
// // this.name,
|
|
||||||
// // this.value,
|
|
||||||
// // });
|
|
||||||
// //
|
|
||||||
// // factory WorkOrderStatus.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return WorkOrderStatus(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
//
|
|
||||||
// class HistoryUser {
|
|
||||||
// String? id;
|
|
||||||
// String? userName;
|
|
||||||
//
|
|
||||||
// HistoryUser({this.id, this.userName});
|
|
||||||
//
|
|
||||||
// factory HistoryUser.fromJson(Map<String, dynamic> json) {
|
|
||||||
// return HistoryUser(id: json['id'], userName: json['userName']);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// return {'id': id, 'userName': userName};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // class Step {
|
|
||||||
// // int id;
|
|
||||||
// // String name;
|
|
||||||
// // int value;
|
|
||||||
// //
|
|
||||||
// // Step({
|
|
||||||
// // this.id,
|
|
||||||
// // this.name,
|
|
||||||
// // this.value,
|
|
||||||
// // });
|
|
||||||
// //
|
|
||||||
// // factory Step.fromJson(Map<String, dynamic> json) {
|
|
||||||
// // return Step(
|
|
||||||
// // id: json['id'],
|
|
||||||
// // name: json['name'],
|
|
||||||
// // value: json['value'],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // Map<String, dynamic> toJson() {
|
|
||||||
// // return {
|
|
||||||
// // 'id': id,
|
|
||||||
// // 'name': name,
|
|
||||||
// // 'value': value,
|
|
||||||
// // };
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/search_work_order.dart';
|
|
||||||
//
|
|
||||||
// import '../fault_description.dart';
|
|
||||||
//
|
|
||||||
// class SubWorkOrderDetails {
|
|
||||||
// Lookup equipmentStatus;
|
|
||||||
// Lookup reason;
|
|
||||||
// FaultDescription faultDescription;
|
|
||||||
// List<SparePartsWorkOrders> sparePartsWorkOrders;
|
|
||||||
// List<SuppEngineerWorkOrders> suppEngineerWorkOrders;
|
|
||||||
// SupplierModel supplier;
|
|
||||||
//
|
|
||||||
// SubWorkOrderDetails({
|
|
||||||
// this.equipmentStatus,
|
|
||||||
// this.reason,
|
|
||||||
// this.faultDescription,
|
|
||||||
// this.sparePartsWorkOrders,
|
|
||||||
// this.supplier,
|
|
||||||
// this.suppEngineerWorkOrders,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// SubWorkOrderDetails.fromJson(dynamic json) {
|
|
||||||
// if (json['equipmentStatus'] != null) equipmentStatus = Lookup.fromJson(json['equipmentStatus']);
|
|
||||||
// if (json['reason'] != null) reason = Lookup.fromJson(json['reason']);
|
|
||||||
// if (json['faultDescription'] != null) faultDescription = FaultDescription.fromJson(json['faultDescription']);
|
|
||||||
// if (json['supplier'] != null) supplier = SupplierModel.fromJson(json['supplier']);
|
|
||||||
// if (json['sparePartsWorkOrders'] != null) {
|
|
||||||
// sparePartsWorkOrders = [];
|
|
||||||
// json['sparePartsWorkOrders'].forEach((v) {
|
|
||||||
// sparePartsWorkOrders.add(SparePartsWorkOrders.fromJson(v));
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// if (json['suppEngineerWorkOrders'] != null) {
|
|
||||||
// suppEngineerWorkOrders = [];
|
|
||||||
// json['suppEngineerWorkOrders'].forEach((v) {
|
|
||||||
// suppEngineerWorkOrders.add(SuppEngineerWorkOrders.fromJson(v));
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// SubWorkOrderDetails copyWith({
|
|
||||||
// Lookup equipmentStatus,
|
|
||||||
// Lookup reason,
|
|
||||||
// FaultDescription faultDescription,
|
|
||||||
// List<SparePartsWorkOrders> sparePartsWorkOrders,
|
|
||||||
// SupplierModel supplier,
|
|
||||||
// SuppEngineerWorkOrders suppEngineerWorkOrders,
|
|
||||||
// }) =>
|
|
||||||
// SubWorkOrderDetails(
|
|
||||||
// equipmentStatus: equipmentStatus ?? this.equipmentStatus,
|
|
||||||
// reason: reason ?? this.reason,
|
|
||||||
// faultDescription: faultDescription ?? this.faultDescription,
|
|
||||||
// sparePartsWorkOrders: sparePartsWorkOrders ?? this.sparePartsWorkOrders,
|
|
||||||
// supplier: supplier ?? this.supplier,
|
|
||||||
// suppEngineerWorkOrders: suppEngineerWorkOrders ?? this.suppEngineerWorkOrders,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> toJson() {
|
|
||||||
// final map = <String, dynamic>{};
|
|
||||||
// map['equipmentStatus'] = equipmentStatus?.toJson();
|
|
||||||
// map['reason'] = reason?.toJson();
|
|
||||||
// map['faultDescription'] = faultDescription?.toJson();
|
|
||||||
// if (sparePartsWorkOrders?.isNotEmpty ?? false) {
|
|
||||||
// map['sparePartsWorkOrders'] = sparePartsWorkOrders?.map((e) => e.toJson())?.toList();
|
|
||||||
// }
|
|
||||||
// if (suppEngineerWorkOrders?.isNotEmpty ?? false) {
|
|
||||||
// map['suppEngineerWorkOrders'] = suppEngineerWorkOrders?.map((e) => e.toJson())?.toList();
|
|
||||||
// }
|
|
||||||
// map['supplier'] = supplier?.toJson();
|
|
||||||
// return map;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
//
|
|
||||||
// class AppSearchField extends StatefulWidget {
|
|
||||||
// final Function(String) onChanged;
|
|
||||||
// final Function(String) onSubmitted;
|
|
||||||
//
|
|
||||||
// const AppSearchField({Key? key, this.onChanged, this.onSubmitted}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<AppSearchField> createState() => _AppSearchFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AppSearchFieldState extends State<AppSearchField> {
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return TextField(
|
|
||||||
// onChanged: widget.onChanged,
|
|
||||||
// onSubmitted: widget.onSubmitted,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// prefixIcon: const Icon(
|
|
||||||
// Icons.search,
|
|
||||||
// color: AppColor.neutral20,
|
|
||||||
// ),
|
|
||||||
// hintText: context.translation.search,
|
|
||||||
// hintStyle: TextStyle(fontSize: Theme.of(context).textTheme.bodySmall.fontSize),
|
|
||||||
// filled: true,
|
|
||||||
// fillColor: AppColor.neutral30,
|
|
||||||
// border: OutlineInputBorder(
|
|
||||||
// borderRadius: BorderRadius.circular(15),
|
|
||||||
// borderSide: BorderSide.none,
|
|
||||||
// )),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
//
|
|
||||||
// class AppTabBar extends StatelessWidget {
|
|
||||||
// const AppTabBar({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return TabBar(
|
|
||||||
// tabs: [
|
|
||||||
// Tab(
|
|
||||||
// icon: Icon(Icons.cloud_outlined),
|
|
||||||
// ),
|
|
||||||
// Tab(
|
|
||||||
// icon: Icon(Icons.beach_access_sharp),
|
|
||||||
// ),
|
|
||||||
// Tab(
|
|
||||||
// icon: Icon(Icons.brightness_5_sharp),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
// import 'package:test_sa/new_views/pages/land_page/calender_fragments/daily_fragment.dart';
|
|
||||||
// import 'package:test_sa/new_views/pages/land_page/calender_fragments/weekly_fragment.dart';
|
|
||||||
//
|
|
||||||
// import 'calender_fragments/monthly_fragment.dart';
|
|
||||||
// todo delete
|
|
||||||
// class CalendarPage extends StatefulWidget {
|
|
||||||
// const CalendarPage({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<CalendarPage> createState() => _CalendarPageState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _CalendarPageState extends State<CalendarPage> with SingleTickerProviderStateMixin {
|
|
||||||
// late TabController _tabController;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _tabController = TabController(length: 3, vsync: this)
|
|
||||||
// ..addListener(() {
|
|
||||||
// setState(() {});
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// body: SafeArea(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// // todo @sikander, hiding My shift view, later when they add data, then will us it.
|
|
||||||
// // SizedBox(
|
|
||||||
// // width: double.infinity,
|
|
||||||
// // child: Column(
|
|
||||||
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// // children: [
|
|
||||||
// // context.translation.myShift.heading5(context),
|
|
||||||
// // 8.height,
|
|
||||||
// // context.translation.sunToThurs.bodyText(context),
|
|
||||||
// // "09:00 to 18:00".bodyText(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
||||||
// // ],
|
|
||||||
// // ).toShadowContainer(context),
|
|
||||||
// // ).paddingOnly(start: 16, end: 16),
|
|
||||||
// 16.height,
|
|
||||||
// Container(
|
|
||||||
// margin: const EdgeInsets.only(left: 16, right: 16),
|
|
||||||
// decoration: BoxDecoration(color: context.isDark ? AppColor.neutral50 : AppColor.neutral30, borderRadius: BorderRadius.circular(16)),
|
|
||||||
// child: TabBar(
|
|
||||||
// controller: _tabController,
|
|
||||||
// padding: EdgeInsets.zero,
|
|
||||||
// labelColor: context.isDark ? AppColor.neutral30 : AppColor.neutral60,
|
|
||||||
// unselectedLabelColor: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
||||||
// unselectedLabelStyle: AppTextStyles.bodyText,
|
|
||||||
// labelStyle: AppTextStyles.bodyText,
|
|
||||||
// indicatorPadding: const EdgeInsets.all(4),
|
|
||||||
// indicator: BoxDecoration(color: context.isDark ? AppColor.neutral60 : Theme.of(context).cardColor, borderRadius: BorderRadius.circular(13)),
|
|
||||||
// tabs: [
|
|
||||||
// Tab(text: context.translation.monthly, height: 57.toScreenHeight),
|
|
||||||
// Tab(text: context.translation.weekly, height: 57.toScreenHeight),
|
|
||||||
// Tab(text: context.translation.daily, height: 57.toScreenHeight),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// 8.height,
|
|
||||||
// TabBarView(
|
|
||||||
// //physics: const NeverScrollableScrollPhysics(),
|
|
||||||
// controller: _tabController,
|
|
||||||
// children: const [
|
|
||||||
// MonthlyFragment(),
|
|
||||||
// WeeklyFragment(),
|
|
||||||
// DailyFragment(),
|
|
||||||
// ],
|
|
||||||
// ).expanded,
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:intl/intl.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
//
|
|
||||||
// import '../../../../controllers/providers/api/all_requests_provider.dart';
|
|
||||||
// import '../../../app_style/app_color.dart';
|
|
||||||
// import '../requests/asset_item_view.dart';
|
|
||||||
// import '../requests/gas_refill_item_view.dart';
|
|
||||||
// import '../requests/ppm_item_view.dart';
|
|
||||||
// import '../requests/service_request_item_view.dart';
|
|
||||||
// todo delete
|
|
||||||
// class DailyFragment extends StatefulWidget {
|
|
||||||
// const DailyFragment({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _DailyFragmentState createState() {
|
|
||||||
// return _DailyFragmentState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _DailyFragmentState extends State<DailyFragment> {
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// Provider.of<AllRequestsProvider>(context, listen: false).getCalendarRequests(from: DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return SingleChildScrollView(
|
|
||||||
// padding: const EdgeInsets.only(left: 16, right: 16),
|
|
||||||
// child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
|
|
||||||
// return Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
// children: [
|
|
||||||
// DateFormat("EEEE, d MMMM, yyyy", context.isAr ? "ar" : "en").format(DateTime.now()).heading5(context),
|
|
||||||
// const Divider().defaultStyle(context),
|
|
||||||
// if (snapshot.calendarRequests?.requestsDetails?.isEmpty ?? true)
|
|
||||||
// Center(
|
|
||||||
// child: context.translation.noDataFound.heading5(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50),
|
|
||||||
// ).paddingOnly(top: 16, bottom: 16),
|
|
||||||
// ListView.separated(
|
|
||||||
// shrinkWrap: true,
|
|
||||||
// physics: const NeverScrollableScrollPhysics(),
|
|
||||||
// itemBuilder: (cxt, index) {
|
|
||||||
// final list = snapshot.calendarRequests!.requestsDetails!;
|
|
||||||
// if (snapshot.isCalendarLoading) return const SizedBox().toRequestShimmer(cxt, snapshot.isCalendarLoading);
|
|
||||||
// bool isServiceRequest = list[index].nameOfType == "ServiceRequest";
|
|
||||||
// bool isGasRefill = list[index].nameOfType == "GasRefill";
|
|
||||||
// bool isAssetTransfer = list[index].nameOfType == "AssetTransfer";
|
|
||||||
// bool isPPMs = list[index].nameOfType == "PPMs";
|
|
||||||
//
|
|
||||||
// return isServiceRequest
|
|
||||||
// ? ServiceRequestItemView(list[index])
|
|
||||||
// : isGasRefill
|
|
||||||
// ? GasRefillItemView(list[index])
|
|
||||||
// : isPPMs
|
|
||||||
// ? PpmItemView(list[index])
|
|
||||||
// : isAssetTransfer
|
|
||||||
// ? AssetItemView(list[index])
|
|
||||||
// : Container(
|
|
||||||
// height: 100,
|
|
||||||
// width: double.infinity,
|
|
||||||
// color: Colors.grey,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// separatorBuilder: (cxt, index) => 8.height,
|
|
||||||
// itemCount: snapshot.isCalendarLoading ? 6 : snapshot.calendarRequests!.requestsDetails!.length,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).toShadowContainer(context);
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// BoxDecoration cellDecoration({Color? color}) => BoxDecoration(color: color ?? Colors.transparent, shape: BoxShape.circle);
|
|
||||||
// }
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:intl/intl.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:table_calendar/table_calendar.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
// todo delete
|
|
||||||
// import '../../../../controllers/providers/api/all_requests_provider.dart';
|
|
||||||
// import '../requests/asset_item_view.dart';
|
|
||||||
// import '../requests/gas_refill_item_view.dart';
|
|
||||||
// import '../requests/ppm_item_view.dart';
|
|
||||||
// import '../requests/service_request_item_view.dart';
|
|
||||||
// import 'calender_days_card.dart';
|
|
||||||
//
|
|
||||||
// class WeeklyFragment extends StatefulWidget {
|
|
||||||
// const WeeklyFragment({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _WeeklyFragmentState createState() {
|
|
||||||
// return _WeeklyFragmentState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _WeeklyFragmentState extends State<WeeklyFragment> {
|
|
||||||
// late DateTime _initialDate, _firstDate, _lastDate;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _initialDate = DateTime.now();
|
|
||||||
// _firstDate = DateTime.utc(2010, 10, 16);
|
|
||||||
// _lastDate = DateTime.utc(2030, 3, 14);
|
|
||||||
// Provider.of<AllRequestsProvider>(context, listen: false)
|
|
||||||
// .getCalendarRequests(from: DateTime.now().subtract(Duration(days: DateTime.now().weekday)), to: DateTime.now().add(Duration(days: DateTime.daysPerWeek - DateTime.now().weekday - 1)));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return SingleChildScrollView(
|
|
||||||
// padding: const EdgeInsets.only(left: 16, right: 16),
|
|
||||||
// child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
|
|
||||||
// return Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// TableCalendar(
|
|
||||||
// firstDay: _firstDate,
|
|
||||||
// lastDay: _lastDate,
|
|
||||||
// focusedDay: _initialDate,
|
|
||||||
// calendarFormat: CalendarFormat.week,
|
|
||||||
// weekendDays: const [],
|
|
||||||
// onCalendarCreated: (controller) {},
|
|
||||||
// onPageChanged: (date) {
|
|
||||||
// if (!snapshot.isCalendarLoading) {
|
|
||||||
// _initialDate = date;
|
|
||||||
//
|
|
||||||
// Provider.of<AllRequestsProvider>(context, listen: false)
|
|
||||||
// .getCalendarRequests(from: date.subtract(Duration(days: date.weekday)), to: date.add(Duration(days: DateTime.daysPerWeek - date.weekday - 1)));
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// calendarBuilders: CalendarBuilders(
|
|
||||||
// headerTitleBuilder: (context, dateTime) => Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
// children: [
|
|
||||||
// DateFormat("EEEE, d MMMM, yyyy", context.isAr ? "ar" : "en").format(dateTime).heading5(context),
|
|
||||||
// 8.height,
|
|
||||||
// const Divider().defaultStyle(context),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// dowBuilder: (context, dateTime) {
|
|
||||||
// final day = DateFormat("EE", context.isAr ? "ar" : "en").format(dateTime).toUpperCase();
|
|
||||||
// return Align(alignment: Alignment.center, child: day.bodyText(context).custom(color: context.isDark ? AppColor.neutral10 : AppColor.neutral50));
|
|
||||||
// },
|
|
||||||
// defaultBuilder: (context, dateTime, _) {
|
|
||||||
// final day = DateFormat("d").format(dateTime);
|
|
||||||
// return CalendarDaysCard(
|
|
||||||
// day: day,
|
|
||||||
// fill: snapshot.calendarRequests!.requestsDetails?.firstWhere(
|
|
||||||
// (element) => (element.date != null) && (DateTime.tryParse(element.date!)?.day == (dateTime).day),
|
|
||||||
// orElse: null,
|
|
||||||
// ) !=
|
|
||||||
// null,
|
|
||||||
// ).toShimmer(isShow: snapshot.isCalendarLoading);
|
|
||||||
// },
|
|
||||||
// outsideBuilder: (context, dateTime, _) {
|
|
||||||
// final day = DateFormat("d").format(dateTime);
|
|
||||||
// return CalendarDaysCard(
|
|
||||||
// day: day,
|
|
||||||
// fill: snapshot.calendarRequests!.requestsDetails?.firstWhere(
|
|
||||||
// (element) => (element.date != null) && (DateTime.tryParse(element.date!)?.day == (dateTime).day),
|
|
||||||
// orElse: null,
|
|
||||||
// ) !=
|
|
||||||
// null,
|
|
||||||
// ).toShimmer(isShow: snapshot.isCalendarLoading);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// daysOfWeekHeight: 35.toScreenHeight,
|
|
||||||
// headerStyle: const HeaderStyle(leftChevronVisible: false, rightChevronVisible: false, formatButtonVisible: false),
|
|
||||||
// calendarStyle: CalendarStyle(
|
|
||||||
// isTodayHighlighted: false,
|
|
||||||
// defaultTextStyle: AppTextStyles.bodyText,
|
|
||||||
// defaultDecoration: const BoxDecoration(shape: BoxShape.circle, color: AppColor.neutral30),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (snapshot.calendarRequests?.requestsDetails?.isNotEmpty ?? false) const Divider().defaultStyle(context),
|
|
||||||
// ListView.separated(
|
|
||||||
// shrinkWrap: true,
|
|
||||||
// physics: const NeverScrollableScrollPhysics(),
|
|
||||||
// itemBuilder: (cxt, index) {
|
|
||||||
// final list = snapshot.calendarRequests!.requestsDetails!;
|
|
||||||
// if (snapshot.isCalendarLoading) return const SizedBox().toRequestShimmer(cxt, snapshot.isCalendarLoading);
|
|
||||||
// bool isServiceRequest = list[index].nameOfType == "ServiceRequest";
|
|
||||||
// bool isGasRefill = list[index].nameOfType == "GasRefill";
|
|
||||||
// bool isAssetTransfer = list[index].nameOfType == "AssetTransfer";
|
|
||||||
// bool isPPMs = list[index].nameOfType == "PPMs";
|
|
||||||
//
|
|
||||||
// return isServiceRequest
|
|
||||||
// ? ServiceRequestItemView(list[index], showShadow: false)
|
|
||||||
// : isGasRefill
|
|
||||||
// ? GasRefillItemView(list[index], showShadow: false)
|
|
||||||
// : isPPMs
|
|
||||||
// ? PpmItemView(list[index], showShadow: false)
|
|
||||||
// : isAssetTransfer
|
|
||||||
// ? AssetItemView(list[index], showShadow: false)
|
|
||||||
// : Container(
|
|
||||||
// height: 100,
|
|
||||||
// width: double.infinity,
|
|
||||||
// color: Colors.grey,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
|
|
||||||
// itemCount: snapshot.isCalendarLoading ? 6 : snapshot.calendarRequests!.requestsDetails!.length,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).toShadowContainer(context);
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// BoxDecoration cellDecoration({Color? color}) => BoxDecoration(color: color ?? Colors.transparent, shape: BoxShape.circle);
|
|
||||||
// }
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
//
|
|
||||||
// import '../../app_style/app_color.dart';
|
|
||||||
//
|
|
||||||
// class HomeAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
||||||
// final GlobalKey<ScaffoldState> scaffoldKey;
|
|
||||||
//
|
|
||||||
// const HomeAppBar({Key? key, this.scaffoldKey}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Size get preferredSize => Size.fromHeight(60.toScreenHeight);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Padding(
|
|
||||||
// padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth),
|
|
||||||
// child: AppBar(
|
|
||||||
// backgroundColor: context.isDark ? AppColor.backgroundDark : AppColor.backgroundLight,
|
|
||||||
// automaticallyImplyLeading: false,
|
|
||||||
// elevation: 0,
|
|
||||||
// leadingWidth: 48.toScreenWidth,
|
|
||||||
// leading: InkWell(
|
|
||||||
// onTap: () {
|
|
||||||
// scaffoldKey.currentState.openDrawer();
|
|
||||||
// },
|
|
||||||
// child: CircleAvatar(child: Image.network("", fit: BoxFit.fill)),
|
|
||||||
// ),
|
|
||||||
// actions: [
|
|
||||||
// Stack(
|
|
||||||
// children: <Widget>[
|
|
||||||
// Icon(
|
|
||||||
// Icons.notifications,
|
|
||||||
// color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
|
|
||||||
// size: 34,
|
|
||||||
// ),
|
|
||||||
//
|
|
||||||
// ///TODO [zaid] : put notifications count rather than number 1
|
|
||||||
// if (1 != 0)
|
|
||||||
// PositionedDirectional(
|
|
||||||
// end: 0,
|
|
||||||
// top: 0,
|
|
||||||
// child: Container(
|
|
||||||
// height: 20.toScreenWidth,
|
|
||||||
// width: 20.toScreenWidth,
|
|
||||||
// padding: const EdgeInsets.all(1),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: AppColor.red50,
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// (1).toString(),
|
|
||||||
// style: Theme.of(context).textTheme.bodySmall?.copyWith(fontWeight: FontWeight.w500, color: AppColor.neutral30),
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
||||||
//
|
|
||||||
// import '../../../controllers/api_routes/api_manager.dart';
|
|
||||||
// import '../../../controllers/api_routes/urls.dart';
|
|
||||||
//
|
|
||||||
// class PentryTaskStatusProvider extends LoadingListNotifier<Lookup> {
|
|
||||||
// @override
|
|
||||||
// Future getDate() async {
|
|
||||||
// if (loading ?? false) return -2;
|
|
||||||
// loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// Response response;
|
|
||||||
// try {
|
|
||||||
// response = await ApiManager.instance.get(URLs.getPentryTaskStatus);
|
|
||||||
// } catch (error) {
|
|
||||||
// loading = false;
|
|
||||||
// stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List listJson = json.decode(response.body)["data"];
|
|
||||||
// items = listJson.map((department) => Lookup.fromJson(department)).toList();
|
|
||||||
// }
|
|
||||||
// loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
||||||
//
|
|
||||||
// import '../../controllers/api_routes/api_manager.dart';
|
|
||||||
// import '../../controllers/api_routes/urls.dart';
|
|
||||||
// import '../../models/lookup.dart';
|
|
||||||
//
|
|
||||||
// class RequestStatusProvider extends LoadingListNotifier<Lookup> {
|
|
||||||
// @override
|
|
||||||
// Future getDate() async {
|
|
||||||
// if (loading == true) return -2;
|
|
||||||
// loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// try {
|
|
||||||
// Response response = await ApiManager.instance.get(URLs.getServiceRequestStatus);
|
|
||||||
// stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// loading = false;
|
|
||||||
// stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:convert';
|
|
||||||
//
|
|
||||||
// import 'package:http/http.dart';
|
|
||||||
// import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
||||||
//
|
|
||||||
// import '../../controllers/api_routes/api_manager.dart';
|
|
||||||
// import '../../controllers/api_routes/urls.dart';
|
|
||||||
// import '../../models/lookup.dart';
|
|
||||||
//
|
|
||||||
// class AssetTypesProvider extends LoadingListNotifier<Lookup> {
|
|
||||||
// @override
|
|
||||||
// Future getDate() async {
|
|
||||||
// if (loading == true) return -2;
|
|
||||||
// loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// loading = true;
|
|
||||||
// notifyListeners();
|
|
||||||
// try {
|
|
||||||
// Response response = await ApiManager.instance.get(URLs.getAssetTypes);
|
|
||||||
// stateCode = response.statusCode;
|
|
||||||
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
||||||
// // client's request was successfully received
|
|
||||||
// List categoriesListJson = json.decode(response.body)["data"];
|
|
||||||
// items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
|
||||||
// }
|
|
||||||
// loading = false;
|
|
||||||
// notifyListeners();
|
|
||||||
// return response.statusCode;
|
|
||||||
// } catch (error) {
|
|
||||||
// loading = false;
|
|
||||||
// stateCode = -1;
|
|
||||||
// notifyListeners();
|
|
||||||
// return -1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class GetQRCodeView extends StatelessWidget {
|
|
||||||
final String qrCodeUrl = "https://your-qrcode-url.com/qrcode.png"; // Replace with your QR code URL
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text('QR Code Dialog Example'),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
showQRCodeDialog(context, qrCodeUrl);
|
|
||||||
},
|
|
||||||
child: Text('Show QR Code'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function to display the QR code in a dialog
|
|
||||||
void showQRCodeDialog(BuildContext context, String qrCodeUrl) {
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('Scan QR Code'),
|
|
||||||
content: Image.network(
|
|
||||||
qrCodeUrl,
|
|
||||||
loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
|
|
||||||
if (loadingProgress == null) {
|
|
||||||
return child; // Display the QR code once loaded
|
|
||||||
} else {
|
|
||||||
// Show a CircularProgressIndicator while the image is loading
|
|
||||||
return Center(
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
value: loadingProgress.expectedTotalBytes != null
|
|
||||||
? loadingProgress.cumulativeBytesLoaded / (loadingProgress.expectedTotalBytes ?? 1)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
errorBuilder: (context, error, stackTrace) {
|
|
||||||
// Display an error widget if the image fails to load
|
|
||||||
return Icon(Icons.error, color: Colors.red);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context).pop(); // Close the dialog
|
|
||||||
},
|
|
||||||
child: Text('Close'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
runApp(MaterialApp(home: GetQRCodeView()));
|
|
||||||
}
|
|
||||||
@ -1,546 +0,0 @@
|
|||||||
// // import 'package:flutter/material.dart';
|
|
||||||
// // import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// // import 'package:provider/provider.dart';
|
|
||||||
// // import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// // import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// // import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// // import 'package:test_sa/extensions/string_extensions.dart';
|
|
||||||
// // import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// // import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// // import 'package:test_sa/models/lookup.dart';
|
|
||||||
// // import 'package:test_sa/models/plan_preventive_visit/plan_preventive_visit_model.dart';
|
|
||||||
// // import 'package:test_sa/models/ppm/ppm_calibration_tools.dart';
|
|
||||||
// // import 'package:test_sa/models/service_request/supplier_details.dart';
|
|
||||||
// // import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
||||||
// // import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
|
||||||
// // import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart';
|
|
||||||
// // import 'package:test_sa/providers/loading_list_notifier.dart';
|
|
||||||
// // import 'package:test_sa/providers/ppm_service_provider.dart';
|
|
||||||
// // import 'package:test_sa/providers/work_order/vendor_provider.dart';
|
|
||||||
// // import 'package:test_sa/service_request_latest/utilities/service_request_utils.dart';
|
|
||||||
// // import 'package:test_sa/views/widgets/pentry/calibration_tool_asset_picker.dart';
|
|
||||||
// //
|
|
||||||
// // import '../../../../../new_views/app_style/app_color.dart';
|
|
||||||
// // import '../../../../widgets/date_and_time/date_picker.dart';
|
|
||||||
// //
|
|
||||||
// // class AssistantEmployeeList extends StatefulWidget {
|
|
||||||
// // final List<PreventiveVisitSuppliers>? models;
|
|
||||||
// //
|
|
||||||
// // const AssistantEmployeeList({Key? key, this.models = const <PreventiveVisitSuppliers>[]}) : super(key: key);
|
|
||||||
// //
|
|
||||||
// // @override
|
|
||||||
// // State<AssistantEmployeeList> createState() => _AssistantEmployeeListState();
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // class _AssistantEmployeeListState extends State<AssistantEmployeeList> {
|
|
||||||
// // final TextEditingController _workingHoursController = TextEditingController();
|
|
||||||
// //
|
|
||||||
// // @override
|
|
||||||
// // Widget build(BuildContext context) {
|
|
||||||
// // return ListView.builder(
|
|
||||||
// // itemCount: widget.models!.length + 1,
|
|
||||||
// // padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 16),
|
|
||||||
// // itemBuilder: (context, index) {
|
|
||||||
// // if (index == widget.models!.length) {
|
|
||||||
// // return AppFilledButton(
|
|
||||||
// // label: "Add More External Details".addTranslation,
|
|
||||||
// // maxWidth: true,
|
|
||||||
// // textColor: AppColor.black10,
|
|
||||||
// // buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10,
|
|
||||||
// // icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)),
|
|
||||||
// // showIcon: true,
|
|
||||||
// // onPressed: () async {
|
|
||||||
// // // if (widget.models?.isNotEmpty ?? false) {
|
|
||||||
// // // if (widget.models!.last.assetId == null) {
|
|
||||||
// // // await Fluttertoast.showToast(msg: "${context.translation.youHaveToSelect} ${context.translation.assetNumber}");
|
|
||||||
// // // return;
|
|
||||||
// // // }
|
|
||||||
// // // if (widget.models!.last.calibrationDateOfTesters == null) {
|
|
||||||
// // // await Fluttertoast.showToast(msg: "${context.translation.youHaveToSelect} ${context.translation.date}");
|
|
||||||
// // // return;
|
|
||||||
// // // }
|
|
||||||
// // // }
|
|
||||||
// // // widget.models!.add(PpmCalibrationTools(id: 0));
|
|
||||||
// // // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // final model = widget.models![index];
|
|
||||||
// // // _workingHoursController.text = model.workingHours != null ? model.workingHours.toString() : '';
|
|
||||||
// // return Container(
|
|
||||||
// // padding: const EdgeInsets.all(16),
|
|
||||||
// // margin: EdgeInsets.only(bottom: 16.toScreenHeight),
|
|
||||||
// // decoration: BoxDecoration(
|
|
||||||
// // color: AppColor.background(context),
|
|
||||||
// // borderRadius: BorderRadius.circular(20),
|
|
||||||
// // boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.03), blurRadius: 14)],
|
|
||||||
// // ),
|
|
||||||
// // child: Column(
|
|
||||||
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// // children: [
|
|
||||||
// // Row(
|
|
||||||
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// // children: [
|
|
||||||
// // (index == 0 ? "1 /4 . External Details" : "").heading5(context),
|
|
||||||
// // "trash".toSvgAsset(height: 20, width: 15).onPress(() {
|
|
||||||
// // widget.models!.remove(model);
|
|
||||||
// //
|
|
||||||
// // setState(() {});
|
|
||||||
// // }),
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // 16.height,
|
|
||||||
// // SingleItemDropDownMenu<SupplierDetails, VendorProvider>(
|
|
||||||
// // context: context,
|
|
||||||
// // title: context.translation.supplier,
|
|
||||||
// // initialValue: model.supplier,
|
|
||||||
// // backgroundColor: AppColor.neutral100,
|
|
||||||
// // showAsBottomSheet: true,
|
|
||||||
// // onSelect: (supplier) {
|
|
||||||
// // if (supplier != null) {
|
|
||||||
// // model.supplier = supplier;
|
|
||||||
// // print('supplier dtails is ${supplier.toJson()}');
|
|
||||||
// // setState(() {});
|
|
||||||
// // }
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // 8.height,
|
|
||||||
// // SingleItemDropDownMenu<SuppPersons, NullableLoadingProvider>(
|
|
||||||
// // context: context,
|
|
||||||
// // title: context.translation.supplierEngineer,
|
|
||||||
// // enabled: model.suppPerson != null,
|
|
||||||
// // backgroundColor: AppColor.neutral100,
|
|
||||||
// // initialValue: model.suppPerson,
|
|
||||||
// // staticData: model.supplier?.suppPersons,
|
|
||||||
// // showAsBottomSheet: true,
|
|
||||||
// // onSelect: (suppPerson) {
|
|
||||||
// // if (suppPerson != null) {
|
|
||||||
// // model.suppPerson = suppPerson;
|
|
||||||
// // print('supply person is ${model.suppPerson?.toJson()}');
|
|
||||||
// // }
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // 8.height,
|
|
||||||
// // AppTextFormField(
|
|
||||||
// // labelText: "Telephone",
|
|
||||||
// // initialValue: model.supplier?.telephones != null && model.supplier!.telephones!.isNotEmpty ? (model.supplier?.telephones?[0].telephone ?? "").toString() : '',
|
|
||||||
// // textAlign: TextAlign.center,
|
|
||||||
// // backgroundColor: AppColor.neutral100,
|
|
||||||
// // style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// // textInputType: TextInputType.number,
|
|
||||||
// // onChange: (value) {
|
|
||||||
// // model.supplier?.telephones?[0].telephone = value;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // 8.height,
|
|
||||||
// // Row(
|
|
||||||
// // mainAxisSize: MainAxisSize.min,
|
|
||||||
// // children: [
|
|
||||||
// // ADatePicker(
|
|
||||||
// // label: context.translation.startTime,
|
|
||||||
// // hideShadow: true,
|
|
||||||
// // backgroundColor: AppColor.neutral100,
|
|
||||||
// // date: model.startDateTime,
|
|
||||||
// // formatDateWithTime: true,
|
|
||||||
// // onDatePicker: (selectedDate) {
|
|
||||||
// // showTimePicker(
|
|
||||||
// // context: context,
|
|
||||||
// // initialTime: TimeOfDay.now(),
|
|
||||||
// // ).then((selectedTime) {
|
|
||||||
// // // Handle the selected date and time here.
|
|
||||||
// // if (selectedTime != null) {
|
|
||||||
// // DateTime selectedDateTime = DateTime(
|
|
||||||
// // selectedDate.year,
|
|
||||||
// // selectedDate.month,
|
|
||||||
// // selectedDate.day,
|
|
||||||
// // selectedTime.hour,
|
|
||||||
// // selectedTime.minute,
|
|
||||||
// // );
|
|
||||||
// // setState(() {
|
|
||||||
// // model.startDateTime = selectedDateTime;
|
|
||||||
// // });
|
|
||||||
// // model.endDateTime = null;
|
|
||||||
// // _workingHoursController.clear();
|
|
||||||
// // ServiceRequestUtils.calculateAndAssignWorkingHours(
|
|
||||||
// // startTime: model.startDateTime,
|
|
||||||
// // endTime: model.endDateTime,
|
|
||||||
// // workingHoursController: _workingHoursController,
|
|
||||||
// // updateModel: (hours) {
|
|
||||||
// // model.workingHours = hours;
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// // },
|
|
||||||
// // ).expanded,
|
|
||||||
// // 8.width,
|
|
||||||
// // ADatePicker(
|
|
||||||
// // label: context.translation.endTime,
|
|
||||||
// // hideShadow: true,
|
|
||||||
// // backgroundColor: AppColor.neutral100,
|
|
||||||
// // date: model.endDateTime,
|
|
||||||
// // formatDateWithTime: true,
|
|
||||||
// // onDatePicker: (selectedDate) {
|
|
||||||
// // showTimePicker(
|
|
||||||
// // context: context,
|
|
||||||
// // initialTime: TimeOfDay.now(),
|
|
||||||
// // ).then((selectedTime) {
|
|
||||||
// // // Handle the selected date and time here.
|
|
||||||
// // if (selectedTime != null) {
|
|
||||||
// // DateTime selectedDateTime = DateTime(
|
|
||||||
// // selectedDate.year,
|
|
||||||
// // selectedDate.month,
|
|
||||||
// // selectedDate.day,
|
|
||||||
// // selectedTime.hour,
|
|
||||||
// // selectedTime.minute,
|
|
||||||
// // );
|
|
||||||
// // if (model.startDateTime != null && selectedDateTime.isBefore(model.startDateTime!)) {
|
|
||||||
// // "End Date time must be greater then start date".showToast;
|
|
||||||
// // return;
|
|
||||||
// // }
|
|
||||||
// // model.endDateTime = selectedDateTime;
|
|
||||||
// // setState(() {});
|
|
||||||
// // ServiceRequestUtils.calculateAndAssignWorkingHours(
|
|
||||||
// // startTime: model.startDateTime,
|
|
||||||
// // endTime: model.endDateTime,
|
|
||||||
// // workingHoursController: _workingHoursController,
|
|
||||||
// // updateModel: (hours) {
|
|
||||||
// // model.workingHours = hours;
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // });
|
|
||||||
// // },
|
|
||||||
// // ).expanded,
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // 8.height,
|
|
||||||
// // AppTextFormField(
|
|
||||||
// // labelText: context.translation.workingHours,
|
|
||||||
// // backgroundColor: AppColor.neutral80,
|
|
||||||
// // controller: _workingHoursController,
|
|
||||||
// // suffixIcon: "clock".toSvgAsset(width: 20, color: context.isDark ? AppColor.neutral10 : null).paddingOnly(end: 16),
|
|
||||||
// // // initialValue: model.workingHours != null ? model.workingHours.toString() : '',
|
|
||||||
// // textAlign: TextAlign.center,
|
|
||||||
// // labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
||||||
// // enable: false,
|
|
||||||
// // showShadow: false,
|
|
||||||
// // style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// // ),
|
|
||||||
// // 8.height,
|
|
||||||
// // ],
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
//
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/ppm_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/string_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/models/new_models/assistant_employee.dart';
|
|
||||||
// import 'package:test_sa/models/new_models/work_order_detail_model.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
// import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
||||||
// import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
|
||||||
// import 'package:test_sa/service_request_latest/service_request_detail_provider.dart';
|
|
||||||
// import 'package:test_sa/service_request_latest/utilities/service_request_utils.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/report/service_report_assistant_employee_menu.dart';
|
|
||||||
//
|
|
||||||
// class AssistantEmployeeList extends StatefulWidget {
|
|
||||||
// final List<ActivityMaintenanceAssistantEmployees>? models;
|
|
||||||
//
|
|
||||||
// const AssistantEmployeeList({Key? key, this.models = const <ActivityMaintenanceAssistantEmployees>[]}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<AssistantEmployeeList> createState() => _AssistantEmployeeListState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AssistantEmployeeListState extends State<AssistantEmployeeList> {
|
|
||||||
// bool isLoading = false;
|
|
||||||
//
|
|
||||||
// //TODO add loader when adding or deleting item..
|
|
||||||
//
|
|
||||||
// void _addNewEntry() {
|
|
||||||
// setState(() {
|
|
||||||
// // isLoading = true;
|
|
||||||
// widget.models!.add(ActivityMaintenanceAssistantEmployees());
|
|
||||||
// // Future.delayed(Duration(seconds: 1)).whenComplete(() {
|
|
||||||
// // setState(() {
|
|
||||||
// // isLoading = false;
|
|
||||||
// // });
|
|
||||||
// // });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void _removeEntry(int index) {
|
|
||||||
// setState(() {
|
|
||||||
// isLoading = true;
|
|
||||||
// widget.models!.removeAt(index);
|
|
||||||
// // isLoading = false;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final ppmProvider = Provider.of<PpmProvider>(context, listen: false);
|
|
||||||
// return ListView.builder(
|
|
||||||
// itemCount: widget.models!.length + 1,
|
|
||||||
// padding: const EdgeInsets.all(16),
|
|
||||||
// itemBuilder: (context, index) {
|
|
||||||
// if (index == widget.models!.length) {
|
|
||||||
// return Visibility(
|
|
||||||
// visible: !ppmProvider.isReadOnly,
|
|
||||||
// child: AppFilledButton(
|
|
||||||
// label: "Add More Assistant Employees".addTranslation,
|
|
||||||
// maxWidth: true,
|
|
||||||
// textColor: AppColor.black10,
|
|
||||||
// buttonColor: context.isDark ? AppColor.neutral60 : AppColor.white10,
|
|
||||||
// icon: Icon(Icons.add_circle, color: AppColor.blueStatus(context)),
|
|
||||||
// showIcon: true,
|
|
||||||
// onPressed: _addNewEntry,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// // return !isLoading
|
|
||||||
// // ?
|
|
||||||
// return AssistantEmployeeItem(
|
|
||||||
// model: widget.models![index],
|
|
||||||
// // index: index,
|
|
||||||
// // onRemove: () => _removeEntry(index),
|
|
||||||
// );
|
|
||||||
// // : const ALoading();
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// class AssistantEmployeeItem extends StatefulWidget {
|
|
||||||
// final ActivityMaintenanceAssistantEmployees model;
|
|
||||||
// const AssistantEmployeeItem({required this.model,super.key});
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<AssistantEmployeeItem> createState() => _AssistantEmployeeItemState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AssistantEmployeeItemState extends State<AssistantEmployeeItem> {
|
|
||||||
// bool status = false;
|
|
||||||
// final TextEditingController _workingHoursController = TextEditingController(text: '');
|
|
||||||
// bool isCurrentUserIsAssistantEmp = false;
|
|
||||||
// bool isExpanded = false;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// // TODO: implement initState
|
|
||||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// getInitialData();
|
|
||||||
// });
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Future<void> getInitialData() async {
|
|
||||||
// final user = Provider.of<UserProvider>(context, listen: false).user!;
|
|
||||||
// ServiceRequestDetailProvider requestDetailProvider = Provider.of<ServiceRequestDetailProvider>(context, listen: false);
|
|
||||||
// if( requestDetailProvider.isReadOnlyRequest){
|
|
||||||
// isExpanded = true;
|
|
||||||
// setState(() {
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// isCurrentUserIsAssistantEmp = (user.userID != requestDetailProvider.currentWorkOrder?.data?.assignedEmployee?.userId);
|
|
||||||
//
|
|
||||||
// // if (isCurrentUserIsAssistantEmp) {
|
|
||||||
// // // _subWorkOrders.assistantEmployees = [widget.workOrder.assistantEmployees?.first?.copyWith(id: 0)];
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// // TODO: implement dispose
|
|
||||||
// _workingHoursController.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Consumer<ServiceRequestDetailProvider>(builder: (context, requestDetailProvider, child) {
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// height: 56.toScreenHeight,
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// context.translation.assistantEmployee.bodyText(context).custom(color: AppColor.black20),
|
|
||||||
// Icon(isExpanded ? Icons.arrow_drop_up_outlined : Icons.arrow_drop_down),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ).onPress(() {
|
|
||||||
// setState(() {
|
|
||||||
// isExpanded = !isExpanded;
|
|
||||||
// });
|
|
||||||
// }),
|
|
||||||
// isExpanded
|
|
||||||
// ? Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
// children: [
|
|
||||||
// ServiceReportAssistantEmployeeMenu(
|
|
||||||
// title: context.translation.select,
|
|
||||||
// backgroundColor: AppColor.neutral100,
|
|
||||||
// assetId: requestDetailProvider.currentWorkOrder!.data!.asset!.id!,
|
|
||||||
// initialValue: widget.model.,
|
|
||||||
// onSelect: (employee) {
|
|
||||||
// if (employee == null) {
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel?.assistantEmployees = [];
|
|
||||||
// } else {
|
|
||||||
// widget.model = [employee.copyWith(id: 0)];
|
|
||||||
// // requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.user = AssignedEmployee(userId: employee.user?.id, userName: employee.user?.name);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// 8.height,
|
|
||||||
// Row(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// ADatePicker(
|
|
||||||
// label: context.translation.startTime,
|
|
||||||
// hideShadow: true,
|
|
||||||
// backgroundColor: AppColor.neutral100,
|
|
||||||
// date: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate,
|
|
||||||
// formatDateWithTime: true,
|
|
||||||
// onDatePicker: (selectedDate) {
|
|
||||||
// showTimePicker(
|
|
||||||
// context: context,
|
|
||||||
// initialTime: TimeOfDay.now(),
|
|
||||||
// ).then((selectedTime) {
|
|
||||||
// // Handle the selected date and time here.
|
|
||||||
// if (selectedTime != null) {
|
|
||||||
// DateTime selectedDateTime = DateTime(
|
|
||||||
// selectedDate.year,
|
|
||||||
// selectedDate.month,
|
|
||||||
// selectedDate.day,
|
|
||||||
// selectedTime.hour,
|
|
||||||
// selectedTime.minute,
|
|
||||||
// );
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate = selectedDateTime;
|
|
||||||
// requestDetailProvider.updateActivityMaintenanceHelperModel(requestDetailProvider.activityMaintenanceHelperModel);
|
|
||||||
// ServiceRequestUtils.calculateAndAssignWorkingHours(
|
|
||||||
// startTime: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate,
|
|
||||||
// endTime: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate,
|
|
||||||
// workingHoursController: _workingHoursController,
|
|
||||||
// updateModel: (hours){
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel!.modelAssistantEmployees!.workingHours=hours;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// ).expanded,
|
|
||||||
// 8.width,
|
|
||||||
// ADatePicker(
|
|
||||||
// label: context.translation.endTime,
|
|
||||||
// hideShadow: true,
|
|
||||||
// backgroundColor: AppColor.neutral100,
|
|
||||||
// date: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.endDate,
|
|
||||||
// formatDateWithTime: true,
|
|
||||||
// onDatePicker: (selectedDate) {
|
|
||||||
// showTimePicker(
|
|
||||||
// context: context,
|
|
||||||
// initialTime: TimeOfDay.now(),
|
|
||||||
// ).then((selectedTime) {
|
|
||||||
// // Handle the selected date and time here.
|
|
||||||
// if (selectedTime != null) {
|
|
||||||
// DateTime selectedDateTime = DateTime(
|
|
||||||
// selectedDate.year,
|
|
||||||
// selectedDate.month,
|
|
||||||
// selectedDate.day,
|
|
||||||
// selectedTime.hour,
|
|
||||||
// selectedTime.minute,
|
|
||||||
// );
|
|
||||||
// if (requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate != null &&
|
|
||||||
// selectedDateTime.isBefore(requestDetailProvider.activityMaintenanceHelperModel!.modelAssistantEmployees!.startDate!)) {
|
|
||||||
// "End Date time must be greater then start date".showToast;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.endDate = selectedDateTime;
|
|
||||||
// requestDetailProvider.updateActivityMaintenanceHelperModel(requestDetailProvider.activityMaintenanceHelperModel);
|
|
||||||
// ServiceRequestUtils.calculateAndAssignWorkingHours(
|
|
||||||
// startTime: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate,
|
|
||||||
// endTime: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.endDate,
|
|
||||||
// workingHoursController: _workingHoursController,
|
|
||||||
// updateModel: (hours){
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel!.modelAssistantEmployees!.workingHours=hours;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// ).expanded,
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// 8.height,
|
|
||||||
// AppTextFormField(
|
|
||||||
// labelText: context.translation.workingHours,
|
|
||||||
// backgroundColor: AppColor.neutral80,
|
|
||||||
// controller: _workingHoursController,
|
|
||||||
// suffixIcon: "clock".toSvgAsset(width: 20, color: context.isDark ? AppColor.neutral10 : null).paddingOnly(end: 16),
|
|
||||||
// initialValue: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.workingHours != null
|
|
||||||
// ? requestDetailProvider.activityMaintenanceHelperModel!.modelAssistantEmployees!.workingHours.toString()
|
|
||||||
// : '',
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
||||||
// enable: false,
|
|
||||||
// showShadow: false,
|
|
||||||
// style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// ),
|
|
||||||
// 8.height,
|
|
||||||
// AppTextFormField(
|
|
||||||
// initialValue: requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.technicalComment,
|
|
||||||
// labelText: context.translation.technicalComment,
|
|
||||||
// backgroundColor: AppColor.neutral100,
|
|
||||||
// showShadow: false,
|
|
||||||
// labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
||||||
// alignLabelWithHint: true,
|
|
||||||
// textInputType: TextInputType.multiline,
|
|
||||||
// onChange: (value) {
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.technicalComment = value;
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.technicalComment = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// 8.height,
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// : const SizedBox(),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // //TODO move this to some common place....@waseem
|
|
||||||
// // double calculateWorkingHours(DateTime? startTime, DateTime? endTime) {
|
|
||||||
// // if (startTime != null && endTime != null) {
|
|
||||||
// // Duration difference = endTime.difference(startTime);
|
|
||||||
// // int hours = difference.inHours;
|
|
||||||
// // int minutes = difference.inMinutes % 60;
|
|
||||||
// // return hours.toDouble();
|
|
||||||
// // } else {
|
|
||||||
// // return -1;
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // assignWorkingHours({required RequestDetailProvider requestDetailProvider}) {
|
|
||||||
// // double hours = calculateWorkingHours(
|
|
||||||
// // requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.startDate, requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.endDate);
|
|
||||||
// // if (hours != -1) {
|
|
||||||
// // _workingHoursController.text = hours.toString();
|
|
||||||
// // requestDetailProvider.activityMaintenanceHelperModel?.modelAssistantEmployees?.workingHours = hours;
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
@ -1,73 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/supplier_details.dart';
|
|
||||||
//
|
|
||||||
// import '../../../providers/work_order/vendor_provider.dart';
|
|
||||||
//
|
|
||||||
// class AutoGeneratedVendorName extends StatefulWidget {
|
|
||||||
// final String initialValue;
|
|
||||||
// final Function(SupplierDetails) onSearch;
|
|
||||||
//
|
|
||||||
// const AutoGeneratedVendorName({Key? key, this.initialValue, this.onSearch}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<AutoGeneratedVendorName> createState() => _AutoGeneratedVendorNameState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AutoGeneratedVendorNameState extends State<AutoGeneratedVendorName> {
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue ?? "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant AutoGeneratedVendorName oldWidget) {
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
//
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue) {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue ?? "");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final vendorProvider = Provider.of<VendorProvider>(context, listen: false);
|
|
||||||
// return TypeAheadField<SupplierDetails>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: const InputDecoration(
|
|
||||||
// hintText: "Vendor Name",
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (vale) async {
|
|
||||||
// // await vendorProvider.getVendors(_controller.text.trim());
|
|
||||||
// // return vendorProvider.vendors;
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, vendor) {
|
|
||||||
// return ListTile(title: Text(vendor.suppliername));
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (hospital) {
|
|
||||||
// widget.onSearch(hospital);
|
|
||||||
// },
|
|
||||||
// ).toShadowContainer(context);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,223 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/search_work_order.dart';
|
|
||||||
// import 'package:test_sa/views/pages/sub_workorder/workorder_list.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/hospitals/hospital_auto_complete_field_new.dart';
|
|
||||||
//
|
|
||||||
// import '../../../controllers/api_routes/http_status_manger.dart';
|
|
||||||
// import '../../../controllers/providers/api/status_drop_down/report/service_report_maintenance_situation_provider.dart';
|
|
||||||
// import '../../../models/new_models/assigned_employee.dart';
|
|
||||||
// import '../../widgets/buttons/app_back_button.dart';
|
|
||||||
// import '../../widgets/buttons/app_button.dart';
|
|
||||||
// import '../../widgets/status/report/service_report_all_users.dart';
|
|
||||||
// import '../../widgets/status/report/service_report_maintenance_situation.dart';
|
|
||||||
// import '../../widgets/status/report/service_report_visit_date_operator.dart';
|
|
||||||
// import '../../widgets/titles/app_sub_title.dart';
|
|
||||||
// todo remove this class after work
|
|
||||||
// class SearchSubWorkOrderPage extends StatefulWidget {
|
|
||||||
// static String id = "/SubWorkOrderPage";
|
|
||||||
//
|
|
||||||
// const SearchSubWorkOrderPage({Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<SearchSubWorkOrderPage> createState() => _SearchSubWorkOrderPageState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _SearchSubWorkOrderPageState extends State<SearchSubWorkOrderPage> {
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
// final SearchWorkOrder _searchWorkOrders = SearchWorkOrder();
|
|
||||||
//
|
|
||||||
// bool _isLoading = false;
|
|
||||||
// String _callerId = "", _site = "";
|
|
||||||
// Lookup _dateOperator;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// if (context.mounted) {
|
|
||||||
// Provider.of<ServiceReportMaintenanceSituationProvider>(context, listen: false).reset();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// body: SafeArea(
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// // color: AColors.primaryColor,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// const ABackButton(),
|
|
||||||
// Expanded(
|
|
||||||
// child: Center(
|
|
||||||
// child: Text(
|
|
||||||
// "Search Work Order",
|
|
||||||
// // style: Theme.of(context).textTheme.titleLarge.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 48,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(16.0),
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Call ID",
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _callerId = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Asset S.N.",
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// if (value != null) {
|
|
||||||
// _searchWorkOrders.assetType = Lookup(name: value);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Work Order No.",
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _searchWorkOrders.workOrderNo = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ASubTitle(context.translation.assignedEmployee),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportAllUsers(
|
|
||||||
// initialValue: _searchWorkOrders.assignedEmployee == null ? null : Employee(id: _searchWorkOrders.assignedEmployee.id, name: _searchWorkOrders.assignedEmployee.name),
|
|
||||||
// onSelect: (engineer) {
|
|
||||||
// _searchWorkOrders.assignedEmployee = AssignedEmployee(id: engineer.id, name: engineer.name);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// const ASubTitle("Maintenance Situation"),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportMaintenanceSituation(
|
|
||||||
// initialValue: _searchWorkOrders.calllastSituation,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// if (status?.value == 12 || _searchWorkOrders.calllastSituation?.value == 12) {
|
|
||||||
// _searchWorkOrders.calllastSituation = status;
|
|
||||||
// setState(() {});
|
|
||||||
// } else {
|
|
||||||
// _searchWorkOrders.calllastSituation = status;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// woId: _searchWorkOrders.id?.toString(),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// HospitalAutoCompleteField(
|
|
||||||
// initialValue: _site,
|
|
||||||
// onSearch: (value) {
|
|
||||||
// _site = value.name;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ASubTitle(context.translation.visitDate),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportVisitDateOperator(
|
|
||||||
// initialValue: _dateOperator,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// _dateOperator = status;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: ADatePicker(
|
|
||||||
// date: DateTime.tryParse(_searchWorkOrders.visitDate ?? ""),
|
|
||||||
// from: DateTime(1950),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _searchWorkOrders.visitDate = date?.toIso8601String();
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 100),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
|
||||||
// floatingActionButton: _isLoading
|
|
||||||
// ? const CircularProgressIndicator()
|
|
||||||
// : Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// child: AButton(
|
|
||||||
// text: context.translation.search,
|
|
||||||
// onPressed: () async {
|
|
||||||
// _isLoading = true;
|
|
||||||
// setState(() {});
|
|
||||||
// if (_formKey.currentState?.validate() ?? false) {}
|
|
||||||
// _formKey.currentState?.save();
|
|
||||||
// final serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context, listen: false);
|
|
||||||
// serviceRequestsProvider.reset();
|
|
||||||
// final List<SearchWorkOrder> woList = await serviceRequestsProvider.searchForWorkOrders(
|
|
||||||
// _searchWorkOrders,
|
|
||||||
// _callerId,
|
|
||||||
// _dateOperator,
|
|
||||||
// _site,
|
|
||||||
// );
|
|
||||||
// _isLoading = false;
|
|
||||||
// setState(() {});
|
|
||||||
// if (serviceRequestsProvider.stateCode >= 200 && serviceRequestsProvider.stateCode < 300) {
|
|
||||||
// Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(
|
|
||||||
// builder: (context) => WorkOrderList(
|
|
||||||
// items: woList,
|
|
||||||
// onLazyLoading: () async {
|
|
||||||
// return await serviceRequestsProvider.searchForWorkOrders(
|
|
||||||
// _searchWorkOrders,
|
|
||||||
// _callerId,
|
|
||||||
// _dateOperator,
|
|
||||||
// _site,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// String errorMessage = HttpStatusManger.getStatusMessage(status: serviceRequestsProvider.stateCode, subtitle: context.translation);
|
|
||||||
// ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(errorMessage)));
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,215 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/search_work_order.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/service_request/spare_parts.dart';
|
|
||||||
// import '../../app_style/sizing.dart';
|
|
||||||
// import '../../widgets/app_text_form_field.dart';
|
|
||||||
// import '../../widgets/buttons/app_button.dart';
|
|
||||||
// import '../../widgets/parts/part_item.dart';
|
|
||||||
// import '../../widgets/titles/app_sub_title.dart';
|
|
||||||
//
|
|
||||||
// class SparePartsBottomSheet extends StatefulWidget {
|
|
||||||
// final SearchWorkOrder subWorkOrder;
|
|
||||||
// final num assetId;
|
|
||||||
//
|
|
||||||
// const SparePartsBottomSheet({this.subWorkOrder, this.assetId, Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<SparePartsBottomSheet> createState() => _SparePartsBottomSheetState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _SparePartsBottomSheetState extends State<SparePartsBottomSheet> {
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
// final SearchWorkOrder _workOrder = SearchWorkOrder();
|
|
||||||
// bool _validate = false;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _workOrder.copyFrom(widget.subWorkOrder);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _workOrder.sparePartsWorkOrders = widget.subWorkOrder.sparePartsWorkOrders;
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final size = MediaQuery.of(context).size;
|
|
||||||
//
|
|
||||||
// return Padding(
|
|
||||||
// padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: const BorderRadius.only(
|
|
||||||
// topLeft: Radius.circular(15),
|
|
||||||
// topRight: Radius.circular(15),
|
|
||||||
// ),
|
|
||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
// child: Container(
|
|
||||||
// color: Colors.white,
|
|
||||||
// height: size.height * 0.9,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// const ASubTitle("Spare Parts"),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// Expanded(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// width: double.infinity,
|
|
||||||
// padding: const EdgeInsets.all(16),
|
|
||||||
// margin: const EdgeInsets.symmetric(vertical: 16),
|
|
||||||
// // decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: const [
|
|
||||||
// // BoxShadow(
|
|
||||||
// // color: AColors.grey,
|
|
||||||
// // offset: Offset(0, -1),
|
|
||||||
// // )
|
|
||||||
// // ]),
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// flex: 3,
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// ASubTitle(context.translation.partNumber),
|
|
||||||
// _validate && _workOrder.sparePartsWorkOrders == null
|
|
||||||
// ? ASubTitle(
|
|
||||||
// context.translation.requiredWord,
|
|
||||||
// color: Colors.red,
|
|
||||||
// )
|
|
||||||
// : const SizedBox.shrink(),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// // AutoCompletePartsField(
|
|
||||||
// // assetId: widget.assetId,
|
|
||||||
// // onPick: (part) {
|
|
||||||
// // _workOrder.sparePartsWorkOrders ??= [];
|
|
||||||
// // _workOrder.sparePartsWorkOrders.add(SparePartsWorkOrders(
|
|
||||||
// // id: part.reportPartID,
|
|
||||||
// // qty: part.quantity,
|
|
||||||
// // sparePart: SparePart(id: part.id, partName: part.partName, partNo: part.partNo),
|
|
||||||
// // installQty: part.installQty,
|
|
||||||
// // returnQty: part.returnQty,
|
|
||||||
// // ));
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// if (_workOrder.sparePartsWorkOrders?.isNotEmpty ?? false)
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(flex: 3, child: Text(context.translation.number)),
|
|
||||||
// Expanded(flex: 1, child: Text(context.translation.quantity)),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (_workOrder.sparePartsWorkOrders?.isNotEmpty ?? false)
|
|
||||||
// Column(
|
|
||||||
// children: List.generate(
|
|
||||||
// _workOrder.sparePartsWorkOrders?.length,
|
|
||||||
// (index) {
|
|
||||||
// final spare = _workOrder.sparePartsWorkOrders[index];
|
|
||||||
// SparePartsWorkOrders part = SparePartsWorkOrders(
|
|
||||||
// id: spare.sparePart?.id,
|
|
||||||
// sparePart: SparePart(
|
|
||||||
// id: spare.id,
|
|
||||||
// partNo: spare.sparePart?.partNo,
|
|
||||||
// partName: spare.sparePart?.partName,
|
|
||||||
// ),
|
|
||||||
// qty: spare.qty?.toInt(),
|
|
||||||
// installQty: spare.installQty,
|
|
||||||
// returnQty: spare.returnQty,
|
|
||||||
// );
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// PartItem(
|
|
||||||
// part: part,
|
|
||||||
// onEdit: (qty) {
|
|
||||||
// spare.qty = qty;
|
|
||||||
// },
|
|
||||||
// onDelete: (part) {
|
|
||||||
// _workOrder.sparePartsWorkOrders.remove(spare);
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// if (_workOrder.calllastSituation?.name?.toLowerCase()?.contains("part installation") ?? false)
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: ATextFormField(
|
|
||||||
// initialValue: part?.returnQty?.toString(),
|
|
||||||
// labelText: "Return Quantity",
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// spare.returnQty = num.tryParse(value)?.toDouble();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(width: 8),
|
|
||||||
// Expanded(
|
|
||||||
// child: ATextFormField(
|
|
||||||
// initialValue: part?.installQty?.toString(),
|
|
||||||
// labelText: "Install Quantity",
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// spare.installQty = num.tryParse(value)?.toDouble();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 24),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// AButton(
|
|
||||||
// text: context.translation.submit,
|
|
||||||
// onPressed: () async {
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// widget.subWorkOrder.copyFrom(_workOrder);
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,253 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/search_work_order.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/supplier_details.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/report/service_report_assistant_employee_menu.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/report/service_report_maintenance_situation.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/report/service_report_repair_location.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/service_request/supplier_engineers_menu.dart';
|
|
||||||
//
|
|
||||||
// import '../../../controllers/providers/api/status_drop_down/report/service_report_maintenance_situation_provider.dart';
|
|
||||||
// import '../../../models/service_request/supp_engineer_work_orders.dart';
|
|
||||||
// import '../../widgets/timer/app_timer.dart';
|
|
||||||
// import '../../widgets/titles/app_sub_title.dart';
|
|
||||||
// import 'auto_generated_vendor_name.dart';
|
|
||||||
//
|
|
||||||
// class WorkOrderDetailsBottomSheet extends StatefulWidget {
|
|
||||||
// final SearchWorkOrder subWorkOrder;
|
|
||||||
// final num assetId;
|
|
||||||
//
|
|
||||||
// const WorkOrderDetailsBottomSheet({this.subWorkOrder, this.assetId, Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<WorkOrderDetailsBottomSheet> createState() => _WorkOrderDetailsBottomSheetState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _WorkOrderDetailsBottomSheetState extends State<WorkOrderDetailsBottomSheet> {
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
// final SearchWorkOrder _workOrder = SearchWorkOrder();
|
|
||||||
// bool _showVendorFields = false;
|
|
||||||
// SuppEngineerWorkOrders engineer;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _workOrder.copyFrom(widget.subWorkOrder);
|
|
||||||
// if (checkVendorFieldsVisibility(_workOrder.calllastSituation)) {
|
|
||||||
// if (_workOrder.suppEngineerWorkOrders?.isNotEmpty ?? false) {
|
|
||||||
// engineer = _workOrder.suppEngineerWorkOrders?.last;
|
|
||||||
// engineer?.id = engineer?.supplierContactId;
|
|
||||||
// }
|
|
||||||
// _workOrder.supplier ??= SupplierDetails(id: _workOrder?.supplier?.id);
|
|
||||||
// }
|
|
||||||
// if (context.mounted) {
|
|
||||||
// Provider.of<ServiceReportMaintenanceSituationProvider>(context, listen: false).reset();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// bool checkVendorFieldsVisibility(Lookup callsLastSituation) {
|
|
||||||
// bool result = (_workOrder.supplier?.suppliername?.isNotEmpty ?? false) ||
|
|
||||||
// (callsLastSituation?.name?.toLowerCase()?.contains("under repair-vendor") ?? false) ||
|
|
||||||
// (callsLastSituation?.name?.toLowerCase()?.contains("waiting for vendor") ?? false);
|
|
||||||
// _showVendorFields = result;
|
|
||||||
// return result;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final size = MediaQuery.of(context).size;
|
|
||||||
//
|
|
||||||
// return Padding(
|
|
||||||
// padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: const BorderRadius.only(
|
|
||||||
// topLeft: Radius.circular(15),
|
|
||||||
// topRight: Radius.circular(15),
|
|
||||||
// ),
|
|
||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
// child: Container(
|
|
||||||
// color: Colors.white,
|
|
||||||
// height: size.height * 0.9,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// const ASubTitle("WO Details"),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// Expanded(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// ATextFormField(enable: false, hintText: "Assigned Employee: ${_workOrder.assignedEmployee?.name}"),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// const ASubTitle("Assistant Employee"),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportAssistantEmployeeMenu(
|
|
||||||
// assetId: widget.assetId,
|
|
||||||
// initialValue: (_workOrder.assistantEmployees?.isNotEmpty ?? false) ? _workOrder.assistantEmployees?.first : null,
|
|
||||||
// onSelect: (assistantsEmployee) {
|
|
||||||
// if (assistantsEmployee == null) {
|
|
||||||
// _workOrder.assistantEmployees = [];
|
|
||||||
// } else {
|
|
||||||
// _workOrder.assistantEmployees = [assistantsEmployee];
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// ASubTitle(context.translation.workingHours),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: AppTimer(
|
|
||||||
// timer: _workOrder.timer,
|
|
||||||
// onChange: (timer) async {
|
|
||||||
// _workOrder.timer = timer;
|
|
||||||
// _workOrder.workingHours = num.tryParse((((timer?.durationInSecond ?? 0) / 60) / 60)?.toStringAsFixed(2) ?? "0");
|
|
||||||
// return true;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 16),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Travel Hours",
|
|
||||||
// initialValue: _workOrder.travelingHours?.toString(),
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _workOrder.travelingHours = num.tryParse(value);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Travel Expense",
|
|
||||||
// initialValue: _workOrder.travelingExpenses?.toString(),
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _workOrder.travelingExpenses = num.tryParse(value);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// ASubTitle(context.translation.callLastSituation),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportMaintenanceSituation(
|
|
||||||
// initialValue: _workOrder.calllastSituation,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// if (checkVendorFieldsVisibility(status)) {
|
|
||||||
// _workOrder.supplier ??= SupplierDetails(id: _workOrder?.supplier?.id);
|
|
||||||
// engineer = null;
|
|
||||||
// }
|
|
||||||
// if (status?.value == 12 || _workOrder.calllastSituation?.value == 12) {
|
|
||||||
// _workOrder.calllastSituation = status;
|
|
||||||
// _workOrder.mrNumber = null;
|
|
||||||
// setState(() {});
|
|
||||||
// } else {
|
|
||||||
// _workOrder.calllastSituation = status;
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// woId: widget.subWorkOrder?.parentWOId?.toString(),
|
|
||||||
// ),
|
|
||||||
// if (_workOrder.calllastSituation.value == 12) const ASubTitle(" You have to add parts", color: Colors.amber, padding: EdgeInsets.all(2), font: 11),
|
|
||||||
// if (_workOrder.calllastSituation.value == 12) const SizedBox(height: 8),
|
|
||||||
// if (_workOrder.calllastSituation.value == 12)
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "MR number",
|
|
||||||
// initialValue: _workOrder.mrNumber,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _workOrder.mrNumber = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// if (_showVendorFields) const SizedBox(height: 8),
|
|
||||||
// if (_showVendorFields)
|
|
||||||
// AutoGeneratedVendorName(
|
|
||||||
// initialValue: _workOrder.supplier?.suppliername,
|
|
||||||
// onSearch: (supplier) {
|
|
||||||
// _workOrder.supplier.id = supplier.id;
|
|
||||||
// _workOrder.supplier.suppliername = supplier.suppliername;
|
|
||||||
// _workOrder.supplier.suppPersons = supplier.suppPersons;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// if (_showVendorFields) const SizedBox(height: 8),
|
|
||||||
// if (_showVendorFields)
|
|
||||||
// SupplierEngineersMenu(
|
|
||||||
// initialValue: engineer,
|
|
||||||
// engineers: _workOrder?.supplier?.suppPersons,
|
|
||||||
// onSelect: (engineer) {
|
|
||||||
// if (engineer != null) {
|
|
||||||
// this.engineer = engineer;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// const ASubTitle("Repair Location"),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportRepairLocation(
|
|
||||||
// initialValue: _workOrder.repairLocation,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// _workOrder.repairLocation = status;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Technical Comments",
|
|
||||||
// initialValue: _workOrder.comment,
|
|
||||||
// textInputType: TextInputType.multiline,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _workOrder.comment = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 24),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// AButton(
|
|
||||||
// text: context.translation.submit,
|
|
||||||
// onPressed: () async {
|
|
||||||
// if (_workOrder?.workingHours == null) {
|
|
||||||
// await Fluttertoast.showToast(msg: "Working Hours Timer Isn't Started");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (_showVendorFields && (_workOrder.supplier.suppliername == null || _workOrder.supplier.suppliername.isEmpty)) {
|
|
||||||
// await Fluttertoast.showToast(msg: "Vendor Name Field is Required");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (_showVendorFields && _workOrder.suppEngineerWorkOrders == null) {
|
|
||||||
// await Fluttertoast.showToast(msg: "Vendor Engineer Field is Required");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _workOrder.suppEngineerWorkOrders ?? [];
|
|
||||||
// if (engineer != null) _workOrder.suppEngineerWorkOrders.add(engineer..id = 0);
|
|
||||||
// if (_workOrder.calllastSituation == null) {
|
|
||||||
// await Fluttertoast.showToast(msg: "Call Last Situation Field is Required");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// widget.subWorkOrder.copyFrom(_workOrder);
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/service_request/search_work_order.dart';
|
|
||||||
//
|
|
||||||
// class WorkOrderDetails extends StatelessWidget {
|
|
||||||
// final SearchWorkOrder item;
|
|
||||||
// final Lookup assetType;
|
|
||||||
//
|
|
||||||
// const WorkOrderDetails({required this.item, this.assetType, Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// _buildRow(context.translation.callId, item.callRequest?.id?.toString() ?? "", context),
|
|
||||||
// _buildRow(context.translation.assetNumber, item.callRequest?.asset?.assetNumber ?? "", context),
|
|
||||||
// _buildRow("WO No", item.workOrderNo, context),
|
|
||||||
// _buildRow(context.translation.assetName, item.callRequest?.asset?.assetNumber ?? '', context),
|
|
||||||
// _buildRow(context.translation.department, item.callRequest?.asset?.department ?? '', context),
|
|
||||||
// _buildRow(context.translation.assetSN, item.callRequest?.asset?.assetSerialNo ?? '', context),
|
|
||||||
// _buildRow(context.translation.assetType, assetType?.name ?? (item.assetType?.name ?? ""), context),
|
|
||||||
// _buildRow(context.translation.model, item.callRequest?.asset?.modelDefinition?.modelName ?? "", context),
|
|
||||||
// _buildRow(context.translation.manufacture, item.callRequest?.asset?.modelDefinition?.manufacturerName ?? "", context),
|
|
||||||
// _buildRow(context.translation.site, item.callRequest?.asset?.site?.custName ?? "", context),
|
|
||||||
// ],
|
|
||||||
// ).toShadowContainer(context);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Widget _buildRow(String title, String value, BuildContext context) {
|
|
||||||
// return Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// "$title: $value".bodyText(context),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,152 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/service_request/search_work_order.dart';
|
|
||||||
//
|
|
||||||
// class WorkOrderItem extends StatelessWidget {
|
|
||||||
// final int index;
|
|
||||||
// final SearchWorkOrder item;
|
|
||||||
// final Function(SearchWorkOrder) onPressed;
|
|
||||||
//
|
|
||||||
// const WorkOrderItem({Key? key, this.item, this.onPressed, this.index}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// Color itemColor = index % 2 == 0 ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onPrimary;
|
|
||||||
// Color onItemColor = index % 2 != 0 ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onPrimary;
|
|
||||||
//
|
|
||||||
// return Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 4),
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
|
|
||||||
// backgroundColor: itemColor,
|
|
||||||
// shape: RoundedRectangleBorder(
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// onPressed: () {
|
|
||||||
// item.callRequest.status.value == 5 || item.callRequest.status.value == 3
|
|
||||||
// ? Fluttertoast.showToast(
|
|
||||||
// msg: "Request is ${item.callRequest.status.name}. No more sub work orders will be create.",
|
|
||||||
// toastLength: Toast.LENGTH_LONG,
|
|
||||||
// gravity: ToastGravity.BOTTOM,
|
|
||||||
// )
|
|
||||||
// : onPressed(item);
|
|
||||||
// },
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// item.callRequest.callNo ?? "-----",
|
|
||||||
// style: Theme.of(context).textTheme.headline6.copyWith(color: onItemColor, fontSize: 16, fontWeight: FontWeight.bold),
|
|
||||||
// ),
|
|
||||||
// // Text(
|
|
||||||
// // item.callRequest.asset.id.toString(),
|
|
||||||
// // style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// // color: onItemColor,
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// Row(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// "Asset Name:",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// 8.width,
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// //CallRequest.Asset.ModelDefinition.AssetND
|
|
||||||
// // .AssetName
|
|
||||||
// item.callRequest.asset.modelDefinition.assetName,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// "Asset Number:",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// //if (item.clientName != null)
|
|
||||||
// Text(
|
|
||||||
// item.callRequest.asset.assetNumber,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// "Asset SN:",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// //if (item.clientName != null)
|
|
||||||
// Text(
|
|
||||||
// item.callRequest.asset.assetSerialNo,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// item.currentSituation.name,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Divider(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// context.translation.status,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// color: onItemColor,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// // if (item.callRequest.status?.id != null) StatusLabel(label: item.callRequest.status.name, backgroundColor: AColors.getGasStatusColor(item.callRequest.status.id)),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/pages/sub_workorder/workorder_item.dart';
|
|
||||||
//
|
|
||||||
// import '../../../controllers/providers/api/service_requests_provider.dart';
|
|
||||||
// import '../../../models/service_request/search_work_order.dart';
|
|
||||||
// import '../../widgets/buttons/app_back_button.dart';
|
|
||||||
// import '../../widgets/loaders/lazy_loading.dart';
|
|
||||||
// import '../../widgets/loaders/no_data_found.dart';
|
|
||||||
// import 'create_sub_workorder_page.dart';
|
|
||||||
//// todo remove this class after work
|
|
||||||
// class WorkOrderList extends StatefulWidget {
|
|
||||||
// List<SearchWorkOrder> items;
|
|
||||||
// final Future<List<SearchWorkOrder>> Function() onLazyLoading;
|
|
||||||
//
|
|
||||||
// WorkOrderList({Key? key, this.items, this.onLazyLoading}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<WorkOrderList> createState() => _WorkOrderListState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _WorkOrderListState extends State<WorkOrderList> {
|
|
||||||
// List<SearchWorkOrder> _items;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _items = widget.items;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context, listen: false);
|
|
||||||
//
|
|
||||||
// return Scaffold(
|
|
||||||
// body: SafeArea(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// // color: AColors.primaryColor,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// const ABackButton(),
|
|
||||||
// Expanded(
|
|
||||||
// child: Center(
|
|
||||||
// child: Text(
|
|
||||||
// "Work Order List",
|
|
||||||
// // style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(width: 48),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Expanded(
|
|
||||||
// child: _items?.isEmpty ?? []
|
|
||||||
// ? NoItemFound(
|
|
||||||
// message: context.translation.noServiceRequestFound,
|
|
||||||
// )
|
|
||||||
// : LazyLoading(
|
|
||||||
// nextPage: serviceRequestsProvider.nextPage,
|
|
||||||
// onLazyLoad: () async {
|
|
||||||
// _items = await widget.onLazyLoading();
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// child: ListView.builder(
|
|
||||||
// itemCount: _items.length,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
||||||
// itemBuilder: (context, itemIndex) {
|
|
||||||
// return WorkOrderItem(
|
|
||||||
// index: itemIndex,
|
|
||||||
// onPressed: (model) {
|
|
||||||
// // Navigator.of(context).push(MaterialPageRoute(
|
|
||||||
// // builder: (_) => WorkOrderUpdate(item: model,)));
|
|
||||||
// Navigator.push(
|
|
||||||
// context,
|
|
||||||
// MaterialPageRoute(builder: (context) => CreateSubWorkOrderPage(workOrder: model)),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// item: _items[itemIndex],
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,64 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/pages/sub_workorder/workorder_details.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/service_request/search_work_order.dart';
|
|
||||||
// import '../../widgets/buttons/app_back_button.dart';
|
|
||||||
// import '../../widgets/loaders/loading_manager.dart';
|
|
||||||
//
|
|
||||||
// class WorkOrderUpdate extends StatefulWidget {
|
|
||||||
// final SearchWorkOrder item;
|
|
||||||
//
|
|
||||||
// const WorkOrderUpdate({required this.item, Key? key}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<WorkOrderUpdate> createState() => _WorkOrderUpdateState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _WorkOrderUpdateState extends State<WorkOrderUpdate> {
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
//
|
|
||||||
// bool _isLoading = false;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// body: SafeArea(
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: LoadingManager(
|
|
||||||
// isLoading: _isLoading,
|
|
||||||
// isFailedLoading: false,
|
|
||||||
// stateCode: 200,
|
|
||||||
// onRefresh: () async {},
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// color: Theme.of(context).colorScheme.primary,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// const ABackButton(),
|
|
||||||
// Expanded(
|
|
||||||
// child: Center(
|
|
||||||
// child: Text(
|
|
||||||
// "Work Order",
|
|
||||||
// // style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(width: 58),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// WorkOrderDetails(
|
|
||||||
// item: widget.item,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/ppm/ppm.dart';
|
|
||||||
//
|
|
||||||
// class FutureEditPpm extends StatefulWidget {
|
|
||||||
// final Ppm ppm;
|
|
||||||
//
|
|
||||||
// const FutureEditPpm({Key? key, this.ppm}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<FutureEditPpm> createState() => _FutureEditPpmState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _FutureEditPpmState extends State<FutureEditPpm> {
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// //String requestId = ModalRoute.of(context).settings.arguments;
|
|
||||||
//
|
|
||||||
// // return Scaffold(
|
|
||||||
// // body: FutureBuilder<Pentry>(
|
|
||||||
// // future: RegularVisitsProvider().getPentry(user: _userProvider.user, host: _settingProvider.host, id: widget.ppm.id),
|
|
||||||
// // builder: (BuildContext context, AsyncSnapshot<Pentry> snapshot) {
|
|
||||||
// // if (snapshot.hasError) {
|
|
||||||
// // return FailedLoading(
|
|
||||||
// // message: context.translation.failedToCompleteRequest,
|
|
||||||
// // onReload: () {
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // if (snapshot.hasData) {
|
|
||||||
// // return EditPentry(
|
|
||||||
// // pentry: snapshot.data,
|
|
||||||
// // ppm: widget.ppm,
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// // return const Center(child: ALoading());
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,177 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/validator/validator.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/issue.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/service_request.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/issues/report_issue_item.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
//
|
|
||||||
// class ReportIssuesPage extends StatefulWidget {
|
|
||||||
// static final String id = "/report-issue";
|
|
||||||
// final ServiceRequest serviceRequest;
|
|
||||||
// todo delete
|
|
||||||
// const ReportIssuesPage({Key? key, required this.serviceRequest}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _ReportIssuesPageState createState() => _ReportIssuesPageState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _ReportIssuesPageState extends State<ReportIssuesPage> {
|
|
||||||
// List<String> _issues = [];
|
|
||||||
// Issue _issue = Issue(reports: []);
|
|
||||||
// late double _height;
|
|
||||||
// bool _isLoading = false;
|
|
||||||
// late ServiceRequestsProvider _serviceRequestsProvider;
|
|
||||||
// late UserProvider _userProvider;
|
|
||||||
// late SettingProvider _settingProvider;
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// _height = MediaQuery.of(context).size.height;
|
|
||||||
//
|
|
||||||
// return Scaffold(
|
|
||||||
// body: SafeArea(
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: LoadingManager(
|
|
||||||
// onRefresh: () async {},
|
|
||||||
// stateCode: 200,
|
|
||||||
// isFailedLoading: false,
|
|
||||||
// isLoading: _isLoading,
|
|
||||||
// child: Stack(
|
|
||||||
// children: [
|
|
||||||
// SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Center(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 16 * AppStyle.getScaleFactor(context),
|
|
||||||
// vertical: 24 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// context.translation.reportIssue,
|
|
||||||
// // style: Theme.of(context).textTheme.headline5.copyWith(color: AColors.cyan, fontWeight: FontWeight.bold),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Image(
|
|
||||||
// height: _height / 8,
|
|
||||||
// image: AssetImage("assets/images/logo.png"),
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// padding: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 16,
|
|
||||||
// vertical: 16,
|
|
||||||
// ),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.grey,
|
|
||||||
// borderRadius: BorderRadius.only(
|
|
||||||
// topLeft: Radius.circular(AppStyle.getBorderRadius(context)),
|
|
||||||
// topRight: Radius.circular(AppStyle.getBorderRadius(context)),
|
|
||||||
// ),
|
|
||||||
// boxShadow: [
|
|
||||||
// BoxShadow(
|
|
||||||
// // color: AColors.grey,
|
|
||||||
// offset: Offset(0, -1),
|
|
||||||
// )
|
|
||||||
// ]),
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: _issue?.title,
|
|
||||||
// hintText: context.translation.title,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// validator: (value) => Validator.hasValue(value ?? "") ? null : context.translation.titleValidateMessage,
|
|
||||||
// textInputType: TextInputType.name,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _issue.title = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8,
|
|
||||||
// ),
|
|
||||||
// Column(
|
|
||||||
// children: List.generate(
|
|
||||||
// _issues.length,
|
|
||||||
// (index) => ReportIssueItem(
|
|
||||||
// isSelected: _issue.reports!.contains(index) ?? false,
|
|
||||||
// issueInfo: _issues[index],
|
|
||||||
// onChange: (info, value) {
|
|
||||||
// if (value) {
|
|
||||||
// _issue.reports!.add(index);
|
|
||||||
// } else {
|
|
||||||
// _issue.reports!.remove(index);
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ))),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Text(
|
|
||||||
// "${context.translation.shareAntherIssue} :",
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// hintText: context.translation.description,
|
|
||||||
// style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// textInputType: TextInputType.multiline,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _issue.description = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: AButton(
|
|
||||||
// text: context.translation.submit,
|
|
||||||
// onPressed: () async {
|
|
||||||
// if (!_formKey.currentState!.validate()) return;
|
|
||||||
// _formKey.currentState!.save();
|
|
||||||
// _issue.serviceRequestId = widget.serviceRequest.id;
|
|
||||||
// _isLoading = true;
|
|
||||||
// setState(() {});
|
|
||||||
// int status = await _serviceRequestsProvider.createIssueReport(user: _userProvider.user!, host: _settingProvider.host!, issue: _issue);
|
|
||||||
// _isLoading = false;
|
|
||||||
// setState(() {});
|
|
||||||
// if (status >= 200 && status < 300) {
|
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: context.translation.successfulRequestMessage,
|
|
||||||
// );
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// }
|
|
||||||
// _isLoading = false;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ABackButton(),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/service_request.dart';
|
|
||||||
// import 'package:test_sa/views/pages/user/requests/service_request_details.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/app_loading.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/failed_loading.dart';
|
|
||||||
//
|
|
||||||
// class FutureRequestServiceDetails extends StatefulWidget {
|
|
||||||
// static final String id = "/service-request-details";
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _FutureRequestServiceDetailsState createState() => _FutureRequestServiceDetailsState();
|
|
||||||
// }
|
|
||||||
// todo delete
|
|
||||||
// class _FutureRequestServiceDetailsState extends State<FutureRequestServiceDetails> {
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// String requestId = ModalRoute.of(context).settings.arguments;
|
|
||||||
//
|
|
||||||
// return Scaffold(
|
|
||||||
// body: FutureBuilder<ServiceRequest>(
|
|
||||||
// future: ServiceRequestsProvider().getSingleServiceRequest(requestId: requestId, user: _userProvider.user, host: _settingProvider.host, subtitle: context.translation),
|
|
||||||
// builder: (BuildContext context, AsyncSnapshot<ServiceRequest> snapshot) {
|
|
||||||
// if (snapshot.hasError) {
|
|
||||||
// return FailedLoading(
|
|
||||||
// message: snapshot.error.toString(),
|
|
||||||
// onReload: () {
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// if (snapshot.hasData) {
|
|
||||||
// return ServiceRequestDetailsPage(
|
|
||||||
// serviceRequest: snapshot.data,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// return Center(child: ALoading());
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AppNameBar extends StatelessWidget {
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// height: 50 * AppStyle.getScaleFactor(context),
|
|
||||||
// // color: AColors.primaryColor,
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Center(
|
|
||||||
// child: Text(
|
|
||||||
// "Test SA",
|
|
||||||
// style: Theme.of(context).textTheme.headline6.copyWith(/*color: AColors.white,*/ fontStyle: FontStyle.italic),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AFlatButton extends StatelessWidget {
|
|
||||||
// final String text;
|
|
||||||
// final Color textColor;
|
|
||||||
// final TextStyle style;
|
|
||||||
// final EdgeInsets padding;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
//
|
|
||||||
// const AFlatButton({Key? key, this.text, this.textColor, this.style, this.onPressed, this.padding}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return TextButton(
|
|
||||||
// style: TextButton.styleFrom(
|
|
||||||
// foregroundColor: this.textColor ?? Colors.black,
|
|
||||||
// padding: padding,
|
|
||||||
// ),
|
|
||||||
// onPressed: onPressed,
|
|
||||||
// child: Text(
|
|
||||||
// text ?? "",
|
|
||||||
// style: style ?? Theme.of(context).textTheme.bodyText1,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AIconButton2 extends StatelessWidget {
|
|
||||||
// final IconData iconData;
|
|
||||||
// final Color color;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
//
|
|
||||||
// const AIconButton2({todo delete
|
|
||||||
// Key? key,
|
|
||||||
// this.iconData,
|
|
||||||
// this.onPressed,
|
|
||||||
// this.color,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Material(
|
|
||||||
// color: Colors.transparent,
|
|
||||||
// child: IconButton(
|
|
||||||
// highlightColor: color?.withOpacity(.5) ?? Theme.of(context).colorScheme.secondary.withOpacity(.5),
|
|
||||||
// color: color ?? Theme.of(context).colorScheme.secondary,
|
|
||||||
// icon: FaIcon(
|
|
||||||
// iconData,
|
|
||||||
// size: 24 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// onPressed: onPressed,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AOutLinedButton extends StatelessWidget {
|
|
||||||
// final String text;
|
|
||||||
// final Color color;
|
|
||||||
// final EdgeInsets padding;
|
|
||||||
// final TextStyle textStyle;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
//
|
|
||||||
// const AOutLinedButton({Key? key, this.color/*= AColors.primaryColor*/, this.text, this.padding, this.onPressed, this.textStyle}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return OutlinedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// padding: padding ?? EdgeInsets.symmetric(vertical: 12),
|
|
||||||
// textStyle: textStyle ?? Theme.of(context).textTheme.subtitle2.copyWith(fontSize: 18),
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context))),
|
|
||||||
// ),
|
|
||||||
// onPressed: onPressed,
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// text ?? "",
|
|
||||||
// // style: Theme.of(context).textTheme.subtitle2.copyWith(color: AColors.primaryColor, fontSize: 14, fontWeight: FontWeight.w600),
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class ASmallButton extends StatelessWidget {
|
|
||||||
// final String text;
|
|
||||||
// final TextStyle style;
|
|
||||||
// final Color color;
|
|
||||||
// final EdgeInsets padding;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
//
|
|
||||||
// const ASmallButton({Key? key, this.text, this.style, this.onPressed, this.padding, this.color}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// padding: padding,
|
|
||||||
// primary: color ?? Theme.of(context).primaryColor,
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// text ?? "",
|
|
||||||
// style: style ?? Theme.of(context).textTheme.bodyText1.copyWith(color: color == Colors.white ? Theme.of(context).primaryColor : Colors.white),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// onPressed: onPressed);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
//
|
|
||||||
// class RoundedBackButton extends StatelessWidget {
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
// final IconData icon;
|
|
||||||
// final Color backgroundColor;
|
|
||||||
// final Color iconColor; todo delete
|
|
||||||
//
|
|
||||||
// const RoundedBackButton({Key? key, this.onPressed,required this.icon,this.backgroundColor,this.iconColor}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.only(left: 8),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// shape: BoxShape.circle,
|
|
||||||
// color: backgroundColor??Colors.blue, // Background color of the circle
|
|
||||||
// ),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8),
|
|
||||||
// child: Icon(
|
|
||||||
// icon,
|
|
||||||
// color: iconColor??Colors.white,
|
|
||||||
// size: 22, // Adjust the icon size as needed
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
//
|
|
||||||
// class CarveInImage extends CustomClipper<Path> {
|
|
||||||
// final double gab;
|
|
||||||
// var radius = 10.0;
|
|
||||||
//
|
|
||||||
// CarveInImage(this.gab);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Path getClip(Size size) {
|
|
||||||
// Path path = Path();
|
|
||||||
// path.lineTo(0, size.height);
|
|
||||||
// path.lineTo(size.width / 2 - gab / 2, size.height);
|
|
||||||
// path.arcToPoint(Offset(size.width / 2 + gab / 2, size.height), radius: Radius.circular(gab / 2));
|
|
||||||
// path.lineTo(size.width, size.height);
|
|
||||||
// path.lineTo(size.width, 0);
|
|
||||||
// path.lineTo(0, 0);
|
|
||||||
// return path;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// bool shouldReclip(CustomClipper<Path> oldClipper) => true;
|
|
||||||
// }
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import 'date_picker.dart';
|
|
||||||
//
|
|
||||||
// class FromToDateBar extends StatefulWidget {
|
|
||||||
// final DateTime from;
|
|
||||||
// final DateTime to;
|
|
||||||
// final Function(DateTime) onPickFrom;
|
|
||||||
// final Function(DateTime) onPickTo;
|
|
||||||
//
|
|
||||||
// const FromToDateBar({Key? key, this.from, this.to, this.onPickFrom, this.onPickTo}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _FromToDateBarState createState() => _FromToDateBarState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _FromToDateBarState extends State<FromToDateBar> {
|
|
||||||
// DateTime _from;
|
|
||||||
// DateTime _to;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _from = widget.from;
|
|
||||||
// _to = widget.to;
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
// children: [
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// context.translation.from,
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.normal),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ADatePicker(
|
|
||||||
// date: _from,
|
|
||||||
// from: DateTime(1950),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _from = date;
|
|
||||||
// setState(() {});
|
|
||||||
// widget.onPickFrom(date);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// context.translation.to,
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.normal),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ADatePicker(
|
|
||||||
// date: _to,
|
|
||||||
// from: DateTime(1950),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _to = date;
|
|
||||||
// setState(() {});
|
|
||||||
// widget.onPickTo(date);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox.shrink(),
|
|
||||||
// SizedBox.shrink(),
|
|
||||||
// SizedBox.shrink(),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/department.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/departments/single_department_picker.dart';
|
|
||||||
//
|
|
||||||
// class DepartmentButton extends StatelessWidget {
|
|
||||||
// final Function(Department) onDepartmentPick;
|
|
||||||
// final Department department;
|
|
||||||
//
|
|
||||||
// const DepartmentButton({Key? key, this.department, this.onDepartmentPick}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// elevation: 0,
|
|
||||||
// padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
|
||||||
// shape: RoundedRectangleBorder(
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// ),
|
|
||||||
// // foregroundColor: AColors.primaryColor,
|
|
||||||
// // backgroundColor: AColors.inputFieldBackgroundColor,
|
|
||||||
// ),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
// child: Text(
|
|
||||||
// department?.name ?? context.translation.pickUnite,
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// textDirection: TextDirection.rtl,
|
|
||||||
// textAlign: TextAlign.left,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// // const Icon(Icons.keyboard_arrow_down, size: 28, color: AColors.grey3A),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// onPressed: () async {
|
|
||||||
// Department _department = await Navigator.of(context).pushNamed(SingleDepartmentPicker.id) as Department;
|
|
||||||
// onDepartmentPick(_department);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/image_loader.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/requests/info_row.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
||||||
//
|
|
||||||
// import '../../../controllers/providers/api/user_provider.dart';
|
|
||||||
// import '../../../models/device/device_transfer_info.dart';
|
|
||||||
// import '../images/multi_image_picker.dart';
|
|
||||||
//
|
|
||||||
// class DeviceTransferInfoSection extends StatelessWidget {
|
|
||||||
// final DeviceTransferInfo info;
|
|
||||||
// final bool isSender;
|
|
||||||
// final VoidCallback onEdit;
|
|
||||||
//
|
|
||||||
// const DeviceTransferInfoSection({Key? key, this.info, this.onEdit, this.isSender}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// info.userName = Provider.of<UserProvider>(context).user.username;
|
|
||||||
// info.attachments ??= [];
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: context.translation.hospital,
|
|
||||||
// info: info.client.name,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: context.translation.department,
|
|
||||||
// info: info.department.name,
|
|
||||||
// ),
|
|
||||||
// // RequestInfoRow(
|
|
||||||
// // title: isSender ? "Sender Name " : "Receiver Name",
|
|
||||||
// // info: info.userName,
|
|
||||||
// // ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: context.translation.workingHours,
|
|
||||||
// info: info.workingHours,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: context.translation.travelingHours,
|
|
||||||
// info: info.travelingHours,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: "Comment",
|
|
||||||
// info: info.comment,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: "Assigned Engineer",
|
|
||||||
// info: info.assignedEmployeeName,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: "Signature",
|
|
||||||
// info: info.engSignature?.isEmpty != false ? context.translation.noDateFound : null,
|
|
||||||
// contentWidget: info.engSignature?.isEmpty != false ? null : ImageLoader(url: info.engSignature),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 16),
|
|
||||||
// child: MultiFilesPicker(
|
|
||||||
// label: "Attachments",
|
|
||||||
// files: info.attachments,
|
|
||||||
// enabled: false,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: context.translation.status,
|
|
||||||
// infoWidget: StatusLabel(
|
|
||||||
// label: info.status?.name, /*backgroundColor: AColors.getGasStatusColor(info.status?.id)*/
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class DrawerItem extends StatelessWidget {
|
|
||||||
// final String title;
|
|
||||||
// final IconData icon;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
//
|
|
||||||
// const DrawerItem({Key? key, this.title, this.icon, this.onPressed}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Padding(
|
|
||||||
// padding: const EdgeInsets.all(0.0),
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// padding: EdgeInsets.zero,
|
|
||||||
// elevation: 0,
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context))),
|
|
||||||
// primary: Theme.of(context).colorScheme.onPrimary,
|
|
||||||
// ),
|
|
||||||
// onPressed: onPressed,
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Icon(icon, /*color: AColors.grey3A,*/ size: 20),
|
|
||||||
// 12.width,
|
|
||||||
// Text(
|
|
||||||
// title,
|
|
||||||
// style: Theme.of(context).textTheme.headline6.copyWith(
|
|
||||||
// fontSize: 14, /* color: AColors.grey3A*/
|
|
||||||
// ),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(start: 20, end: 20),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/devices_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/device/asset.dart';
|
|
||||||
//
|
|
||||||
// class AutoCompleteDeviceField extends StatefulWidget {
|
|
||||||
// final Asset initialValue;
|
|
||||||
// final int hospitalId;
|
|
||||||
// final Function(int) onPick;
|
|
||||||
//
|
|
||||||
// const AutoCompleteDeviceField({Key? key, this.initialValue, this.onPick, this.hospitalId}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _AutoCompleteDeviceFieldState createState() => _AutoCompleteDeviceFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AutoCompleteDeviceFieldState extends State<AutoCompleteDeviceField> {
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// AssetProvider _devicesProvider;
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue.assetSerialNo);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _devicesProvider = Provider.of<AssetProvider>(context);
|
|
||||||
//
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: _devicesProvider.isLoading,
|
|
||||||
// isFailedLoading: _devicesProvider.devices == null,
|
|
||||||
// stateCode: _devicesProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// _devicesProvider.reset();
|
|
||||||
// await _devicesProvider.getAssets();
|
|
||||||
// },
|
|
||||||
// child: Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// // border: Border.all(color: AColors.black),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// boxShadow: [AppStyle.boxShadow]),
|
|
||||||
// child: TypeAheadField<Asset>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: const InputDecoration(
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (value) async {
|
|
||||||
// return await _devicesProvider.getDevicesList(
|
|
||||||
// host: _settingProvider.host,
|
|
||||||
// user: _userProvider.user,
|
|
||||||
// hospitalId: widget.hospitalId ?? _userProvider.user.clientId,
|
|
||||||
// // serialNumber: value,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, device) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(device.assetSerialNo),
|
|
||||||
// subtitle: Text("${device.modelDefinition.modelName}/${device.modelDefinition.manufacturerName}"),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (device) {
|
|
||||||
// _controller.text = device.assetSerialNo;
|
|
||||||
// widget.onPick(device.id);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/devices_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AutoCompleteModelField extends StatefulWidget {
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final Function(Lookup) onPick;
|
|
||||||
//
|
|
||||||
// const AutoCompleteModelField({
|
|
||||||
// Key? key,
|
|
||||||
// this.initialValue,
|
|
||||||
// this.onPick,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _AutoCompleteModelFieldState createState() => _AutoCompleteModelFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AutoCompleteModelFieldState extends State<AutoCompleteModelField> {
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// AssetProvider _devicesProvider;
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue?.name);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _devicesProvider = Provider.of<AssetProvider>(context);
|
|
||||||
//
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// // border: Border.all(color: AColors.black),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// boxShadow: [AppStyle.boxShadow]),
|
|
||||||
// child: TypeAheadField<Lookup>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: const InputDecoration(
|
|
||||||
// hintText: "Model",
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (value) async {
|
|
||||||
// return await _devicesProvider.getModels(
|
|
||||||
// code: value,
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, lookup) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(lookup.name),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (lookup) {
|
|
||||||
// _controller.text = lookup.name;
|
|
||||||
// widget.onPick(lookup);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import '../loaders/app_loading.dart';
|
|
||||||
//
|
|
||||||
// class BuildingTypeMenu extends StatefulWidget {
|
|
||||||
// final Function(Buildings) onSelect;
|
|
||||||
// Buildings initialValue;
|
|
||||||
// List<Buildings> building;
|
|
||||||
// bool enabled, loading;
|
|
||||||
//
|
|
||||||
// BuildingTypeMenu({
|
|
||||||
// Key? key,
|
|
||||||
// this.onSelect,
|
|
||||||
// this.initialValue,
|
|
||||||
// this.building = const [],
|
|
||||||
// this.enabled = true,
|
|
||||||
// this.loading = false,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _BuildingTypeMenuState createState() {
|
|
||||||
// return _BuildingTypeMenuState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _BuildingTypeMenuState extends State<BuildingTypeMenu> {
|
|
||||||
// Buildings _selectedBuilding;
|
|
||||||
// List<Buildings> _building;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _selectedBuilding = widget.initialValue;
|
|
||||||
// _building = widget.building;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant BuildingTypeMenu oldWidget) {
|
|
||||||
// if (oldWidget.building != widget.building) {
|
|
||||||
// _building = widget.building;
|
|
||||||
// _selectedBuilding = null;
|
|
||||||
// }
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue && widget.initialValue != null) {
|
|
||||||
// _selectedBuilding = widget.initialValue;
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: const Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: const [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: widget.loading
|
|
||||||
// ? const Padding(padding: EdgeInsets.all(8.0), child: ALoading())
|
|
||||||
// : (widget.enabled && (_building?.isEmpty ?? false)) || (!widget.enabled)
|
|
||||||
// ? ListTile(
|
|
||||||
// title: Center(child: Text(widget.initialValue?.name ?? "")),
|
|
||||||
// )
|
|
||||||
// : DropdownButton<Buildings>(
|
|
||||||
// value: _selectedBuilding,
|
|
||||||
// iconSize: 24,
|
|
||||||
// icon: const Icon(Icons.keyboard_arrow_down_rounded),
|
|
||||||
// elevation: 0,
|
|
||||||
// isExpanded: true,
|
|
||||||
// hint: Text(
|
|
||||||
// "Select Building",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
// underline: const SizedBox.shrink(),
|
|
||||||
// onChanged: (Buildings newValue) {
|
|
||||||
// setState(() {
|
|
||||||
// _selectedBuilding = newValue;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(newValue);
|
|
||||||
// },
|
|
||||||
// items: _building?.map<DropdownMenuItem<Buildings>>((Buildings value) {
|
|
||||||
// return DropdownMenuItem<Buildings>(
|
|
||||||
// value: value,
|
|
||||||
// child: Text(
|
|
||||||
// value.name ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// fontSize: 11,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// })?.toList() ??
|
|
||||||
// [],
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,112 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import '../loaders/app_loading.dart';
|
|
||||||
//
|
|
||||||
// class DepartmentTypeMenu extends StatefulWidget {
|
|
||||||
// final Function(Departments) onSelect;
|
|
||||||
// Departments initialValue;
|
|
||||||
// List<Departments> departments;
|
|
||||||
// bool enabled, loading;
|
|
||||||
//
|
|
||||||
// DepartmentTypeMenu({
|
|
||||||
// Key? key,
|
|
||||||
// this.onSelect,
|
|
||||||
// this.initialValue,
|
|
||||||
// this.departments = const [],
|
|
||||||
// this.enabled = true,
|
|
||||||
// this.loading = false,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _DepartmentTypeMenuState createState() {
|
|
||||||
// return _DepartmentTypeMenuState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _DepartmentTypeMenuState extends State<DepartmentTypeMenu> {
|
|
||||||
// Departments _selected;
|
|
||||||
// List<Departments> _departments;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _selected = widget.initialValue;
|
|
||||||
// _departments = widget.departments;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant DepartmentTypeMenu oldWidget) {
|
|
||||||
// if (oldWidget.departments != widget.departments) {
|
|
||||||
// _departments = widget.departments;
|
|
||||||
// _selected = null;
|
|
||||||
// }
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue && widget.initialValue != null) {
|
|
||||||
// _selected = widget.initialValue;
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: const [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: widget.loading
|
|
||||||
// ? const Padding(padding: EdgeInsets.all(8.0), child: ALoading())
|
|
||||||
// : (widget.enabled && (_departments?.isEmpty ?? false)) || (!widget.enabled)
|
|
||||||
// ? ListTile(
|
|
||||||
// title: Center(child: Text(widget.initialValue?.name ?? "")),
|
|
||||||
// )
|
|
||||||
// : DropdownButton<Departments>(
|
|
||||||
// value: _selected,
|
|
||||||
// iconSize: 24,
|
|
||||||
// icon: const Icon(Icons.keyboard_arrow_down_rounded),
|
|
||||||
// elevation: 0,
|
|
||||||
// isExpanded: true,
|
|
||||||
// hint: Text(
|
|
||||||
// "Select Department",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
// underline: SizedBox.shrink(),
|
|
||||||
// onChanged: (Departments newValue) {
|
|
||||||
// setState(() {
|
|
||||||
// _selected = newValue;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(newValue);
|
|
||||||
// },
|
|
||||||
// items: widget?.departments?.map<DropdownMenuItem<Departments>>((Departments value) {
|
|
||||||
// return DropdownMenuItem<Departments>(
|
|
||||||
// value: value,
|
|
||||||
// child: Text(
|
|
||||||
// value?.name ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// fontSize: 11,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// })?.toList() ??
|
|
||||||
// [],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import '../loaders/app_loading.dart';
|
|
||||||
//
|
|
||||||
// class FloorTypeMenu extends StatefulWidget {
|
|
||||||
// final Function(Floors) onSelect;
|
|
||||||
// Floors initialValue;
|
|
||||||
// List<Floors> floors;
|
|
||||||
// bool enabled;
|
|
||||||
// bool loading;
|
|
||||||
//
|
|
||||||
// FloorTypeMenu({
|
|
||||||
// Key? key,
|
|
||||||
// this.onSelect,
|
|
||||||
// this.initialValue,
|
|
||||||
// this.floors = const [],
|
|
||||||
// this.enabled = true,
|
|
||||||
// this.loading = false,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _FloorTypeMenuState createState() {
|
|
||||||
// return _FloorTypeMenuState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _FloorTypeMenuState extends State<FloorTypeMenu> {
|
|
||||||
// Floors _selected;
|
|
||||||
// List<Floors> _floors;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _selected = widget.initialValue;
|
|
||||||
// _floors = widget.floors;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant FloorTypeMenu oldWidget) {
|
|
||||||
// if (oldWidget.floors != widget.floors) {
|
|
||||||
// _floors = widget.floors;
|
|
||||||
// _selected = null;
|
|
||||||
// }
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue && widget.initialValue != null) {
|
|
||||||
// _selected = widget.initialValue;
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: const Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: const [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: widget.loading
|
|
||||||
// ? const Padding(padding: EdgeInsets.all(8.0), child: ALoading())
|
|
||||||
// : (widget.enabled && (_floors?.isEmpty ?? false)) || (!widget.enabled)
|
|
||||||
// ? ListTile(
|
|
||||||
// title: Center(child: Text(widget.initialValue?.name ?? "")),
|
|
||||||
// )
|
|
||||||
// : DropdownButton<Floors>(
|
|
||||||
// value: _selected,
|
|
||||||
// iconSize: 24,
|
|
||||||
// icon: const Icon(Icons.keyboard_arrow_down_rounded),
|
|
||||||
// elevation: 0,
|
|
||||||
// isExpanded: true,
|
|
||||||
// hint: Text(
|
|
||||||
// "Select Floor",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
// underline: const SizedBox.shrink(),
|
|
||||||
// onChanged: (Floors newValue) {
|
|
||||||
// setState(() {
|
|
||||||
// _selected = newValue;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(newValue);
|
|
||||||
// },
|
|
||||||
// items: _floors?.map<DropdownMenuItem<Floors>>((Floors value) {
|
|
||||||
// return DropdownMenuItem<Floors>(
|
|
||||||
// value: value,
|
|
||||||
// child: Text(
|
|
||||||
// value.name ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// fontSize: 11,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// })?.toList() ??
|
|
||||||
// [],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/new_models/gas_refill_model.dart';
|
|
||||||
// import '../buttons/app_button.dart';
|
|
||||||
// import '../titles/app_sub_title.dart';
|
|
||||||
//
|
|
||||||
// class GasRefillCreateDetailsItem extends StatefulWidget {
|
|
||||||
// final GasRefillDetails model;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
// final bool isUpdate;
|
|
||||||
//
|
|
||||||
// const GasRefillCreateDetailsItem({Key? key, this.isUpdate, this.model, this.onPressed}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<GasRefillCreateDetailsItem> createState() => _GasRefillCreateDetailsItemState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _GasRefillCreateDetailsItemState extends State<GasRefillCreateDetailsItem> {
|
|
||||||
// GlobalKey<FormState> _formKey;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _formKey = GlobalKey<FormState>();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final startEditing = widget.isUpdate && (widget.model.selectedForEditing ?? false);
|
|
||||||
// return Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(child: Text(widget.model.gasType.name)),
|
|
||||||
// IconButton(onPressed: widget.onPressed, /* color: widget.isUpdate ? AColors.cyan : AColors.red,*/ icon: Icon(widget.isUpdate ? Icons.edit : Icons.delete))
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Wrap(
|
|
||||||
// spacing: 10,
|
|
||||||
// children: [
|
|
||||||
// Text("Quantity: ${widget.model.requestedQty.toStringAsFixed(0)}"),
|
|
||||||
// Text("Cylinder Size: ${widget.model.cylinderSize.name}"),
|
|
||||||
// Text("Cylinder Type: ${widget.model.cylinderType.name}"),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (widget.model.deliverdQty != null)
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// const Text("Delivered Quantity: "),
|
|
||||||
// Text(widget.model.deliverdQty.toStringAsFixed(0)),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (startEditing) const SizedBox(height: 16),
|
|
||||||
// if (startEditing) ASubTitle(context.translation.deliveredQuantity),
|
|
||||||
// if (startEditing) const SizedBox(height: 4),
|
|
||||||
// if (startEditing)
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: widget.model.deliverdQty?.toString() ?? "0",
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
// // validator: (value) => Validator.isNumeric(value) ? null : "allow numbers only",
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// if (value.isNotEmpty) {
|
|
||||||
// widget.model.deliverdQty = double.tryParse(value);
|
|
||||||
// } else {
|
|
||||||
// widget.model.deliverdQty = 0;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// if (startEditing) const SizedBox(height: 8),
|
|
||||||
// if (startEditing)
|
|
||||||
// AButton(
|
|
||||||
// text: context.translation.edit,
|
|
||||||
// onPressed: () {
|
|
||||||
// _formKey.currentState?.save();
|
|
||||||
// widget.onPressed();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// const Divider(),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/controllers/validator/validator.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/requests/info_row.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/titles/app_title.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/new_models/gas_refill_model.dart';
|
|
||||||
//
|
|
||||||
// class GasRefillUpdateDetailsItem extends StatelessWidget {
|
|
||||||
// final GasRefillDetails details;
|
|
||||||
// final bool enableEdit;
|
|
||||||
// final bool validate;
|
|
||||||
//
|
|
||||||
// const GasRefillUpdateDetailsItem({Key? key, this.details, this.enableEdit, this.validate}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// ATitle(details.gasType.name),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: "Cylinder Size",
|
|
||||||
// info: details.cylinderSize.name,
|
|
||||||
// ),
|
|
||||||
// RequestInfoRow(
|
|
||||||
// title: "Requested Quantity",
|
|
||||||
// info: details.deliverdQty?.toStringAsFixed(0) ?? "",
|
|
||||||
// ),
|
|
||||||
// enableEdit
|
|
||||||
// ? Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// ASubTitle(context.translation.quantity),
|
|
||||||
// if (validate && details.deliverdQty == null)
|
|
||||||
// ASubTitle(
|
|
||||||
// context.translation.requiredWord,
|
|
||||||
// color: Colors.red,
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 4,
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: (details.deliverdQty ?? "").toString(),
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// validator: (value) => Validator.isNumeric(value) ? null : "allow numbers only",
|
|
||||||
// textInputType: TextInputType.number,
|
|
||||||
// onSaved: (value) {
|
|
||||||
// details.deliverdQty = double.tryParse(value);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// : RequestInfoRow(
|
|
||||||
// title: "Delivered Quantity",
|
|
||||||
// info: details.deliverdQty?.toStringAsFixed(0),
|
|
||||||
// ),
|
|
||||||
// //SizedBox(height: 16,)
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/hospitals_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class HospitalAutoCompleteField extends StatefulWidget {
|
|
||||||
// final String initialValue;
|
|
||||||
// final Function(Hospital) onSearch;
|
|
||||||
//
|
|
||||||
// //final Function(Hospital) onSave;
|
|
||||||
//
|
|
||||||
// const HospitalAutoCompleteField({
|
|
||||||
// Key? key,
|
|
||||||
// this.onSearch,
|
|
||||||
// this.initialValue,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _HospitalAutoCompleteFieldState createState() => _HospitalAutoCompleteFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _HospitalAutoCompleteFieldState extends State<HospitalAutoCompleteField> {
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant HospitalAutoCompleteField oldWidget) {
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
//
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue) {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
//
|
|
||||||
// return Container(
|
|
||||||
// padding: EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: TypeAheadField<Hospital>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// hintText: context.translation.hospital,
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (vale) async {
|
|
||||||
// return await HospitalsProvider().getHospitalsList(host: _settingProvider.host, title: vale);
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, hospital) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(hospital.name),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (hospital) {
|
|
||||||
// widget.onSearch(hospital);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/hospitals_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/hospital.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/app_loading.dart';
|
|
||||||
//
|
|
||||||
// class HospitalAutoCompleteField extends StatefulWidget {
|
|
||||||
// final String initialValue;
|
|
||||||
// final Function(Hospital) onSearch;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// //final Function(Hospital) onSave;
|
|
||||||
//
|
|
||||||
// const HospitalAutoCompleteField({
|
|
||||||
// Key? key,
|
|
||||||
// this.onSearch,
|
|
||||||
// this.initialValue,
|
|
||||||
// this.enabled = true,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _HospitalAutoCompleteFieldState createState() => _HospitalAutoCompleteFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _HospitalAutoCompleteFieldState extends State<HospitalAutoCompleteField> {
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant HospitalAutoCompleteField oldWidget) {
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
//
|
|
||||||
// if (oldWidget.initialValue != widget.initialValue) {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
//
|
|
||||||
// return Container(
|
|
||||||
// padding: EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: widget.enabled
|
|
||||||
// ? TypeAheadField<Hospital>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// hintText: context.translation.hospital,
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (vale) async {
|
|
||||||
// return await HospitalsProvider().getHospitalsListByVal(searchVal: _controller.text);
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, hospital) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(hospital.name),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (hospital) {
|
|
||||||
// widget.onSearch(hospital);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// : widget.initialValue == null
|
|
||||||
// ? const Padding(
|
|
||||||
// padding: EdgeInsets.all(8.0),
|
|
||||||
// child: ALoading(),
|
|
||||||
// )
|
|
||||||
// : ListTile(
|
|
||||||
// title: Center(child: Text(widget.initialValue)),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/image_loader.dart';
|
|
||||||
//
|
|
||||||
// class ImageItem extends StatelessWidget {
|
|
||||||
// final String url;
|
|
||||||
// final bool isVideo;
|
|
||||||
// final VoidCallback onPressed;
|
|
||||||
// todo delete
|
|
||||||
// const ImageItem({Key? key,required this.url, this.isVideo = false, this.onPressed}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// width: 80 * AppStyle.getScaleFactor(context),
|
|
||||||
// height: 40 * AppStyle.getScaleFactor(context),
|
|
||||||
// margin: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 4 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Theme.of(context).dividerColor,
|
|
||||||
// width: 2 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(8 * AppStyle.getScaleFactor(context)),
|
|
||||||
// ),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: BorderRadius.circular(6 * AppStyle.getScaleFactor(context)),
|
|
||||||
// child: Stack(
|
|
||||||
// fit: StackFit.expand,
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// ImageLoader(url: url),
|
|
||||||
// MaterialButton(
|
|
||||||
// onPressed: onPressed,
|
|
||||||
// padding: EdgeInsets.zero,
|
|
||||||
// child: Visibility(
|
|
||||||
// visible: isVideo,
|
|
||||||
// child: Center(
|
|
||||||
// child: Container(
|
|
||||||
// decoration: BoxDecoration(color: Colors.black45, shape: BoxShape.circle),
|
|
||||||
// child: FaIcon(
|
|
||||||
// FontAwesomeIcons.playCircle,
|
|
||||||
// size: 32 * AppStyle.getScaleFactor(context),
|
|
||||||
// // color: AColors.orange,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// )),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// import 'image_item.dart';
|
|
||||||
// import 'images_viewer.dart';
|
|
||||||
//
|
|
||||||
// class ImagesList extends StatelessWidget {
|
|
||||||
// final List<String> images;
|
|
||||||
// final EdgeInsets padding;
|
|
||||||
//
|
|
||||||
// const ImagesList({Key? key, this.images, this.padding}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return ListView.builder(
|
|
||||||
// padding: padding ?? EdgeInsets.symmetric(horizontal: 32 * AppStyle.getScaleFactor(context)),
|
|
||||||
// scrollDirection: Axis.horizontal,
|
|
||||||
// itemCount: images.length,
|
|
||||||
// itemBuilder: (context, itemIndex) {
|
|
||||||
// return ImageItem(
|
|
||||||
// url: images[itemIndex],
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).push(MaterialPageRoute(
|
|
||||||
// builder: (_) => ImagesViewer(
|
|
||||||
// initialIndex: itemIndex,
|
|
||||||
// images: images,
|
|
||||||
// )));
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/image_loader.dart';
|
|
||||||
//
|
|
||||||
// class ImagesViewer extends StatelessWidget {
|
|
||||||
// final List<String> images;
|
|
||||||
// final int initialIndex;
|
|
||||||
//
|
|
||||||
// const ImagesViewer({
|
|
||||||
// Key? key,
|
|
||||||
// this.images,
|
|
||||||
// this.initialIndex = 0,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Scaffold(
|
|
||||||
// body: DefaultTabController(
|
|
||||||
// length: images.length,
|
|
||||||
// initialIndex: initialIndex,
|
|
||||||
// child: SafeArea(
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// images.length == 1
|
|
||||||
// ? SizedBox.shrink()
|
|
||||||
// : Column(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// TabBar(
|
|
||||||
// isScrollable: images.length * 84 > MediaQuery.of(context).size.width,
|
|
||||||
// indicator: BoxDecoration(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// borderRadius: BorderRadius.only(
|
|
||||||
// topRight: Radius.circular(24 * AppStyle.getScaleFactor(context)),
|
|
||||||
// bottomLeft: Radius.circular(24 * AppStyle.getScaleFactor(context)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// indicatorSize: TabBarIndicatorSize.label,
|
|
||||||
// tabs: images
|
|
||||||
// .map((imagePath) => InteractiveViewer(
|
|
||||||
// child: Container(
|
|
||||||
// height: 60,
|
|
||||||
// width: 80,
|
|
||||||
// padding: EdgeInsets.all(
|
|
||||||
// AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: BorderRadius.only(
|
|
||||||
// topRight: Radius.circular(22 * AppStyle.getScaleFactor(context)),
|
|
||||||
// bottomLeft: Radius.circular(22 * AppStyle.getScaleFactor(context)),
|
|
||||||
// ),
|
|
||||||
// child: ImageLoader(
|
|
||||||
// url: imagePath,
|
|
||||||
// boxFit: BoxFit.cover,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ))
|
|
||||||
// .toList(),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Expanded(
|
|
||||||
// child: TabBarView(
|
|
||||||
// children: images
|
|
||||||
// .map((imagePath) => InteractiveViewer(
|
|
||||||
// child: ImageLoader(
|
|
||||||
// url: imagePath,
|
|
||||||
// boxFit: BoxFit.contain,
|
|
||||||
// ),
|
|
||||||
// ))
|
|
||||||
// .toList(),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:io';
|
|
||||||
//
|
|
||||||
// import 'package:file_picker/file_picker.dart';
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|
||||||
// import 'package:image_picker/image_picker.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AMiniOneFilePicker extends StatefulWidget {
|
|
||||||
// final Function(File) onPick;
|
|
||||||
// final File file;
|
|
||||||
// final String label;
|
|
||||||
// final bool error;
|
|
||||||
//
|
|
||||||
// const AMiniOneFilePicker({Key? key, this.label, this.error, this.file, this.onPick}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _AMiniOneFilePickerState createState() => _AMiniOneFilePickerState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AMiniOneFilePickerState extends State<AMiniOneFilePicker> {
|
|
||||||
// File _file;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _file = widget.file;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Visibility(
|
|
||||||
// visible: widget.label != null,
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(height: 8 * AppStyle.getScaleFactor(context)),
|
|
||||||
// Text(
|
|
||||||
// widget.label ?? '',
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Visibility(
|
|
||||||
// visible: _file == null && widget.error == true,
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// Text(
|
|
||||||
// context.translation.requiredFile,
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge.copyWith(color: Colors.red),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// SizedBox(
|
|
||||||
// width: MediaQuery.of(context).size.width,
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context))),
|
|
||||||
// //primary: Colors.grey[200],
|
|
||||||
// textStyle: Theme.of(context).textTheme.labelSmall,
|
|
||||||
// padding: _file == null ? null : EdgeInsets.zero,
|
|
||||||
// ),
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: Text(
|
|
||||||
// _file == null ? context.translation.pickFile : _file.path.split("/").last,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// onPressed: () async {
|
|
||||||
// onFilePicker(context.translation);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// fromFilePicker(AppLocalizations subtitle) async {
|
|
||||||
// FilePickerResult result = await FilePicker.platform.pickFiles(
|
|
||||||
// type: FileType.custom,
|
|
||||||
// allowedExtensions: ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xlsx', 'pptx'],
|
|
||||||
// );
|
|
||||||
// if (result != null) {
|
|
||||||
// for (var path in result.paths) {
|
|
||||||
// _file = File(path);
|
|
||||||
// widget.onPick(_file);
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// onFilePicker(AppLocalizations subtitle) async {
|
|
||||||
// ImageSource source = await showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (dialogContext) => CupertinoAlertDialog(
|
|
||||||
// actions: <Widget>[
|
|
||||||
// TextButton(
|
|
||||||
// child: Text(subtitle.pickFromCamera),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(dialogContext).pop(ImageSource.camera);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// TextButton(
|
|
||||||
// child: Text(subtitle.pickFromGallery),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(dialogContext).pop(ImageSource.gallery);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// TextButton(
|
|
||||||
// child: Text(subtitle.pickFromFiles),
|
|
||||||
// onPressed: () async {
|
|
||||||
// await fromFilePicker(subtitle);
|
|
||||||
// Navigator.pop(context);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// if (source == null) return;
|
|
||||||
//
|
|
||||||
// final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 800, maxHeight: 800);
|
|
||||||
//
|
|
||||||
// if (pickedFile != null) {
|
|
||||||
// File fileImage = File(pickedFile.path);
|
|
||||||
// if (fileImage != null) {
|
|
||||||
// _file = File(pickedFile.path);
|
|
||||||
// widget.onPick(_file);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'dart:io';
|
|
||||||
//
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:image_picker/image_picker.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AOneImagePicker extends StatefulWidget {
|
|
||||||
// final Function(File) onPick;
|
|
||||||
// final File image;
|
|
||||||
// final String label;
|
|
||||||
// final bool error;
|
|
||||||
//
|
|
||||||
// const AOneImagePicker({Key? key, this.label, this.error, this.image, this.onPick}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _AOneImagePickerState createState() => _AOneImagePickerState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AOneImagePickerState extends State<AOneImagePicker> {
|
|
||||||
// File _image;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _image = widget.image;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Visibility(
|
|
||||||
// visible: widget.label != null,
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// widget.label ?? '',
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Visibility(
|
|
||||||
// visible: _image == null && widget.error == true,
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// height: 4,
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// context.translation.requiredImage,
|
|
||||||
// style: Theme.of(context).textTheme.headline6.copyWith(color: Colors.red),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8,
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// height: MediaQuery.of(context).size.height / 8,
|
|
||||||
// width: MediaQuery.of(context).size.width,
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context))),
|
|
||||||
// primary: Colors.grey[200],
|
|
||||||
// padding: _image == null ? null : EdgeInsets.zero,
|
|
||||||
// ),
|
|
||||||
// child: _image == null
|
|
||||||
// ? Text(
|
|
||||||
// context.translation.pickImage,
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// )
|
|
||||||
// : ClipRRect(
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// child: Image(
|
|
||||||
// height: MediaQuery.of(context).size.height / 6,
|
|
||||||
// width: MediaQuery.of(context).size.width,
|
|
||||||
// image: FileImage(_image),
|
|
||||||
// fit: BoxFit.cover,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// onPressed: () async {
|
|
||||||
// ImageSource source = await showDialog(
|
|
||||||
// context: context,
|
|
||||||
// builder: (_) => CupertinoAlertDialog(
|
|
||||||
// actions: <Widget>[
|
|
||||||
// TextButton(
|
|
||||||
// child: Text("pick from camera"),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop(ImageSource.camera);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// TextButton(
|
|
||||||
// child: Text("pick from gallery"),
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop(ImageSource.gallery);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ));
|
|
||||||
// if (source == null) return;
|
|
||||||
//
|
|
||||||
// final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 1000, maxHeight: 1000);
|
|
||||||
//
|
|
||||||
// setState(() {
|
|
||||||
// if (pickedFile != null) {
|
|
||||||
// _image = File(pickedFile.path);
|
|
||||||
// widget.onPick(_image);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,141 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
//
|
|
||||||
// class InputWidget extends StatefulWidget {
|
|
||||||
// final String labelText;
|
|
||||||
// final String hintText;
|
|
||||||
// final TextEditingController controller;
|
|
||||||
// final VoidCallback suffixTap;
|
|
||||||
// final bool isEnable;
|
|
||||||
// final bool hasSelection;
|
|
||||||
// final int lines;
|
|
||||||
// final bool isInputTypeNum;
|
|
||||||
// final bool isTextIsPassword;
|
|
||||||
// final bool isBackgroundEnable;
|
|
||||||
// final bool isEnableBorder;
|
|
||||||
// final double verticalPadding;
|
|
||||||
// final double horizontalPadding;
|
|
||||||
// final Function(String) onChange;
|
|
||||||
// final Function(String) validator;
|
|
||||||
//
|
|
||||||
// InputWidget(
|
|
||||||
// this.labelText,
|
|
||||||
// this.hintText,
|
|
||||||
// this.controller, {
|
|
||||||
// Key? key,
|
|
||||||
// this.isTextIsPassword = false,
|
|
||||||
// this.suffixTap,
|
|
||||||
// this.validator,
|
|
||||||
// this.isEnable = true,
|
|
||||||
// this.hasSelection = false,
|
|
||||||
// this.isEnableBorder = false,
|
|
||||||
// this.lines = 1,
|
|
||||||
// this.onChange,
|
|
||||||
// this.isInputTypeNum = false,
|
|
||||||
// this.isBackgroundEnable = false,
|
|
||||||
// this.verticalPadding = 10,
|
|
||||||
// this.horizontalPadding = 16,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _InputWidgetState createState() {
|
|
||||||
// return _InputWidgetState();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _InputWidgetState extends State<InputWidget> {
|
|
||||||
// bool isObscureText;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// isObscureText = widget.isTextIsPassword;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// height: 56,
|
|
||||||
// padding: EdgeInsets.only(left: widget.horizontalPadding, right: widget.horizontalPadding, bottom: widget.verticalPadding, top: widget.verticalPadding),
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// color: widget.isBackgroundEnable ? Color(0xffF7F7F7) : Colors.white,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: widget.isEnableBorder ? Color(0xffefefef) : Colors.transparent,
|
|
||||||
// width: 1,
|
|
||||||
// ),
|
|
||||||
// boxShadow: const [
|
|
||||||
// BoxShadow(
|
|
||||||
// color: Color.fromRGBO(0, 0, 0, 0.05),
|
|
||||||
// blurRadius: 10.0,
|
|
||||||
// spreadRadius: 0.0,
|
|
||||||
// offset: Offset(0, 0),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// child: InkWell(
|
|
||||||
// onTap: widget.hasSelection ? () {} : null,
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// widget.labelText,
|
|
||||||
// style: AppTextStyles.tinyFont.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20),
|
|
||||||
// ),
|
|
||||||
// TextFormField(
|
|
||||||
// enabled: widget.isEnable,
|
|
||||||
// scrollPadding: EdgeInsets.zero,
|
|
||||||
// keyboardType: widget.isInputTypeNum ? TextInputType.number : TextInputType.text,
|
|
||||||
// controller: widget.controller,
|
|
||||||
// maxLines: widget.lines,
|
|
||||||
// validator: widget.validator,
|
|
||||||
// obscuringCharacter: "*",
|
|
||||||
// obscureText: isObscureText,
|
|
||||||
// onChanged: widget.onChange,
|
|
||||||
// style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.primary50 : AppColor.neutral50),
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// isDense: true,
|
|
||||||
// hintText: widget.hintText,
|
|
||||||
// // hintStyle: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.primary50 : AppColor.neutral50),
|
|
||||||
// hintStyle: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.neutral10 : AppColor.neutral20.withOpacity(.4)),
|
|
||||||
// //suffixIconConstraints: const BoxConstraints(minWidth: 50),
|
|
||||||
// // suffixIcon: widget.suffixTap == null ? null : IconButton(icon: const Icon(Icons.mic, color: MyColors.darkTextColor), onPressed: widget.suffixTap),
|
|
||||||
// contentPadding: EdgeInsets.zero,
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (widget.isTextIsPassword) ...[
|
|
||||||
// 16.width,
|
|
||||||
// Icon(isObscureText ? Icons.visibility_rounded : Icons.visibility_off_rounded).onPress(() {
|
|
||||||
// setState(() {
|
|
||||||
// isObscureText = !isObscureText;
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// ],
|
|
||||||
// if (widget.hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
|
|
||||||
class ReportIssueItem extends StatelessWidget {
|
|
||||||
final bool isSelected;
|
|
||||||
final String? issueInfo;
|
|
||||||
final Function(String?, bool) onChange;
|
|
||||||
|
|
||||||
const ReportIssueItem({Key? key, this.isSelected = false, this.issueInfo, required this.onChange}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return MaterialButton(
|
|
||||||
// splashColor: AColors.secondaryColor.withOpacity(.5),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
|
||||||
onPressed: () {
|
|
||||||
onChange(issueInfo, !isSelected);
|
|
||||||
},
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
child: Text(
|
|
||||||
issueInfo ?? "",
|
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
|
||||||
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
||||||
child: Checkbox(
|
|
||||||
value: isSelected,
|
|
||||||
onChanged: (value) {
|
|
||||||
onChange(issueInfo, value!);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
child: Divider(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_icon_button2.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/service_request/spare_parts.dart';
|
|
||||||
//
|
|
||||||
// class PartItem extends StatefulWidget {
|
|
||||||
// final SparePartsWorkOrders part;
|
|
||||||
// final Function(SparePartsWorkOrders) onDelete;
|
|
||||||
// final Function(int qty) onEdit;
|
|
||||||
//
|
|
||||||
// const PartItem({Key? key, this.part, this.onEdit, this.onDelete}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _PartItemState createState() => _PartItemState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _PartItemState extends State<PartItem> {
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// const Divider(),
|
|
||||||
// Row(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// widget?.part?.sparePart?.partNo ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.bold),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// AIconButton2(
|
|
||||||
// iconData: Icons.add,
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (widget.onEdit == null) {
|
|
||||||
// ++widget.part.qty;
|
|
||||||
// } else {
|
|
||||||
// widget.onEdit(++widget.part.qty);
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// AIconButton2(
|
|
||||||
// iconData: Icons.remove,
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// onPressed: widget.part.qty < 2
|
|
||||||
// ? null
|
|
||||||
// : () {
|
|
||||||
// if (widget.onEdit == null) {
|
|
||||||
// --widget.part.qty;
|
|
||||||
// } else {
|
|
||||||
// widget.onEdit(--widget.part.qty);
|
|
||||||
// }
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// width: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// widget.part.qty.toString(),
|
|
||||||
// style: Theme.of(context).textTheme.headline6.copyWith(
|
|
||||||
// //fontSize: 12,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// width: 8 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// widget.part?.sparePart?.partName == null
|
|
||||||
// ? const SizedBox.shrink()
|
|
||||||
// : Text(
|
|
||||||
// widget.part?.sparePart?.partName,
|
|
||||||
// style: Theme.of(context).textTheme.caption.copyWith(fontSize: 11, fontWeight: FontWeight.bold),
|
|
||||||
// maxLines: 1,
|
|
||||||
// overflow: TextOverflow.ellipsis,
|
|
||||||
// ),
|
|
||||||
//
|
|
||||||
// // Row(crossAxisAlignment: ,)
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// AIconButton2(
|
|
||||||
// iconData: Icons.close,
|
|
||||||
// color: Colors.red,
|
|
||||||
// onPressed: () {
|
|
||||||
// widget.onDelete(widget.part);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,111 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/devices_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
||||||
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
//
|
|
||||||
// import '../../../../extensions/text_extensions.dart';
|
|
||||||
// import '../../../../models/device/asset.dart';
|
|
||||||
// import '../../../../models/device/asset_search.dart';
|
|
||||||
// import '../../../../new_views/app_style/app_color.dart';
|
|
||||||
// import '../../../../new_views/app_style/app_text_style.dart';
|
|
||||||
// import '../../../app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class AutoCompleteDeviceNumberField extends StatefulWidget {
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final int hospitalId;
|
|
||||||
// final Function(Lookup) onPick;
|
|
||||||
//
|
|
||||||
// const AutoCompleteDeviceNumberField({Key? key, this.initialValue, this.onPick, this.hospitalId}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<AutoCompleteDeviceNumberField> createState() => _AutoCompleteDeviceNumberFieldState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _AutoCompleteDeviceNumberFieldState extends State<AutoCompleteDeviceNumberField> {
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// AssetProvider _devicesProvider;
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue?.name);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant AutoCompleteDeviceNumberField oldWidget) {
|
|
||||||
// if (widget.initialValue != oldWidget.initialValue) {
|
|
||||||
// _controller = TextEditingController(text: widget.initialValue?.name);
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.dispose();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// _devicesProvider = Provider.of<AssetProvider>(context);
|
|
||||||
// final border = UnderlineInputBorder(borderSide: BorderSide.none, borderRadius: BorderRadius.circular(10));
|
|
||||||
// return Container(
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: AppColor.background(context),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
||||||
// ),
|
|
||||||
// child: TypeAheadField<Asset>(
|
|
||||||
// minCharsForSuggestions: 1,
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: AppTextStyles.bodyText,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.start,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// decoration: InputDecoration(
|
|
||||||
// border: border,
|
|
||||||
// disabledBorder: border,
|
|
||||||
// focusedBorder: border,
|
|
||||||
// enabledBorder: border,
|
|
||||||
// errorBorder: border,
|
|
||||||
// contentPadding: EdgeInsets.symmetric(vertical: 8.toScreenHeight, horizontal: 16.toScreenWidth),
|
|
||||||
// constraints: const BoxConstraints(),
|
|
||||||
// suffixIconConstraints: const BoxConstraints(minWidth: 0),
|
|
||||||
// filled: true,
|
|
||||||
// fillColor: (context.isDark ? AppColor.neutral50 : AppColor.background(context)),
|
|
||||||
// errorStyle: AppTextStyle.tiny.copyWith(color: context.isDark ? AppColor.red50 : AppColor.red60),
|
|
||||||
// floatingLabelStyle: AppTextStyle.body1?.copyWith(fontWeight: FontWeight.w500, color: context.isDark ? null : AppColor.neutral20),
|
|
||||||
// labelText: context.translation.assetNumber,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (value) async {
|
|
||||||
// return await _devicesProvider.getDevicesList(
|
|
||||||
// host: _settingProvider.host,
|
|
||||||
// user: _userProvider.user,
|
|
||||||
// hospitalId: widget.hospitalId,
|
|
||||||
// addPagination: false,
|
|
||||||
// search: AssetSearch(assetNo: value),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, device) {
|
|
||||||
// return device.assetNumber.bodyText(context).paddingOnly(bottom: 16, start: 16);
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (device) {
|
|
||||||
// _controller.text = device.assetNumber;
|
|
||||||
// widget.onPick(Lookup(id: device.id, name: device.assetNumber));
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class RequestInfoRow extends StatelessWidget {
|
|
||||||
// final String title;
|
|
||||||
// final String info;
|
|
||||||
// final String content;
|
|
||||||
// final Widget contentWidget;
|
|
||||||
// final Widget infoWidget;
|
|
||||||
//
|
|
||||||
// const RequestInfoRow({Key? key, this.title, this.info, this.content, this.contentWidget, this.infoWidget}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// if (info != null && info.isEmpty) {
|
|
||||||
// return SizedBox.shrink();
|
|
||||||
// }
|
|
||||||
// if (content != null && content.isEmpty) {
|
|
||||||
// return SizedBox.shrink();
|
|
||||||
// }
|
|
||||||
// return Column(
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Text(
|
|
||||||
// title + " : ",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle2.copyWith(
|
|
||||||
// //fontSize: 12
|
|
||||||
// ),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// if (info != null)
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// info,
|
|
||||||
// style: Theme.of(context).textTheme.bodyText2,
|
|
||||||
// textAlign: TextAlign.right,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (infoWidget != null)
|
|
||||||
// Expanded(
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
// children: [
|
|
||||||
// infoWidget,
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// if (content != null)
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// content ?? 'No data found',
|
|
||||||
// style: Theme.of(context).textTheme.bodyText2,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (contentWidget != null) contentWidget,
|
|
||||||
// Divider(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,143 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/cupertino.dart';
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/api_routes/http_status_manger.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/service_request.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_small_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/employee/assigned_to_menu.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestsUpdateDialog extends StatefulWidget {
|
|
||||||
// final ServiceRequest request;
|
|
||||||
//
|
|
||||||
// const ServiceRequestsUpdateDialog({
|
|
||||||
// Key? key,
|
|
||||||
// this.request,
|
|
||||||
// }) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// State<ServiceRequestsUpdateDialog> createState() => _ServiceRequestsUpdateDialogState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _ServiceRequestsUpdateDialogState extends State<ServiceRequestsUpdateDialog> with TickerProviderStateMixin {
|
|
||||||
// DateTime _dateTime;
|
|
||||||
// Lookup _employee;
|
|
||||||
//
|
|
||||||
// UserProvider _userProvider;
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// ServiceRequestsProvider _serviceRequestsProvider;
|
|
||||||
//
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
//
|
|
||||||
// _update() async {
|
|
||||||
// if (_dateTime == null && _employee == null) {
|
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: context.translation.noDateFound,
|
|
||||||
// );
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// showDialog<void>(
|
|
||||||
// context: context,
|
|
||||||
// barrierDismissible: false,
|
|
||||||
// builder: (BuildContext context) {
|
|
||||||
// return CupertinoAlertDialog(
|
|
||||||
// title: Text(context.translation.updatingDots),
|
|
||||||
// content: Center(child: CircularProgressIndicator()),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// int status = await _serviceRequestsProvider.updateRequest(user: _userProvider.user, request: widget.request);
|
|
||||||
// if (status == 200) Navigator.of(context).pop();
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// Fluttertoast.showToast(
|
|
||||||
// msg: HttpStatusManger.getStatusMessage(status: status, subtitle: context.translation),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context, listen: false);
|
|
||||||
// _serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context, listen: false);
|
|
||||||
// return Column(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// SizedBox(
|
|
||||||
// // height: MediaQuery.of(context).size.height / 1.2,
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(16.0),
|
|
||||||
// child: Column(
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.cancel,
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.update,
|
|
||||||
// onPressed: _update,
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// context.translation.date,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ADatePicker(
|
|
||||||
// date: _dateTime,
|
|
||||||
// from: DateTime.now(),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _dateTime = date;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// AssignedToMenu(
|
|
||||||
// initialValue: _employee,
|
|
||||||
// onSelect: (employee) {
|
|
||||||
// _employee = employee;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,197 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/device/asset_transfer.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_small_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/equipment/pick_asset.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/device/asset_transfer_search.dart';
|
|
||||||
// import '../app_text_form_field.dart';
|
|
||||||
// import '../switch_button.dart';
|
|
||||||
//
|
|
||||||
// class AssetTransferSearchDialog extends StatefulWidget {
|
|
||||||
// final AssetTransfer initialSearchValue;
|
|
||||||
// final bool expandedSearch;
|
|
||||||
// final Function(AssetTransfer) onSearch;
|
|
||||||
//
|
|
||||||
// const AssetTransferSearchDialog({Key? key, this.initialSearchValue, this.expandedSearch, this.onSearch}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// AssetTransferSearchDialogState createState() => AssetTransferSearchDialogState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class AssetTransferSearchDialogState extends State<AssetTransferSearchDialog> with TickerProviderStateMixin {
|
|
||||||
// AssetTransferSearch _search;
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
// bool _isLoading = false;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _search = AssetTransferSearch();
|
|
||||||
// // _search.fromSearch(widget.initialSearchValue);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Padding(
|
|
||||||
// padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
||||||
// child: ClipRRect(
|
|
||||||
// borderRadius: const BorderRadius.only(topLeft: Radius.circular(15), topRight: Radius.circular(15)),
|
|
||||||
// clipBehavior: Clip.antiAliasWithSaveLayer,
|
|
||||||
// child: Container(
|
|
||||||
// color: Colors.white,
|
|
||||||
// height: MediaQuery.of(context).size.height / 1.3,
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 20),
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: ListView(
|
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.cancel,
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.search,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ASwitchButton(
|
|
||||||
// title: "Most Recent",
|
|
||||||
// value: _search.mostRecent ?? false,
|
|
||||||
// onChange: (value) {
|
|
||||||
// _search.mostRecent = value;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 8.0 * AppStyle.getScaleFactor(context)),
|
|
||||||
// PickAsset(
|
|
||||||
// device: _search.asset,
|
|
||||||
// onPickAsset: (device) {
|
|
||||||
// _search.asset = device;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 8.0 * AppStyle.getScaleFactor(context)),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: "_search.title",
|
|
||||||
// hintText: context.translation.title,
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// // _search.title = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 8.0 * AppStyle.getScaleFactor(context)),
|
|
||||||
// // HospitalAutoCompleteField(
|
|
||||||
// // initialValue: _search?.hospital?.name,
|
|
||||||
// // onSearch: (selected) async {
|
|
||||||
// // _search.building = null;
|
|
||||||
// // _search.floor = null;
|
|
||||||
// // _search.department = null;
|
|
||||||
// // _search.buildingsList = null;
|
|
||||||
// // _search.floorsList = null;
|
|
||||||
// // _search.departmentsList = null;
|
|
||||||
// // _isLoading = true;
|
|
||||||
// // setState(() {});
|
|
||||||
// // await HospitalsProvider().getHospitalsListByVal(searchVal: selected?.name ?? "").then((value) {
|
|
||||||
// // _search.hospital = value?.firstWhere((element) => element.name == selected.name, orElse: null);
|
|
||||||
// // _search.buildingsList = _search.hospital?.buildings;
|
|
||||||
// // });
|
|
||||||
// // _isLoading = false;
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// // BuildingTypeMenu(
|
|
||||||
// // initialValue: _search?.building,
|
|
||||||
// // building: _search.buildingsList,
|
|
||||||
// // enabled: !_isLoading,
|
|
||||||
// // onSelect: (status) {
|
|
||||||
// // _search.building = status;
|
|
||||||
// // _search.floorsList = status?.floors;
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// // FloorTypeMenu(
|
|
||||||
// // initialValue: _search?.floor,
|
|
||||||
// // floors: _search.floorsList,
|
|
||||||
// // enabled: !_isLoading,
|
|
||||||
// // onSelect: (status) {
|
|
||||||
// // _search.floor = status;
|
|
||||||
// // _search.departmentsList = _search.floor?.departments;
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// const SizedBox(height: 8),
|
|
||||||
// // DepartmentTypeMenu(
|
|
||||||
// // initialValue: _search?.department,
|
|
||||||
// // departments: _search.departmentsList,
|
|
||||||
// // enabled: !_isLoading,
|
|
||||||
// // onSelect: (status) {
|
|
||||||
// // _search.department = status;
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// SizedBox(height: 8.0 * AppStyle.getScaleFactor(context)),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: "_search.room",
|
|
||||||
// hintText: context.translation.room,
|
|
||||||
// style: Theme.of(context).textTheme.titleLarge,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// // _search.room = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 16.0 * AppStyle.getScaleFactor(context)),
|
|
||||||
// // Visibility(
|
|
||||||
// // visible: (_search.toMap()..remove("mostRecent"))?.isNotEmpty ?? false,
|
|
||||||
// // child: Padding(
|
|
||||||
// // padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
||||||
// // child: AButton(
|
|
||||||
// // padding: EdgeInsets.zero,
|
|
||||||
// // text: context.translation.clearSearch,
|
|
||||||
// // onPressed: () {
|
|
||||||
// // _search = DeviceTransferSearch();
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class FilterItem extends StatelessWidget {
|
|
||||||
// final bool isSelected;
|
|
||||||
// final Lookup status;
|
|
||||||
// final VoidCallback onSelected;
|
|
||||||
//
|
|
||||||
// const FilterItem({Key? key, this.status, this.isSelected, this.onSelected}) : super(key: key);
|
|
||||||
//
|
|
||||||
// //
|
|
||||||
// // Color getStatusColor() {
|
|
||||||
// // switch (status.id) {
|
|
||||||
// // case 0:
|
|
||||||
// // return AColors.green;
|
|
||||||
// // case 4:
|
|
||||||
// // return AColors.deepRed;
|
|
||||||
// // case 6:
|
|
||||||
// // return AColors.green;
|
|
||||||
// // case 5:
|
|
||||||
// // return AColors.orange;
|
|
||||||
// // case 8:
|
|
||||||
// // return AColors.green;
|
|
||||||
// // case 9:
|
|
||||||
// // return AColors.orange;
|
|
||||||
// // default:
|
|
||||||
// // return AColors.grey;
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Opacity(
|
|
||||||
// opacity: isSelected ? 1 : .5,
|
|
||||||
// child: SizedBox(
|
|
||||||
// height: 30,
|
|
||||||
// child: ElevatedButton(
|
|
||||||
// style: ElevatedButton.styleFrom(
|
|
||||||
// padding: EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context))),
|
|
||||||
// // primary: getStatusColor(),
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// status.name ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1.copyWith(
|
|
||||||
// // color: getStatusColor().computeLuminance() > 0.5 ? AColors.black : Colors.white,
|
|
||||||
// ),
|
|
||||||
// textScaleFactor: AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// onPressed: onSelected,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,335 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/ppm/ppm_search.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_small_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
//
|
|
||||||
// import '../switch_button.dart';
|
|
||||||
//
|
|
||||||
// class PpmSearchDialog extends StatefulWidget {
|
|
||||||
// final PpmSearch initialSearchValue;
|
|
||||||
// final bool expandedSearch;
|
|
||||||
// final Function(PpmSearch) onSearch;
|
|
||||||
//
|
|
||||||
// const PpmSearchDialog({Key? key, this.initialSearchValue, this.expandedSearch, this.onSearch}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _PpmSearchDialogState createState() => _PpmSearchDialogState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _PpmSearchDialogState extends State<PpmSearchDialog> with TickerProviderStateMixin {
|
|
||||||
// PpmSearch _search;
|
|
||||||
// List<Lookup> status = [
|
|
||||||
// Lookup(
|
|
||||||
// name: "Done",
|
|
||||||
// id: 0,
|
|
||||||
// ),
|
|
||||||
// Lookup(name: "Not Yet", id: 1),
|
|
||||||
// Lookup(
|
|
||||||
// name: "On Hold",
|
|
||||||
// id: 2,
|
|
||||||
// ),
|
|
||||||
// ];
|
|
||||||
//
|
|
||||||
// List<Lookup> contactStatus = [
|
|
||||||
// // Lookup(name: "Hospital Employee", value: "H",),
|
|
||||||
// // Lookup(name: "Under Warranty", value: "CW"),
|
|
||||||
// // Lookup(name: "Under Maintenance Contract", value: "CC",),
|
|
||||||
// ];
|
|
||||||
//
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _search = PpmSearch();
|
|
||||||
//
|
|
||||||
// /// todo : working
|
|
||||||
// // _search.fromSearch(widget.initialSearchValue);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// DateTime today = DateTime.now();
|
|
||||||
// return SizedBox(
|
|
||||||
// height: MediaQuery.of(context).size.height / 1.3,
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: ListView(
|
|
||||||
// // shrinkWrap: true,
|
|
||||||
// // physics: const ClampingScrollPhysics(),
|
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.cancel,
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.search,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ASwitchButton(
|
|
||||||
// title: "Most Recent",
|
|
||||||
// value: _search.mostRecent ?? false,
|
|
||||||
// onChange: (value) {
|
|
||||||
// _search.mostRecent = value;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// // ATextFormField(
|
|
||||||
// // initialValue: _search.deviceNumber,
|
|
||||||
// // hintText: context.translation.assetNumber,
|
|
||||||
// // style: Theme.of(context).textTheme.headline6,
|
|
||||||
// // textInputAction: TextInputAction.search,
|
|
||||||
// // onAction: () {
|
|
||||||
// // if (!_formKey.currentState.validate()) {
|
|
||||||
// // return;
|
|
||||||
// // }
|
|
||||||
// // _formKey.currentState.save();
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // onSaved: (value) {
|
|
||||||
// // _search.deviceNumber = value;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // ATextFormField(
|
|
||||||
// // initialValue: _search.deviceName,
|
|
||||||
// // hintText: context.translation.assetName,
|
|
||||||
// // style: Theme.of(context).textTheme.headline6,
|
|
||||||
// // textInputAction: TextInputAction.search,
|
|
||||||
// // onAction: () {
|
|
||||||
// // if (!_formKey.currentState.validate()) {
|
|
||||||
// // return;
|
|
||||||
// // }
|
|
||||||
// // _formKey.currentState.save();
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // onSaved: (value) {
|
|
||||||
// // _search.deviceName = value;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // ATextFormField(
|
|
||||||
// // initialValue: _search.deviceSerialNumber,
|
|
||||||
// // hintText: context.translation.serialNumber,
|
|
||||||
// // style: Theme.of(context).textTheme.headline6,
|
|
||||||
// // textInputAction: TextInputAction.search,
|
|
||||||
// // onAction: () {
|
|
||||||
// // if (!_formKey.currentState.validate()) {
|
|
||||||
// // return;
|
|
||||||
// // }
|
|
||||||
// // _formKey.currentState.save();
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // onSaved: (value) {
|
|
||||||
// // _search.deviceSerialNumber = value;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // HospitalAutoCompleteField(
|
|
||||||
// // initialValue: _search.hospital?.name,
|
|
||||||
// // // onSave: (value){
|
|
||||||
// // // _search.hospital = value;
|
|
||||||
// // // },
|
|
||||||
// // onSearch: (value) {
|
|
||||||
// // _search.hospital = value;
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // // SizedBox(height: 8.0 * AppStyle.getScaleFactor(context),),
|
|
||||||
// // // ATextFormField(
|
|
||||||
// // // initialValue: _search.brand,
|
|
||||||
// // // hintText: _subtitle.brand,
|
|
||||||
// // // style: Theme.of(context).textTheme.headline6,
|
|
||||||
// // // textInputAction: TextInputAction.search,
|
|
||||||
// // // onAction: (){
|
|
||||||
// // // if(!_formKey.currentState.validate()) {
|
|
||||||
// // // return;
|
|
||||||
// // // }
|
|
||||||
// // // _formKey.currentState.save();
|
|
||||||
// // // Navigator.of(context).pop(_search);
|
|
||||||
// // // },
|
|
||||||
// // // onSaved: (value){
|
|
||||||
// // // _search.brand = value;
|
|
||||||
// // // },
|
|
||||||
// // // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // AutoCompleteModelField(
|
|
||||||
// // initialValue: _search.model,
|
|
||||||
// // onPick: (lookup) {
|
|
||||||
// // _search.model = lookup;
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // // ATextFormField(
|
|
||||||
// // // initialValue: _search.model,
|
|
||||||
// // // hintText: _subtitle.model,
|
|
||||||
// // // style: Theme.of(context).textTheme.headline6,
|
|
||||||
// // // textInputAction: TextInputAction.search,
|
|
||||||
// // // onAction: (){
|
|
||||||
// // // if(!_formKey.currentState.validate()) {
|
|
||||||
// // // return;
|
|
||||||
// // // }
|
|
||||||
// // // _formKey.currentState.save();
|
|
||||||
// // // Navigator.of(context).pop(_search);
|
|
||||||
// // // },
|
|
||||||
// // // onSaved: (value){
|
|
||||||
// // // _search.model = value;
|
|
||||||
// // // },
|
|
||||||
// // // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // ASubTitle(context.translation.status),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 4.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // PentryVisitsStatusMenu(
|
|
||||||
// // initialValue: _search.statusValue,
|
|
||||||
// // onSelect: (status) {
|
|
||||||
// // _search.statusValue = status;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // Wrap(
|
|
||||||
// // spacing: 10,
|
|
||||||
// // runSpacing: 10,
|
|
||||||
// // children: List.generate(
|
|
||||||
// // status.length,
|
|
||||||
// // (index) {
|
|
||||||
// // bool isSelected = _search.statusValue == status[index].id;
|
|
||||||
// // return FilterItem(
|
|
||||||
// // isSelected: isSelected,
|
|
||||||
// // onSelected: (){
|
|
||||||
// // if(isSelected) {
|
|
||||||
// // _search.statusValue = null;
|
|
||||||
// // } else {
|
|
||||||
// // _search.statusValue = status[index].id;
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // status: status[index],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ASubTitle(context.translation.contactStatus),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 4.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// // AssignedToMenu(
|
|
||||||
// // initialValue: _search.contactStatus,
|
|
||||||
// // onSelect: (status) {
|
|
||||||
// // _search.contactStatus = status;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // Wrap(
|
|
||||||
// // spacing: 10,
|
|
||||||
// // runSpacing: 10,
|
|
||||||
// // children: List.generate(
|
|
||||||
// // contactStatus.length,
|
|
||||||
// // (index) {
|
|
||||||
// // bool isSelected = _search.contactStatus == contactStatus[index];
|
|
||||||
// // return FilterItem(
|
|
||||||
// // isSelected: isSelected,
|
|
||||||
// // onSelected: (){
|
|
||||||
// // if(isSelected) {
|
|
||||||
// // _search.contactStatus = null;
|
|
||||||
// // } else {
|
|
||||||
// // _search.contactStatus = contactStatus[index];
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // status: contactStatus[index],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ASubTitle(context.translation.actualDate),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 4.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// // FromToDateBar(
|
|
||||||
// // from: _search.actualDateFrom,
|
|
||||||
// // to: _search.actualDateTo,
|
|
||||||
// // onPickFrom: (date) {
|
|
||||||
// // _search.actualDateFrom = date;
|
|
||||||
// // },
|
|
||||||
// // onPickTo: (date) {
|
|
||||||
// // _search.actualDateTo = date;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // ASubTitle(context.translation.expectDate),
|
|
||||||
// // SizedBox(
|
|
||||||
// // height: 4.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// // ),
|
|
||||||
// // FromToDateBar(
|
|
||||||
// // from: _search.expectedDateFrom ?? DateTime(today.year, today.month, 1),
|
|
||||||
// // to: _search.expectedDateTo ?? DateTime(today.year, (today.month + 1).clamp(1, 12), today.month == 12 ? 31 : 0),
|
|
||||||
// // onPickFrom: (date) {
|
|
||||||
// // _search.expectedDateFrom = date;
|
|
||||||
// // },
|
|
||||||
// // onPickTo: (date) {
|
|
||||||
// // _search.expectedDateTo = date;
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // Visibility(
|
|
||||||
// // visible: _search.toMap().isNotEmpty,
|
|
||||||
// // child: Padding(
|
|
||||||
// // padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
||||||
// // child: AButton(
|
|
||||||
// // padding: EdgeInsets.zero,
|
|
||||||
// // text: context.translation.clearSearch,
|
|
||||||
// // onPressed: () {
|
|
||||||
// // _search = VisitsSearch();
|
|
||||||
// // Navigator.of(context).pop(_search);
|
|
||||||
// // },
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,330 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/models/service_request/service_request_search.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_small_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/hospitals/hospital_auto_complete_field.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/service_request/service_request_status_mune.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/switch_button.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
//
|
|
||||||
// import '../../../models/employee.dart';
|
|
||||||
// import '../../../models/new_models/assigned_employee.dart';
|
|
||||||
// import '../app_text_form_field.dart';
|
|
||||||
// import '../date_and_time/date_picker.dart';
|
|
||||||
// import '../status/report/service_report_all_users.dart';
|
|
||||||
// import '../status/report/service_report_visit_date_operator.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestsSearchDialog extends StatefulWidget {
|
|
||||||
// final ServiceRequestSearch initialSearchValue;
|
|
||||||
// final bool expandedSearch;
|
|
||||||
// final Function(ServiceRequestSearch) onSearch;
|
|
||||||
//
|
|
||||||
// const ServiceRequestsSearchDialog({Key? key, this.initialSearchValue, this.expandedSearch, this.onSearch}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _ServiceRequestsSearchDialogState createState() => _ServiceRequestsSearchDialogState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _ServiceRequestsSearchDialogState extends State<ServiceRequestsSearchDialog> with TickerProviderStateMixin {
|
|
||||||
// ServiceRequestSearch _search;
|
|
||||||
// List<Lookup> status = [
|
|
||||||
// Lookup(
|
|
||||||
// name: "New",
|
|
||||||
// id: 4,
|
|
||||||
// ),
|
|
||||||
// Lookup(
|
|
||||||
// name: "Repaired",
|
|
||||||
// id: 6,
|
|
||||||
// ),
|
|
||||||
// Lookup(name: "Repeated", id: 8),
|
|
||||||
// Lookup(
|
|
||||||
// name: "Closed",
|
|
||||||
// id: 9,
|
|
||||||
// ),
|
|
||||||
// Lookup(
|
|
||||||
// name: "Under Repair",
|
|
||||||
// id: 5,
|
|
||||||
// ),
|
|
||||||
// ];
|
|
||||||
//
|
|
||||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// super.initState();
|
|
||||||
// _search = ServiceRequestSearch();
|
|
||||||
// _search.fromSearch(widget.initialSearchValue);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return SizedBox(
|
|
||||||
// height: MediaQuery.of(context).size.height / 1.2,
|
|
||||||
// child: Form(
|
|
||||||
// key: _formKey,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(16.0),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.cancel,
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ASmallButton(
|
|
||||||
// text: context.translation.search,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ASwitchButton(
|
|
||||||
// title: "Most Recent",
|
|
||||||
// value: _search.mostRecent ?? false,
|
|
||||||
// onChange: (value) {
|
|
||||||
// _search.mostRecent = value;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// labelText: "Call ID",
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _search.callId = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: _search.deviceNumber,
|
|
||||||
// hintText: context.translation.assetNumber,
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _search.deviceNumber = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: _search.deviceSerialNumber,
|
|
||||||
// hintText: context.translation.serialNumber,
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _search.deviceSerialNumber = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// HospitalAutoCompleteField(
|
|
||||||
// initialValue: _search.hospital?.name,
|
|
||||||
// // onSave: (value){
|
|
||||||
// // _search.hospital = value;
|
|
||||||
// // },
|
|
||||||
// onSearch: (value) {
|
|
||||||
// _search.hospital = value;
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: _search.deviceName,
|
|
||||||
// hintText: context.translation.deviceName,
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _search.deviceName = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 8.0 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ATextFormField(
|
|
||||||
// initialValue: _search.model,
|
|
||||||
// hintText: context.translation.model,
|
|
||||||
// style: Theme.of(context).textTheme.headline6,
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// onAction: () {
|
|
||||||
// if (!_formKey.currentState.validate()) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// _formKey.currentState.save();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// onSaved: (value) {
|
|
||||||
// _search.model = value;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 16 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// const ASubTitle("Status"),
|
|
||||||
// const SizedBox(
|
|
||||||
// height: 4,
|
|
||||||
// ),
|
|
||||||
// ServiceRequestStatusMenu(
|
|
||||||
// initialValue: _search.statusValue,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// _search.statusValue = status;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 16 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// ASubTitle(context.translation.assignedEmployee),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportAllUsers(
|
|
||||||
// initialValue: _search.assignedEmployee == null ? null : Employee(id: _search.assignedEmployee.id, name: _search.assignedEmployee.name),
|
|
||||||
// onSelect: (engineer) {
|
|
||||||
// _search.assignedEmployee = AssignedEmployee(id: engineer.id, name: engineer.name);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// SizedBox(
|
|
||||||
// height: 16 * AppStyle.getScaleFactor(context),
|
|
||||||
// ),
|
|
||||||
// const ASubTitle("Request Date"),
|
|
||||||
// const SizedBox(height: 4),
|
|
||||||
// ServiceReportVisitDateOperator(
|
|
||||||
// initialValue: _search.dateOperator,
|
|
||||||
// onSelect: (status) {
|
|
||||||
// _search.dateOperator = status;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
// children: [
|
|
||||||
// if (_search?.dateOperator?.name?.toLowerCase()?.contains("between") ?? false) const ASubTitle("From"),
|
|
||||||
// ADatePicker(
|
|
||||||
// date: DateTime.tryParse(_search.from ?? ""),
|
|
||||||
// from: DateTime(1950),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _search.from = date?.toIso8601String();
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (_search?.dateOperator?.name?.toLowerCase()?.contains("between") ?? false) const SizedBox(width: 16),
|
|
||||||
// if (_search?.dateOperator?.name?.toLowerCase()?.contains("between") ?? false)
|
|
||||||
// Expanded(
|
|
||||||
// child: Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
// children: [
|
|
||||||
// const ASubTitle("To"),
|
|
||||||
// ADatePicker(
|
|
||||||
// date: DateTime.tryParse(_search.to ?? ""),
|
|
||||||
// from: DateTime(1950),
|
|
||||||
// onDatePicker: (date) {
|
|
||||||
// _search.to = date?.toIso8601String();
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// const SizedBox(width: 16),
|
|
||||||
// // Padding(
|
|
||||||
// // padding: const EdgeInsets.symmetric(horizontal: 12),
|
|
||||||
// // child: Wrap(
|
|
||||||
// // spacing: 10,
|
|
||||||
// // runSpacing: 10,
|
|
||||||
// // alignment: WrapAlignment.spaceEvenly,
|
|
||||||
// // children: List.generate(
|
|
||||||
// // status.length,
|
|
||||||
// // (index) {
|
|
||||||
// // bool isSelected = _search.statusValue == status[index];
|
|
||||||
// // return FilterItem(
|
|
||||||
// // isSelected: isSelected,
|
|
||||||
// // onSelected: (){
|
|
||||||
// // if(isSelected) {
|
|
||||||
// // _search.statusValue = null;
|
|
||||||
// // } else {
|
|
||||||
// // _search.statusValue = status[index];
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // setState(() {});
|
|
||||||
// // },
|
|
||||||
// // status: status[index],
|
|
||||||
// // );
|
|
||||||
// // }
|
|
||||||
// //
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
// // ),
|
|
||||||
//
|
|
||||||
// Visibility(
|
|
||||||
// visible: widget.initialSearchValue.toMap().isNotEmpty,
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
|
||||||
// child: AButton(
|
|
||||||
// padding: EdgeInsets.zero,
|
|
||||||
// text: context.translation.clearSearch,
|
|
||||||
// onPressed: () {
|
|
||||||
// _search = ServiceRequestSearch();
|
|
||||||
// Navigator.of(context).pop(_search);
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,156 +0,0 @@
|
|||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:speech_to_text/speech_recognition_error.dart';
|
|
||||||
// import 'package:speech_to_text/speech_recognition_result.dart';
|
|
||||||
// import 'package:speech_to_text/speech_to_text.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
||||||
// import 'package:test_sa/new_views/app_style/app_text_style.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/buttons/app_icon_button2.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
//
|
|
||||||
// class SpeechToTextButton extends StatefulWidget {
|
|
||||||
// final TextEditingController controller;
|
|
||||||
// final bool mini;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// const SpeechToTextButton({Key? key, this.controller, this.mini = false, this.enabled = true}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _SpeechToTextButtonState createState() => _SpeechToTextButtonState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _SpeechToTextButtonState extends State<SpeechToTextButton> {
|
|
||||||
// bool _speechEnabled = false;
|
|
||||||
// SettingProvider _settingProvider;
|
|
||||||
// final SpeechToText _speechToText = SpeechToText();
|
|
||||||
//
|
|
||||||
// /// This has to happen only once per app
|
|
||||||
// void _initSpeech() async {
|
|
||||||
// _speechEnabled = await _speechToText.initialize(
|
|
||||||
// onError: (SpeechRecognitionError error) async {
|
|
||||||
// Fluttertoast.showToast(msg: "failed to convert text to speech");
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// Each time to start a speech recognition session
|
|
||||||
// void _startListening() async {
|
|
||||||
// _speechEnabled = _speechToText.isAvailable;
|
|
||||||
// if (_speechToText.isListening) {
|
|
||||||
// Fluttertoast.showToast(msg: "Currently in use");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!_speechEnabled) return;
|
|
||||||
// await _speechToText.listen(
|
|
||||||
// onResult: (SpeechRecognitionResult result) {
|
|
||||||
// widget.controller.text = result.recognizedWords;
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// localeId: _settingProvider.speechToText);
|
|
||||||
// setState(() {});
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /// Manually stop the active speech recognition session
|
|
||||||
// /// Note that there are also timeouts that each platform enforces
|
|
||||||
// /// and the SpeechToText plugin supports setting timeouts on the
|
|
||||||
// /// listen method.
|
|
||||||
// void _stopListening() async {
|
|
||||||
// await _speechToText.stop();
|
|
||||||
// setState(() {});
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _initSpeech();
|
|
||||||
// widget.controller.addListener(() {
|
|
||||||
// setState(() {});
|
|
||||||
// });
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void setState(VoidCallback fn) {
|
|
||||||
// if (!mounted) return;
|
|
||||||
// super.setState(fn);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// _settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.only(left: 12, right: 12),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: context.isDark && (widget.enabled == false)
|
|
||||||
// ? AppColor.neutral50
|
|
||||||
// : (widget.enabled == false)
|
|
||||||
// ? AppColor.neutral40
|
|
||||||
// : AppColor.background(context),
|
|
||||||
// borderRadius: BorderRadius.circular(10),
|
|
||||||
// boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
||||||
// ),
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// widget.mini
|
|
||||||
// ? const SizedBox.shrink()
|
|
||||||
// : Text(
|
|
||||||
// "Speech To Text",
|
|
||||||
// style: Theme.of(context).textTheme.bodyLarge,
|
|
||||||
// ),
|
|
||||||
// widget.controller.text.isNotEmpty && widget.enabled
|
|
||||||
// ? AIconButton2(
|
|
||||||
// iconData: Icons.delete,
|
|
||||||
// color: context.isDark ? Colors.white : Colors.black87,
|
|
||||||
// onPressed: () {
|
|
||||||
// widget.controller.clear();
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// )
|
|
||||||
// : const SizedBox.shrink(),
|
|
||||||
// const Spacer(),
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: widget.enabled
|
|
||||||
// ? () {
|
|
||||||
// if (_speechToText.isListening) return;
|
|
||||||
//
|
|
||||||
// if (_settingProvider.speechToText == "ar") {
|
|
||||||
// _settingProvider.setSpeechToText("en");
|
|
||||||
// } else {
|
|
||||||
// _settingProvider.setSpeechToText("ar");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// : null,
|
|
||||||
// child: Text(_settingProvider.speechToText)),
|
|
||||||
// GestureDetector(
|
|
||||||
// child: _speechToText.isListening
|
|
||||||
// ? const Icon(
|
|
||||||
// Icons.fiber_manual_record,
|
|
||||||
// color: Colors.red,
|
|
||||||
// )
|
|
||||||
// : Icon(
|
|
||||||
// Icons.mic,
|
|
||||||
// color: Theme.of(context).colorScheme.primary,
|
|
||||||
// ),
|
|
||||||
// onTap: widget.enabled
|
|
||||||
// ? () async {
|
|
||||||
// if (!_speechEnabled) {
|
|
||||||
// Fluttertoast.showToast(msg: "microphone not available");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (_speechToText.isListening) {
|
|
||||||
// _stopListening();
|
|
||||||
// } else {
|
|
||||||
// _startListening();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// : null,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/asset_transfer_status_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class AssetStatusMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// const AssetStatusMenu({Key? key, this.enabled = true, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final assetProvider = Provider.of<AssetTransferStatusProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: assetProvider.isLoading,
|
|
||||||
// isFailedLoading: assetProvider.items == null,
|
|
||||||
// stateCode: assetProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// assetProvider.reset();
|
|
||||||
// await assetProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: assetProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// enabled: enabled,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/employee/assigned_to_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class AssignedToMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const AssignedToMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<AssignedToProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/employee/engineers_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/employee/single_type_menu.dart';
|
|
||||||
//
|
|
||||||
// class EngineersMenu extends StatelessWidget {
|
|
||||||
// final Function(Employee) onSelect;
|
|
||||||
// final Employee initialValue;
|
|
||||||
//
|
|
||||||
// const EngineersMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<EngineersProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleEngineerMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// engineers: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,87 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class SingleEngineerMenu extends StatefulWidget {
|
|
||||||
// final List<Employee> engineers;
|
|
||||||
// final Employee initialStatus;
|
|
||||||
// final Function(Employee) onSelect;
|
|
||||||
//
|
|
||||||
// const SingleEngineerMenu({Key? key, this.engineers, this.onSelect, this.initialStatus}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _SingleEngineerMenuState createState() => _SingleEngineerMenuState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _SingleEngineerMenuState extends State<SingleEngineerMenu> {
|
|
||||||
// Employee _selectedStatus;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant SingleEngineerMenu oldWidget) {
|
|
||||||
// if (widget.initialStatus != null && widget.initialStatus.id != null) {
|
|
||||||
// _selectedStatus = widget.engineers?.firstWhere((element) {
|
|
||||||
// return element == widget.initialStatus;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// } else {
|
|
||||||
// _selectedStatus = null;
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// if (widget.initialStatus != null && widget.initialStatus.id != null) {
|
|
||||||
// _selectedStatus = widget.engineers?.firstWhere((element) {
|
|
||||||
// return element == widget.initialStatus;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// // border: Border.all(color: AColors.black),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// boxShadow: const [AppStyle.boxShadow]),
|
|
||||||
// child: DropdownButton<Employee>(
|
|
||||||
// value: _selectedStatus,
|
|
||||||
// iconSize: 24,
|
|
||||||
// elevation: 16,
|
|
||||||
// isExpanded: true,
|
|
||||||
// hint: Text(
|
|
||||||
// "Select",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
// underline: SizedBox.shrink(),
|
|
||||||
// onChanged: (Employee newValue) {
|
|
||||||
// setState(() {
|
|
||||||
// _selectedStatus = newValue;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(newValue);
|
|
||||||
// },
|
|
||||||
// items: widget.engineers.map<DropdownMenuItem<Employee>>((Employee value) {
|
|
||||||
// return DropdownMenuItem<Employee>(
|
|
||||||
// value: value,
|
|
||||||
// child: Text(
|
|
||||||
// value.name,
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// fontSize: 11,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }).toList(),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/gas_refill/gas_cylinder_size_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class GasCylinderSizeMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const GasCylinderSizeMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<GasCylinderSizesProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/gas_refill/gas_cylinder_type_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class GasCylinderTypesMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const GasCylinderTypesMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<GasCylinderTypesProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/gas_refill/gas_status_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class GasStatusMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// const GasStatusMenu({Key? key, this.enabled = true, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<GasStatusProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// enabled: enabled,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/gas_refill/gas_types_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class GasTypeMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const GasTypeMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<GasTypesProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,118 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:flutter_typeahead/flutter_typeahead.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class MultiStatusMenu extends StatefulWidget {
|
|
||||||
// final List<Lookup> statuses;
|
|
||||||
// final List<Lookup> initialSelectedStatus;
|
|
||||||
// final Function(List<Lookup>) onSelect;
|
|
||||||
//
|
|
||||||
// const MultiStatusMenu({Key? key, this.statuses, this.onSelect, this.initialSelectedStatus}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _MultiStatusMenuState createState() => _MultiStatusMenuState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _MultiStatusMenuState extends State<MultiStatusMenu> {
|
|
||||||
// List<Lookup> _selectedStatus = [];
|
|
||||||
// TextEditingController _controller;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// _controller = TextEditingController();
|
|
||||||
// _selectedStatus.addAll(widget.initialSelectedStatus);
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void dispose() {
|
|
||||||
// _controller.clear();
|
|
||||||
// super.dispose();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Wrap(
|
|
||||||
// crossAxisAlignment: WrapCrossAlignment.start,
|
|
||||||
// alignment: WrapAlignment.start,
|
|
||||||
// runAlignment: WrapAlignment.start,
|
|
||||||
// children: List.generate(_selectedStatus.length, (index) {
|
|
||||||
// final status = _selectedStatus[index];
|
|
||||||
// return Container(
|
|
||||||
// height: 36 * AppStyle.getScaleFactor(context),
|
|
||||||
// margin: EdgeInsets.all(4 * AppStyle.getScaleFactor(context)),
|
|
||||||
// //padding: EdgeInsets.all(4 * AppStyle.getScaleFactor(context)),
|
|
||||||
// decoration: BoxDecoration(color: Theme.of(context).colorScheme.primary, borderRadius: BorderRadius.circular(8)),
|
|
||||||
// child: Row(
|
|
||||||
// mainAxisSize: MainAxisSize.min,
|
|
||||||
// children: [
|
|
||||||
// const SizedBox(
|
|
||||||
// width: 12,
|
|
||||||
// ),
|
|
||||||
// Text(
|
|
||||||
// status.name,
|
|
||||||
// style: Theme.of(context).textTheme.bodyText1.copyWith(
|
|
||||||
// color: Theme.of(context).colorScheme.onPrimary,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// IconButton(
|
|
||||||
// color: Theme.of(context).colorScheme.onPrimary,
|
|
||||||
// onPressed: () {
|
|
||||||
// _selectedStatus.remove(status);
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// icon: const Icon(Icons.delete))
|
|
||||||
// ],
|
|
||||||
// ));
|
|
||||||
// }),
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: Colors.white,
|
|
||||||
// // border: Border.all(color: AColors.black),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// boxShadow: const [AppStyle.boxShadow]),
|
|
||||||
// child: TypeAheadField<Lookup>(
|
|
||||||
// textFieldConfiguration: TextFieldConfiguration(
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
// controller: _controller,
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// decoration: const InputDecoration(
|
|
||||||
// border: InputBorder.none,
|
|
||||||
// disabledBorder: InputBorder.none,
|
|
||||||
// focusedBorder: InputBorder.none,
|
|
||||||
// enabledBorder: InputBorder.none,
|
|
||||||
// ),
|
|
||||||
// textInputAction: TextInputAction.search,
|
|
||||||
// ),
|
|
||||||
// suggestionsCallback: (vale) {
|
|
||||||
// return widget.statuses.where((Lookup option) {
|
|
||||||
// return option.name.toLowerCase().contains(_controller.text);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// itemBuilder: (context, part) {
|
|
||||||
// return ListTile(
|
|
||||||
// title: Text(part.name),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// onSuggestionSelected: (status) {
|
|
||||||
// _controller.clear();
|
|
||||||
// if (!_selectedStatus.contains(status)) {
|
|
||||||
// _selectedStatus.add(status);
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// setState(() {});
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/pentry/pentry_status_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class PentryStatusMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const PentryStatusMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<PentryStatusProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/pentry/pentry_task_status_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class PentryTaskStatusMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const PentryTaskStatusMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<PentryTaskStatusProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/pentry/pentry_visit_status_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class PentryVisitsStatusMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const PentryVisitsStatusMenu({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<PentryVisitStatusProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:test_sa/models/fault_description.dart';
|
|
||||||
// import 'package:test_sa/views/app_style/sizing.dart';
|
|
||||||
//
|
|
||||||
// class FaultDescriptionMenu extends StatefulWidget {
|
|
||||||
// final List<FaultDescription> statuses;
|
|
||||||
// final FaultDescription initialStatus;
|
|
||||||
// final Function(FaultDescription) onSelect;
|
|
||||||
//
|
|
||||||
// const FaultDescriptionMenu({Key? key, this.statuses, this.onSelect, this.initialStatus}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// _SingleStatusMenuState createState() => _SingleStatusMenuState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// class _SingleStatusMenuState extends State<FaultDescriptionMenu> {
|
|
||||||
// FaultDescription _selectedStatus;
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void setState(VoidCallback fn) {
|
|
||||||
// if (mounted) super.setState(fn);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void didUpdateWidget(covariant FaultDescriptionMenu oldWidget) {
|
|
||||||
// if (widget.initialStatus != null) {
|
|
||||||
// final result = widget.statuses?.where((element) {
|
|
||||||
// return element.id == widget.initialStatus.id;
|
|
||||||
// });
|
|
||||||
// if (result.isNotEmpty) {
|
|
||||||
// _selectedStatus = result.first;
|
|
||||||
// } else {
|
|
||||||
// _selectedStatus = null;
|
|
||||||
// }
|
|
||||||
// if ((widget.initialStatus?.id ?? "") != (_selectedStatus?.id ?? "")) {
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// _selectedStatus = null;
|
|
||||||
// }
|
|
||||||
// super.didUpdateWidget(oldWidget);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// void initState() {
|
|
||||||
// if (widget.initialStatus != null) {
|
|
||||||
// final result = widget.statuses?.where((element) {
|
|
||||||
// return element.id == widget.initialStatus.id;
|
|
||||||
// });
|
|
||||||
// if (result.isNotEmpty) _selectedStatus = result.first;
|
|
||||||
// if (widget.initialStatus.id != _selectedStatus?.id) {
|
|
||||||
// widget.onSelect(_selectedStatus);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// super.initState();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// return Container(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// // color: AColors.inputFieldBackgroundColor,
|
|
||||||
// border: Border.all(
|
|
||||||
// color: Color(0xffefefef),
|
|
||||||
// ),
|
|
||||||
// borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
|
||||||
// // boxShadow: const [
|
|
||||||
// // AppStyle.boxShadow
|
|
||||||
// // ]
|
|
||||||
// ),
|
|
||||||
// child: DropdownButton<FaultDescription>(
|
|
||||||
// value: _selectedStatus,
|
|
||||||
// iconSize: 24,
|
|
||||||
// icon: const Icon(Icons.keyboard_arrow_down_rounded),
|
|
||||||
// elevation: 0,
|
|
||||||
// isExpanded: true,
|
|
||||||
// hint: Text(
|
|
||||||
// "Select",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(color: widget.statuses.isEmpty ? Colors.grey : null),
|
|
||||||
// ),
|
|
||||||
// style: TextStyle(color: Theme.of(context).primaryColor),
|
|
||||||
// underline: const SizedBox.shrink(),
|
|
||||||
// onChanged: (FaultDescription newValue) {
|
|
||||||
// setState(() {
|
|
||||||
// _selectedStatus = newValue;
|
|
||||||
// });
|
|
||||||
// widget.onSelect(newValue);
|
|
||||||
// },
|
|
||||||
// items: widget.statuses.map<DropdownMenuItem<FaultDescription>>(
|
|
||||||
// (FaultDescription value) {
|
|
||||||
// return DropdownMenuItem<FaultDescription>(
|
|
||||||
// value: value,
|
|
||||||
// child: Text(
|
|
||||||
// value.defectName ?? "",
|
|
||||||
// style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// fontSize: 11,
|
|
||||||
// //fontWeight: FontWeight.bold
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// ).toList(),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_report_users_provider.dart';
|
|
||||||
// import 'package:test_sa/models/employee.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/users_menu.dart';
|
|
||||||
//
|
|
||||||
// class ServiceReportAllUsers extends StatelessWidget {
|
|
||||||
// final Function(Employee) onSelect;
|
|
||||||
// final Employee initialValue;
|
|
||||||
//
|
|
||||||
// const ServiceReportAllUsers({Key? key, required this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// ServiceReportUsersProvider menuProvider = Provider.of<ServiceReportUsersProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.engineers == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.getAllUsers();
|
|
||||||
// },
|
|
||||||
// child: UsersMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.engineers,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_report_defect_types_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestDefectTypesMenu extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// const ServiceRequestDefectTypesMenu({Key? key, this.onSelect, this.initialValue, this.enabled = true}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<ServiceRequestDefectTypesProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// enabled: enabled,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// import '../../../../controllers/providers/api/status_drop_down/service_reqest/service_request_first_action_provider.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestedFirstAction extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
// final bool enabled;
|
|
||||||
//
|
|
||||||
// const ServiceRequestedFirstAction({Key? key, this.onSelect, this.initialValue, this.enabled = true}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<ServiceFirstActionProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// enabled: enabled,
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
///todo deleted
|
|
||||||
/// Loan availability not required
|
|
||||||
// import 'package:flutter/material.dart';
|
|
||||||
// import 'package:provider/provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
// import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
||||||
// import 'package:test_sa/models/lookup.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
||||||
// import 'package:test_sa/views/widgets/status/single_status_menu.dart';
|
|
||||||
//
|
|
||||||
// import '../../../../controllers/providers/api/status_drop_down/service_reqest/service_request_loan_availability_provider.dart';
|
|
||||||
//
|
|
||||||
// class ServiceRequestedLoanAvailability extends StatelessWidget {
|
|
||||||
// final Function(Lookup) onSelect;
|
|
||||||
// final Lookup initialValue;
|
|
||||||
//
|
|
||||||
// const ServiceRequestedLoanAvailability({Key? key, this.onSelect, this.initialValue}) : super(key: key);
|
|
||||||
//
|
|
||||||
// @override
|
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
// final settingProvider = Provider.of<SettingProvider>(context);
|
|
||||||
// final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
// final menuProvider = Provider.of<ServiceLoanAvailabilityProvider>(context);
|
|
||||||
// return LoadingManager(
|
|
||||||
// isLoading: menuProvider.isLoading,
|
|
||||||
// isFailedLoading: menuProvider.items == null,
|
|
||||||
// stateCode: menuProvider.stateCode,
|
|
||||||
// onRefresh: () async {
|
|
||||||
// menuProvider.reset();
|
|
||||||
// await menuProvider.getData(user: userProvider.user, host: settingProvider.host);
|
|
||||||
// },
|
|
||||||
// child: SingleStatusMenu(
|
|
||||||
// initialStatus: initialValue,
|
|
||||||
// statuses: menuProvider.items,
|
|
||||||
// onSelect: onSelect,
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue