Merge branch 'main_latest_merged' into zaid_development_new

# Conflicts:
#	assets/subtitles/en_subtitle.json
#	lib/controllers/providers/api/status_drop_down/report/service_report_last_calls_provider.dart
#	lib/models/subtitle.dart
#	lib/views/pages/user/requests/report/create_service_report.dart
#	lib/views/pages/user/requests/report/edit_service_report.dart
#	lib/views/widgets/status/report/service_report_status.dart
merge-requests/30/head
Sikander Saleem 1 year ago
commit 29181aa965

@ -137,7 +137,6 @@
"workPerformed": "العمل انجز",
"actualDate": "تاريخ الفعلي",
"done": "تم الانتهاء",
"expectDate": "التاريخ المتوقع",
"images": "الصور",
"imagesRequired": "الصور مطلوبة",
@ -189,6 +188,13 @@
"duplicateAlert": "تنبيه التكرار",
"duplicateAlertMessage": "هل أنت متأكد أنك تريد تكرار الطلب؟",
"duplicateRequest": "تكرار الطلب",
"orderWorkNumber": "رقم طلب العمل",
"assignedEmployee": "الموظف المعين",
"assetSN": "رقم تسلسلي للاصل ",
"assetName": "اسم الاصل",
"site": "الموقع",
"maintenanceSituation": "موقع الصيانه",
"currentSituation": "الموقع الحالي",
"comment" : "تعليق",
"updateServiceRequest" : "تعديل طلب الخدمة",
"repairLocation" : "موقع الإصلاح",

@ -136,7 +136,6 @@
"workPerformed": "Work Performed",
"actualDate": "Actual Date",
"done": "Done",
"expectDate": "Expect Date",
"images": "Images",
"imagesRequired": "Images Required",
@ -184,6 +183,13 @@
"requiredWord": "required",
"serviceType": "Service Type",
"workPreformed": "Work Preformed",
"orderWorkNumber": "Order Work Number",
"assignedEmployee": "Assigned Employee",
"assetSN": "Asset S.N",
"assetName": "Asset Name",
"site": "Site",
"maintenanceSituation": "Maintenance Situation",
"currentSituation": "Current Situation",
"alert": "Alert",
"duplicateAlert": "Duplicate Alert",

@ -8,7 +8,6 @@ import 'package:http/http.dart';
import 'package:test_sa/models/user.dart';
class ApiManager {
ApiManager._();
Map<String, String> get _headers => {
@ -21,10 +20,9 @@ class ApiManager {
User user;
Future<http.Response> get(
String url,
{Map<String,String> headers,}
) async{
String url, {
Map<String, String> headers,
}) async {
headers ??= {};
headers.addAll(_headers);
@ -47,9 +45,7 @@ class ApiManager {
String url, {
Map<String, String> headers,
@required Map<String, dynamic> body,
}
) async{
}) async {
headers ??= {};
headers.addAll(_headers);
@ -81,9 +77,7 @@ class ApiManager {
String url, {
Map<String, String> headers,
@required Map<String, dynamic> body,
}
) async{
}) async {
headers ??= {};
headers.addAll(_headers);
@ -115,7 +109,9 @@ class ApiManager {
@required Map<String, String> body,
@required List<Future<MultipartFile>> files,
}) async {
Map<String,String> _headers = const {'Content-Type': 'multipart/form-data',};
Map<String, String> _headers = const {
'Content-Type': 'multipart/form-data',
};
headers ??= {};

@ -35,6 +35,5 @@ class HttpStatusManger{
// no error match so return default error
return subtitle.failedToCompleteRequest;
}
}
}

@ -49,6 +49,7 @@ class URLs {
static get updateServiceReport => "$_baseUrl/WorkOrder/UpdateWorkOrder"; // get
static get getServiceReport => "$_baseUrl/WorkOrder/GetWorkOrderById"; // get
static get createDuplicatedReport => "$_baseUrl/handle/duplicate/request"; // get
static get searchWorkOrders => "$_baseUrl/WorkOrder/SearchWorkOrders";
static get getServiceReportReasons => "$_baseUrl/Lookups/GetLookup?lookupEnum=522"; // get
static get getServiceReportTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=501"; // get

@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:test_sa/models/subtitle.dart';
class AppLocalization {
AppLocalization(this.locale);
@ -17,18 +16,15 @@ class AppLocalization {
Subtitle get subtitle => _subtitle;
Future<void> load() async {
String jsonStringValues =
await rootBundle.loadString('assets/subtitles/${locale.languageCode}_subtitle.json');
String jsonStringValues = await rootBundle.loadString('assets/subtitles/${locale.languageCode}_subtitle.json');
_subtitle = Subtitle.fromJson(json.decode(jsonStringValues));
}
// static member to have simple access to the delegate from Material App
static const LocalizationsDelegate<AppLocalization> delegate =
_DemoLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalization> delegate = _DemoLocalizationsDelegate();
}
class _DemoLocalizationsDelegate
extends LocalizationsDelegate<AppLocalization> {
class _DemoLocalizationsDelegate extends LocalizationsDelegate<AppLocalization> {
const _DemoLocalizationsDelegate();
@override

@ -8,7 +8,6 @@ import 'package:test_sa/models/app_notification.dart';
import 'notification_manger.dart';
class FirebaseNotificationManger {
static FirebaseMessaging messaging = FirebaseMessaging.instance;
static String token;
@ -56,28 +55,17 @@ class FirebaseNotificationManger{
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
AppNotification notification = AppNotification.fromJson(message.data);
if(notification.path == null
|| notification.path.isEmpty)
return;
Navigator.pushNamed(
context,
notification.path,
arguments: notification.requestId
);
if (notification.path == null || notification.path.isEmpty) return;
Navigator.pushNamed(context, notification.path, arguments: notification.requestId);
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
AppNotification notification = AppNotification.fromJson(message.data);
NotificationManger.showNotification(
title: message.notification.title,
subtext: message.notification.body,
hashcode: int.tryParse(notification.requestId ?? "") ?? 1,
payload: json.encode(message.data)
);
title: message.notification.title, subtext: message.notification.body, hashcode: int.tryParse(notification.requestId ?? "") ?? 1, payload: json.encode(message.data));
return;
});
}
}
Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {
}
Future<void> firebaseMessagingBackgroundHandler(RemoteMessage message) async {}

@ -12,39 +12,22 @@ class NotificationManger{
/// onNotificationPressed action when notification pressed to open tap
/// onIOSNotificationPressed action when notification pressed
/// to open tap in iOS versions older than 10
static initialisation(
Function(NotificationResponse) onNotificationPressed,
DidReceiveLocalNotificationCallback onIOSNotificationPressed
) async {
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
static initialisation(Function(NotificationResponse) onNotificationPressed, DidReceiveLocalNotificationCallback onIOSNotificationPressed) async {
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
// initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('app_icon',);
const AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings(
'app_icon',
);
final DarwinInitializationSettings initializationSettingsDarwin =
DarwinInitializationSettings(
onDidReceiveLocalNotification: onIOSNotificationPressed);
final DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings(onDidReceiveLocalNotification: onIOSNotificationPressed);
final InitializationSettings initializationSettings = InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsDarwin,
macOS: initializationSettingsDarwin);
final InitializationSettings initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsDarwin, macOS: initializationSettingsDarwin);
await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: onNotificationPressed);
await flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: onNotificationPressed);
}
// push new notification
static Future showNotification(
{
@required String title,
@required String subtext,
@required int hashcode,
String payload
}) async {
static Future showNotification({@required String title, @required String subtext, @required int hashcode, String payload}) async {
const AndroidNotificationDetails androidChannel = AndroidNotificationDetails(
'com.newtrack.testsa',
'Test SA',
@ -62,8 +45,7 @@ class NotificationManger{
groupKey: 'com.newtrack.testsa',
);
const DarwinNotificationDetails iosNotificationDetails =
DarwinNotificationDetails(
const DarwinNotificationDetails iosNotificationDetails = DarwinNotificationDetails(
categoryIdentifier: "testSA",
);
@ -81,5 +63,4 @@ class NotificationManger{
payload: payload,
);
}
}

@ -7,7 +7,6 @@ import 'package:test_sa/controllers/api_routes/urls.dart';
import 'package:test_sa/models/department.dart';
class DepartmentsProvider extends ChangeNotifier {
//reset provider data
void reset() {
departments = null;
@ -19,7 +18,6 @@ class DepartmentsProvider extends ChangeNotifier{
// 500 service not available
int stateCode;
// contain user data
// when user not login or register _user = null
List<Department> departments;
@ -29,26 +27,21 @@ class DepartmentsProvider extends ChangeNotifier{
// failed _loading = false
bool isLoading;
/// 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> getDepartment(String host) async {
if(isLoading == true)
return -2;
if (isLoading == true) return -2;
isLoading = true;
notifyListeners();
Response response;
try {
response = await ApiManager.instance.post(
URLs.getDepartments,
body: {
response = await ApiManager.instance.post(URLs.getDepartments, body: {
"pageSize": 50,
// if(title != null && title.isNotEmpty) "name":title,
}
);
});
} catch (error) {
isLoading = false;
stateCode = -1;
@ -65,5 +58,4 @@ class DepartmentsProvider extends ChangeNotifier{
notifyListeners();
return response.statusCode;
}
}

@ -144,8 +144,7 @@ class DeviceTransferProvider extends ChangeNotifier {
};
if (isSender) {
body.addAll(
{
body.addAll({
"senderSiteId": newModel.client.id,
"senderDepartmentId": newModel.department.id,
"senderAssignedEmployeeId": newModel.userId,
@ -162,11 +161,9 @@ class DeviceTransferProvider extends ChangeNotifier {
"receiverWorkingHours": oldModel.receiver.workingHours,
"receiverTravelingHours": oldModel.receiver.travelingHours,
"receiverAttachmentName": "${oldModel.receiver.signature}.png",
}
);
});
} else {
body.addAll(
{
body.addAll({
"senderSiteId": oldModel.sender.client.id,
"senderDepartmentId": oldModel.sender.department.id,
"senderAssignedEmployeeId": oldModel.sender.userId,
@ -183,21 +180,16 @@ class DeviceTransferProvider extends ChangeNotifier {
"receiverWorkingHours": newModel.workingHours,
"receiverTravelingHours": newModel.travelingHours,
"receiverAttachmentName": "${newModel.signature}.png",
}
);
});
}
print(body["senderWorkingHours"]);
body.addAll(newModel.toJson(isSender));
print(body);
Response response;
try {
response = await ApiManager.instance.put(
URLs.updateDeviceTransfer,
body: body
);
response = await ApiManager.instance.put(URLs.updateDeviceTransfer, body: body);
print(response.body);
print("${newModel.signature}.png");

@ -72,8 +72,7 @@ class DevicesProvider extends ChangeNotifier {
List equipmentListJson = json.decode(response.body)["data"];
_devices.addAll(equipmentListJson.map<Device>((device) => Device.fromJson(device)).toList());
nextPage = true;
}else
{
} else {
nextPage = false;
}
_loading = false;

@ -8,7 +8,6 @@ import 'package:test_sa/models/gas_refill/gas_refill_model.dart';
import 'package:test_sa/models/user.dart';
class GasRefillProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 50;
@ -44,8 +43,7 @@ class GasRefillProvider extends ChangeNotifier{
@required String host,
@required User user,
}) async {
if(isLoading == true)
return -2;
if (isLoading == true) return -2;
isLoading = true;
Response response;
@ -61,8 +59,7 @@ class GasRefillProvider extends ChangeNotifier{
if (stateCode >= 200 && stateCode < 300) {
// client's request was successfully received
List requestsListJson = json.decode(response.body)["data"];
List<GasRefillModel> itemsPage = requestsListJson.map(
(request) => GasRefillModel.fromJson(request)).toList();
List<GasRefillModel> itemsPage = requestsListJson.map((request) => GasRefillModel.fromJson(request)).toList();
items ??= [];
items.addAll(itemsPage);
if (itemsPage.length == pageItemNumber) {
@ -75,14 +72,12 @@ class GasRefillProvider extends ChangeNotifier{
isLoading = false;
notifyListeners();
return response.statusCode;
} catch (error) {
isLoading = false;
stateCode = -1;
notifyListeners();
return -1;
}
}
Future<int> createModel({
@ -97,19 +92,18 @@ class GasRefillProvider extends ChangeNotifier{
"status": model.status.toMap(),
};
body["gazRefillDetails"] = model.details.map((model) => {
body["gazRefillDetails"] = model.details
.map((model) => {
"gasType": model.type.toMap(),
"cylinderSize": model.cylinderSize.toMap(),
"cylinderType": model.cylinderType.toMap(),
"requestedQty": model.requestedQuantity,
}).toList();
})
.toList();
Response response;
try {
response = await ApiManager.instance.post(
URLs.requestGasRefill,
body: body
);
response = await ApiManager.instance.post(URLs.requestGasRefill, body: body);
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
if (items != null) {
@ -118,11 +112,9 @@ class GasRefillProvider extends ChangeNotifier{
}
}
return response.statusCode;
} catch (error) {
return -1;
}
}
Future<int> updateModel({
@ -137,20 +129,19 @@ class GasRefillProvider extends ChangeNotifier{
"status": newModel.status.toMap(),
};
body["gazRefillDetails"] = newModel.details.map((model) => {
body["gazRefillDetails"] = newModel.details
.map((model) => {
"gasType": model.type.toMap(),
"cylinderSize": model.cylinderSize.toMap(),
"cylinderType": model.cylinderType.toMap(),
"requestedQty": model.requestedQuantity,
"deliverdQty": model.deliveredQuantity,
}).toList();
})
.toList();
Response response;
try {
response = await ApiManager.instance.put(
URLs.updateGasRefill,
body: body
);
response = await ApiManager.instance.put(URLs.updateGasRefill, body: body);
// response = await post(
// Uri.parse("$host${URLs.updateGasRefill}/${newModel.id}"),
// body: body,
@ -162,10 +153,8 @@ class GasRefillProvider extends ChangeNotifier{
notifyListeners();
}
return response.statusCode;
} catch (error) {
return -1;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/hospital.dart';
import 'package:test_sa/models/user.dart';
class HospitalsProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 50;
@ -50,27 +49,22 @@ class HospitalsProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getHospitals({String host, User user, String title}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
try {
response = await ApiManager.instance.post(
URLs.getHospitals,
body: {
response = await ApiManager.instance.post(URLs.getHospitals, body: {
"pageNumber": (hospitals?.length ?? 0) ~/ pageItemNumber + 1,
"pageSize": 50,
if (title != null && title.isNotEmpty) "name": title,
}
);
});
_stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
// client's request was successfully received
List categoriesListJson = json.decode(response.body)["data"];
List<Hospital> _page = categoriesListJson.map((category) => Hospital.fromJson(category)).toList();
if(hospitals == null)
_hospitals = [];
if (hospitals == null) _hospitals = [];
_hospitals.addAll(_page);
if (_page.length >= pageItemNumber) {
@ -88,19 +82,15 @@ class HospitalsProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
Future<List<Hospital>> getHospitalsList({String host, User user, String title}) async {
Response response;
try {
response = await ApiManager.instance.post(
URLs.getHospitals,
body: {
response = await ApiManager.instance.post(URLs.getHospitals, body: {
"pageSize": 50,
if (title != null && title.isNotEmpty) "name": title,
}
);
});
// response = await get(
// Uri.parse(host + URLs.getHospitals
// + ( title == null || title.isEmpty ? "" : "?name=$title" )),
@ -123,7 +113,5 @@ class HospitalsProvider extends ChangeNotifier{
notifyListeners();
return [];
}
}
}

@ -7,7 +7,6 @@ import 'package:test_sa/models/app_notification.dart';
import 'package:test_sa/models/user.dart';
class NotificationsProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 20;
@ -34,7 +33,6 @@ class NotificationsProvider extends ChangeNotifier{
// failed _loading = false
bool isLoading;
/// 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
@ -45,30 +43,24 @@ class NotificationsProvider extends ChangeNotifier{
@required User user,
@required int hospitalId,
}) async {
if(isLoading == true)
return -2;
if (isLoading == true) return -2;
isLoading = true;
notifyListeners();
Response response;
// userId = 397.toString(); // testing id to view data
try {
response = await get(
Uri.parse(URLs.getNotifications
+"?uid=${user.id}"
Uri.parse(URLs.getNotifications +
"?uid=${user.id}"
"&token=${user.token}"
"&page=${(notifications?.length ?? 0) ~/ pageItemNumber}"),
headers: {
"Content-Type":"application/json; charset=utf-8"
}
);
headers: {"Content-Type": "application/json; charset=utf-8"});
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<AppNotification> _serviceRequestsPage = requestsListJson.map(
(request) => AppNotification.fromJson(request)).toList();
if(notifications == null)
notifications = [];
List<AppNotification> _serviceRequestsPage = requestsListJson.map((request) => AppNotification.fromJson(request)).toList();
if (notifications == null) notifications = [];
notifications.addAll(_serviceRequestsPage);
if (_serviceRequestsPage.length == pageItemNumber) {
nextPage = true;
@ -85,7 +77,6 @@ class NotificationsProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
/// return -2 if request in progress
@ -101,27 +92,18 @@ class NotificationsProvider extends ChangeNotifier{
//userId = 397.toString(); // testing id to view data
try {
response = await get(
Uri.parse(host+URLs.getNotifications
+"?uid=${user.id}&token=${user.token}"),
headers: {
"Content-Type":"application/json; charset=utf-8"
}
);
response = await get(Uri.parse(host + URLs.getNotifications + "?uid=${user.id}&token=${user.token}"), headers: {"Content-Type": "application/json; charset=utf-8"});
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<AppNotification> _recentNotifications = requestsListJson.map(
(request) => AppNotification.fromJson(request)).toList();
List<AppNotification> _recentNotifications = requestsListJson.map((request) => AppNotification.fromJson(request)).toList();
return _recentNotifications;
}
return null;
} catch (error) {
return null;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/part.dart';
import 'package:test_sa/models/user.dart';
class PartsProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 50;
@ -50,25 +49,18 @@ class PartsProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getParts({String host, User user, String title}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
try {
response = await ApiManager.instance.post(
URLs.getPartNumber,
body: {
if(title != null && title.isNotEmpty)
"partName":title
});
response = await ApiManager.instance.post(URLs.getPartNumber, body: {if (title != null && title.isNotEmpty) "partName": title});
_stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
// client's request was successfully received
List categoriesListJson = json.decode(utf8.decode(response.bodyBytes));
List<Part> _page = categoriesListJson.map((part) => Part.fromJson(part)).toList();
if(parts == null)
_parts = [];
if (parts == null) _parts = [];
_parts.addAll(_page);
if (_page.length >= pageItemNumber) {
@ -86,7 +78,6 @@ class PartsProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
/// return -2 if request in progress
@ -97,12 +88,7 @@ class PartsProvider extends ChangeNotifier{
Future<List<Part>> getPartsList({String host, User user, String title}) async {
Response response;
try {
response = await ApiManager.instance.post(
URLs.getPartNumber,
body: {
if(title != null && title.isNotEmpty)
"partName":title
});
response = await ApiManager.instance.post(URLs.getPartNumber, body: {if (title != null && title.isNotEmpty) "partName": title});
List<Part> _page = [];
if (response.statusCode >= 200 && response.statusCode < 300) {
// client's request was successfully received
@ -113,7 +99,5 @@ class PartsProvider extends ChangeNotifier{
} catch (error) {
return [];
}
}
}

@ -12,7 +12,6 @@ import 'package:test_sa/models/visits/visits_group.dart';
import 'package:test_sa/models/visits/visits_search.dart';
class RegularVisitsProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 20;
@ -51,8 +50,7 @@ class RegularVisitsProvider extends ChangeNotifier{
@required User user,
// VisitsSearch visitsSearch,
}) async {
if(isLoading == true)
return -2;
if (isLoading == true) return -2;
isLoading = true;
if (visits == null) notifyListeners();
Response response;
@ -79,9 +77,7 @@ class RegularVisitsProvider extends ChangeNotifier{
// client's request was successfully received
try {
List requestsListJson = json.decode(response.body)["data"];
List<Visit> _visits = requestsListJson.map(
(request) => Visit.fromJson(request)
).toList();
List<Visit> _visits = requestsListJson.map((request) => Visit.fromJson(request)).toList();
visits ??= [];
visits.addAll(_visits);
if (_visits.length == pageItemNumber) {
@ -139,12 +135,7 @@ class RegularVisitsProvider extends ChangeNotifier{
Future<Pentry> getPently({String host, User user, int id}) async {
Response response;
response = await get(
Uri.parse("$host${URLs.getPentry}/$id"),
headers: {
"Content-Type":"application/json; charset=utf-8"
}
);
response = await get(Uri.parse("$host${URLs.getPentry}/$id"), headers: {"Content-Type": "application/json; charset=utf-8"});
Pentry pantry;
if (response.statusCode >= 200 && response.statusCode < 300) {
@ -169,9 +160,7 @@ class RegularVisitsProvider extends ChangeNotifier{
// body["vChecklists"]?.addAll({});
// body["vCalibrationTools"]?.addAll({"visitId": visit.id,});
// body["vKits"]?.add({"visitId": visit.id,});
response = await ApiManager.instance.put(
URLs.updatePentry, body: body
);
response = await ApiManager.instance.put(URLs.updatePentry, body: body);
// response = await post(
// Uri.parse(host+URLs.updatePentry + "/${visit.id}"),
@ -182,10 +171,8 @@ class RegularVisitsProvider extends ChangeNotifier{
notifyListeners();
}
return response.statusCode;
} catch (error) {
return -1;
}
}
}

@ -13,6 +13,8 @@ import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/models/timer_model.dart';
import 'package:test_sa/models/user.dart';
import '../../../models/service_request/search_work_order.dart';
class ServiceRequestsProvider extends ChangeNotifier {
// number of items call in each request
final pageItemNumber = 10;
@ -34,6 +36,7 @@ class ServiceRequestsProvider extends ChangeNotifier {
// list of user requests
List<ServiceRequest> serviceRequests;
List<SearchWorkOrders> workOrders = [];
// when requests in-process _loading = true
// done _loading = true
@ -365,6 +368,34 @@ class ServiceRequestsProvider extends ChangeNotifier {
}
}
Future<List<SearchWorkOrders>> searchWorkOrders({@required String callId}) async {
Response response;
try {
var body = {
"pageSize": pageItemNumber,
"pageNumber": ((workOrders?.length ?? 0) ~/ pageItemNumber) + 1,
"callId": callId,
};
response = await ApiManager.instance.post(URLs.searchWorkOrders, body: body);
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
// client's request was successfully received
List workOrdersJson = json.decode(response.body)["data"];
print(workOrdersJson);
workOrders = workOrdersJson.map<SearchWorkOrders>((request) => SearchWorkOrders.fromJson(request)).toList();
if (workOrders.length == pageItemNumber) {
nextPage = true;
} else {
nextPage = false;
}
}
return workOrders;
} catch (e) {
return [];
}
}
Future<int> createDuplicatedReport({
@required String host,
@required User user,

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class AssignedToProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -67,7 +65,5 @@ class AssignedToProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -10,7 +10,6 @@ import 'package:flutter/material.dart';
import 'package:http/http.dart';
class EngineersProvider extends ChangeNotifier {
//reset provider data
void reset() {
_items = null;
@ -67,7 +66,5 @@ class EngineersProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,9 +42,11 @@ class GasCylinderSizesProvider extends ChangeNotifier{
/// return state code if request complete may be 200, 404 or 403
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getData ({String host,User user,}) async {
if(_loading == true)
return -2;
Future<int> getData({
String host,
User user,
}) async {
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -68,7 +69,5 @@ class GasCylinderSizesProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,9 +42,11 @@ class GasCylinderTypesProvider extends ChangeNotifier{
/// return state code if request complete may be 200, 404 or 403
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getData ({String host,User user,}) async {
if(_loading == true)
return -2;
Future<int> getData({
String host,
User user,
}) async {
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -68,7 +69,5 @@ class GasCylinderTypesProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -12,7 +12,6 @@ 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;
@ -46,7 +45,10 @@ class GasStatusProvider extends ChangeNotifier{
/// return state code if request complete may be 200, 404 or 403
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getData ({String host,User user,}) async {
Future<int> getData({
String host,
User user,
}) async {
if (_loading == true) return -2;
_loading = true;
notifyListeners();
@ -70,7 +72,5 @@ class GasStatusProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -12,7 +12,6 @@ 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;
@ -46,7 +45,10 @@ class GasTypesProvider extends ChangeNotifier{
/// return state code if request complete may be 200, 404 or 403
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getData ({String host,User user,}) async {
Future<int> getData({
String host,
User user,
}) async {
if (_loading == true) return -2;
_loading = true;
notifyListeners();
@ -70,7 +72,5 @@ class GasTypesProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class PentryStatusProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -63,13 +61,10 @@ class PentryStatusProvider extends ChangeNotifier{
notifyListeners();
return response.statusCode;
} catch (error) {
_loading = false;
_stateCode = -1;
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class PentryTaskStatusProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -63,13 +61,10 @@ class PentryTaskStatusProvider extends ChangeNotifier{
notifyListeners();
return response.statusCode;
} catch (error) {
_loading = false;
_stateCode = -1;
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class PentryVisitStatusProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -68,7 +66,5 @@ class PentryVisitStatusProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class ServiceRequestDefectTypesProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -62,13 +60,10 @@ class ServiceRequestDefectTypesProvider extends ChangeNotifier{
notifyListeners();
return response.statusCode;
} catch (error) {
_loading = false;
_stateCode = -1;
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/user.dart';
class ServiceRequestPriorityProvider extends ChangeNotifier {
//reset provider data
void reset() {
_items = null;
@ -43,8 +42,7 @@ class ServiceRequestPriorityProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -68,7 +66,5 @@ class ServiceRequestPriorityProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/user.dart';
class ServiceReportReasonsProvider extends ChangeNotifier {
//reset provider data
void reset() {
_reasons = null;
@ -43,8 +42,7 @@ class ServiceReportReasonsProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getTypes({String host, User user}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -67,7 +65,5 @@ class ServiceReportReasonsProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -12,7 +12,6 @@ import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/user.dart';
class ServiceReportStatusProvider extends ChangeNotifier {
//reset provider data
void reset() {
_status = null;
@ -46,8 +45,7 @@ class ServiceReportStatusProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getTypes({String host, User user}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -66,13 +64,10 @@ class ServiceReportStatusProvider extends ChangeNotifier{
notifyListeners();
return response.statusCode;
} catch (error) {
_loading = false;
_stateCode = -1;
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/user.dart';
class ServiceReportTypesProvider extends ChangeNotifier {
//reset provider data
void reset() {
_types = null;
@ -43,8 +42,7 @@ class ServiceReportTypesProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getTypes({String host, User user}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -67,7 +65,5 @@ class ServiceReportTypesProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/user.dart';
class ServiceStatusProvider extends ChangeNotifier {
//reset provider data
void reset() {
_statuses = null;
@ -43,8 +42,7 @@ class ServiceStatusProvider extends ChangeNotifier{
/// for more details check http state manager
/// lib\controllers\http_status_manger\http_status_manger.dart
Future<int> getTypes({String host, User user}) async {
if(_loading == true)
return -2;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -57,7 +55,6 @@ class ServiceStatusProvider extends ChangeNotifier{
// client's request was successfully received
List categoriesListJson = json.decode(response.body)["data"];
_statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
}
_loading = false;
notifyListeners();
@ -68,7 +65,5 @@ class ServiceStatusProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class ServiceRequestStatusProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -57,7 +55,6 @@ class ServiceRequestStatusProvider extends ChangeNotifier{
// client's request was successfully received
List categoriesListJson = json.decode(response.body)["data"];
_statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
}
_loading = false;
notifyListeners();
@ -68,7 +65,5 @@ class ServiceRequestStatusProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class ServiceRequestedThroughProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -57,7 +55,6 @@ class ServiceRequestedThroughProvider extends ChangeNotifier{
// client's request was successfully received
List categoriesListJson = json.decode(response.body)["data"];
_statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
}
_loading = false;
notifyListeners();
@ -68,7 +65,5 @@ class ServiceRequestedThroughProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -9,7 +9,6 @@ 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;
@ -43,8 +42,7 @@ class ServiceRequestTypeProvider extends ChangeNotifier{
/// 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;
if (_loading == true) return -2;
_loading = true;
notifyListeners();
Response response;
@ -57,7 +55,6 @@ class ServiceRequestTypeProvider extends ChangeNotifier{
// client's request was successfully received
List categoriesListJson = json.decode(response.body)["data"];
_statuses = categoriesListJson.map((e) => Lookup.fromJson(e)).toList();
}
_loading = false;
notifyListeners();
@ -68,7 +65,5 @@ class ServiceRequestTypeProvider extends ChangeNotifier{
notifyListeners();
return -1;
}
}
}

@ -7,9 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../settings/app_settings.dart';
class SettingProvider extends ChangeNotifier {
resetSettings() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
user = null;
@ -64,7 +62,6 @@ class SettingProvider extends ChangeNotifier{
// get app setting
Future<void> loadSharedPreferences() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.containsKey(ASettings.language)) {
@ -93,5 +90,4 @@ class SettingProvider extends ChangeNotifier{
isLoaded = true;
notifyListeners();
}
}

@ -4,16 +4,14 @@ class Validator{
// check if string not empty and has value
static bool hasValue(String string) {
if (string == null || string.isEmpty)
return false;
if (string == null || string.isEmpty) return false;
return true;
}
// Return true if email is valid. Otherwise, return false
static bool isEmail(String email) {
RegExp exp = new RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+");
if(exp.hasMatch(email))
return true;
if (exp.hasMatch(email)) return true;
return false;
}
@ -26,17 +24,14 @@ class Validator{
final pattern = r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$';
final regExp = RegExp(pattern);
if (regExp.hasMatch(phoneNumber))
return true;
if (regExp.hasMatch(phoneNumber)) return true;
return false;
}
// Return true if password is valid. Otherwise, return false
static bool isValidPassword(String password) {
if(password == null)
return false;
if(password.length <6)
return false;
if (password == null) return false;
if (password.length < 6) return false;
return true;
}

@ -21,7 +21,6 @@ class AppNotification{
title: parsedJson["call_client"] ?? parsedJson["title"],
description: parsedJson["task_description"],
date: parsedJson["creation_date"],
path: FutureRequestServiceDetails.id
);
path: FutureRequestServiceDetails.id);
}
}

@ -56,10 +56,7 @@ class DeviceTransfer{
workingHours: parsedJson["senderWorkingHours"],
userId: parsedJson["senderAssignedEmployeeId"],
userName: parsedJson["senderAssignedEmployeeName"],
client: Hospital(
id: parsedJson["senderSiteId"],
name: parsedJson["senderSiteName"]
),
client: Hospital(id: parsedJson["senderSiteId"], name: parsedJson["senderSiteName"]),
department: Department(
id: parsedJson["senderDepartmentId"],
name: parsedJson["senderDepartmentName"],
@ -77,10 +74,7 @@ class DeviceTransfer{
workingHours: parsedJson["receiverWorkingHours"],
userId: parsedJson["receiverAssignedEmployeeId"],
userName: parsedJson["receiverAssignedEmployeeName"],
client: Hospital(
id: parsedJson["destSiteId"],
name: parsedJson["destSiteName"]
),
client: Hospital(id: parsedJson["destSiteId"], name: parsedJson["destSiteName"]),
department: Department(
id: parsedJson["destDepartmentId"],
name: parsedJson["destDepartmentName"],
@ -95,4 +89,3 @@ class DeviceTransfer{
);
}
}

@ -63,10 +63,7 @@ class DeviceTransferInfo{
signature: parsedJson["${key}image"],
userId: parsedJson["${key}id"],
comment: parsedJson["${key}comment"],
client: Hospital(
id: parsedJson["${key}SiteId"],
name: parsedJson["${key}SiteName"]
),
client: Hospital(id: parsedJson["${key}SiteId"], name: parsedJson["${key}SiteName"]),
department: Department(
id: parsedJson["${key}DepartmentId"],
name: parsedJson["${key}DepartmentName"],
@ -78,4 +75,3 @@ class DeviceTransferInfo{
);
}
}

@ -8,15 +8,16 @@ class ModelDefinition {
String replacementDate;
int lifeSpan;
ModelDefinition(
{this.id,
ModelDefinition({
this.id,
this.assetName,
this.modelDefCode,
this.modelName,
this.manufacturerName,
this.supplierName,
this.replacementDate,
this.lifeSpan,});
this.lifeSpan,
});
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};

@ -7,8 +7,6 @@ class Engineer{
this.name,
});
factory Engineer.fromJson(Map<String, dynamic> parsedJson) {
return Engineer(
id: parsedJson["userId"] ?? parsedJson["id"],
@ -23,10 +21,7 @@ class Engineer{
}
@override
bool operator == (Object other) =>
identical(this, other) || other is Engineer &&
id == other.id;
bool operator ==(Object other) => identical(this, other) || other is Engineer && id == other.id;
@override
int get hashCode => id.hashCode;
@ -37,5 +32,4 @@ class Engineer{
'name': name,
};
}
}

@ -21,6 +21,7 @@ class GasRefillDetails{
if (requestedQuantity == null) return false;
return true;
}
factory GasRefillDetails.fromJson(Map<String, dynamic> parsedJson) {
return GasRefillDetails(
type: Lookup.fromJson(parsedJson["gasType"]),
@ -41,4 +42,3 @@ class GasRefillDetails{
);
}
}

@ -44,11 +44,9 @@ class GasRefillModel{
id: parsedJson["id"],
//userId: parsedJson["uid"],
title: parsedJson["gazRefillNo"],
clientName: parsedJson["site"] == null ? null:
parsedJson["site"]["custName"],
clientName: parsedJson["site"] == null ? null : parsedJson["site"]["custName"],
status: Lookup.fromJson(parsedJson["status"]),
details: details,
);
}
}

@ -11,31 +11,15 @@ class Hospital{
this.buildings,
});
factory Hospital.fromJson(Map<String, dynamic> parsedJson) {
return Hospital(
id: parsedJson["id"],
name: parsedJson["custName"],
customerCode: parsedJson["customerCode"],
buildings: parsedJson["buildings"]
);
return Hospital(id: parsedJson["id"], name: parsedJson["custName"], customerCode: parsedJson["customerCode"], buildings: parsedJson["buildings"]);
}
factory Hospital.fromHospital(Hospital hospital) {
return Hospital(
id: hospital?.id,
name: hospital?.name,
customerCode: hospital?.customerCode,
buildings:hospital?.buildings
);
return Hospital(id: hospital?.id, name: hospital?.name, customerCode: hospital?.customerCode, buildings: hospital?.buildings);
}
Map<String, dynamic> toMap() {
return {
'id': id,
'customerCode': customerCode,
'custName': name,
"buildings":buildings
};
return {'id': id, 'customerCode': customerCode, 'custName': name, "buildings": buildings};
}
}

@ -1,5 +1,4 @@
class Lookup {
//old name label
final String name;
// old name key
@ -13,21 +12,13 @@ class Lookup{
});
@override
bool operator == (Object other) =>
identical(this, other) || other is Lookup &&
((value != null && value == other.value)
|| ( id != null && id == other.id )) ;
bool operator ==(Object other) => identical(this, other) || other is Lookup && ((value != null && value == other.value) || (id != null && id == other.id));
@override
int get hashCode => id?.hashCode ?? value?.hashCode;
toMap() {
return {
"id": id,
"name": name,
"value": value
};
return {"id": id, "name": name, "value": value};
}
factory Lookup.fromStatus(Lookup old) {

@ -8,14 +8,7 @@ class Contact{
String telephone;
String landLine;
Contact({
this.title,
this.contactPerson,
this.job,
this.email,
this.telephone,
this.landLine
});
Contact({this.title, this.contactPerson, this.job, this.email, this.telephone, this.landLine});
Map<String, String> toMap() {
return {

@ -1,10 +1,7 @@
import 'package:test_sa/models/lookup.dart';
class ContactTitle extends Lookup {
ContactTitle({
int id,
String label
}):super(id: id,name: label);
ContactTitle({int id, String label}) : super(id: id, name: label);
factory ContactTitle.fromMap(Map<String, dynamic> parsedJson) {
return ContactTitle(

@ -1,10 +1,7 @@
import 'package:test_sa/models/lookup.dart';
class ContactTitle extends Lookup {
ContactTitle({
int id,
String label
}):super(id: id,name: label);
ContactTitle({int id, String label}) : super(id: id, name: label);
factory ContactTitle.fromMap(Map<String, dynamic> parsedJson) {
return ContactTitle(

@ -10,16 +10,7 @@ class PMKit{
String quantityNeeded;
String quantityReserved;
PMKit({
this.id,
this.itemCode,
this.itemName,
this.preparationTimeFrame,
this.kitFrequencyDemand,
this.availability,
this.quantityNeeded,
this.quantityReserved
});
PMKit({this.id, this.itemCode, this.itemName, this.preparationTimeFrame, this.kitFrequencyDemand, this.availability, this.quantityNeeded, this.quantityReserved});
Map<String, dynamic> toMap(int visitId) {
return {

@ -16,11 +16,7 @@ class Part{
Map<String, dynamic> toJson() {
return {
"id": reportPartID ?? 0,
"sparePart":{
"id":id,
"partNo": code,
"partName":name
},
"sparePart": {"id": id, "partNo": code, "partName": name},
"qty": quantity
};
}

@ -0,0 +1,548 @@
import 'package:test_sa/models/lookup.dart';
class SearchWorkOrders {
int id;
String parentWOId;
String workOrderNo;
int workOrderYear;
int workOrderSequennce;
CallRequest callRequest;
String assetType;
AssignedEmployee assignedEmployee;
String visitDate;
List assistantEmployees;
String supplier;
String vendorTicketNumber;
List contactPersonWorkOrders;
Lookup calllastSituation;
Lookup currentSituation;
String repairLocation;
String reason;
String startofWorkTime;
String endofWorkTime;
double workingHours;
num travelingHours;
num travelingExpenses;
ModelDefRelatedDefects faultDescription;
List sparePartsWorkOrders;
String reviewComment;
String comment;
String attachmentsWorkOrder;
String equipmentStatus;
List suppEngineerWorkOrders;
String engSignature;
String nurseSignature;
String woParentDto;
SearchWorkOrders(
{this.id,
this.parentWOId,
this.workOrderNo,
this.workOrderYear,
this.workOrderSequennce,
this.callRequest,
this.assetType,
this.assignedEmployee,
this.visitDate,
this.assistantEmployees,
this.supplier,
this.vendorTicketNumber,
this.contactPersonWorkOrders,
this.calllastSituation,
this.currentSituation,
this.repairLocation,
this.reason,
this.startofWorkTime,
this.endofWorkTime,
this.workingHours,
this.travelingHours,
this.travelingExpenses,
this.faultDescription,
this.sparePartsWorkOrders,
this.reviewComment,
this.comment,
this.attachmentsWorkOrder,
this.equipmentStatus,
this.suppEngineerWorkOrders,
this.engSignature,
this.nurseSignature,
this.woParentDto});
SearchWorkOrders.fromJson(Map<String, dynamic> json) {
print(json['callRequest']);
id = json['id'];
parentWOId = json['parentWOId'];
workOrderNo = json['workOrderNo'];
workOrderYear = json['workOrderYear'];
workOrderSequennce = json['workOrderSequennce'];
callRequest = json['callRequest'] != null ? new CallRequest.fromJson(json['callRequest']) : CallRequest();
assetType = json['assetType'];
assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : AssignedEmployee();
visitDate = json['visitDate'];
if (json['assistantEmployees'] != null) {
assistantEmployees = json['assistantEmployees'];
}
supplier = json['supplier'];
vendorTicketNumber = json['vendorTicketNumber'];
if (json['contactPersonWorkOrders'] != null) {
contactPersonWorkOrders = json['contactPersonWorkOrders'];
}
calllastSituation = json['calllastSituation'] != null ? new Lookup.fromJson(json['calllastSituation']) : Lookup();
currentSituation = json['currentSituation'] != null ? new Lookup.fromJson(json['currentSituation']) : Lookup();
repairLocation = json['repairLocation'];
reason = json['reason'];
startofWorkTime = json['startofWorkTime'];
endofWorkTime = json['endofWorkTime'];
workingHours = json['workingHours'];
travelingHours = json['travelingHours'];
travelingExpenses = json['travelingExpenses'];
faultDescription = json['faultDescription'] != null ? new ModelDefRelatedDefects.fromJson(json['faultDescription']) : ModelDefRelatedDefects();
if (json['sparePartsWorkOrders'] != null) {
sparePartsWorkOrders = json['sparePartsWorkOrders'];
}
reviewComment = json['reviewComment'];
comment = json['comment'];
attachmentsWorkOrder = json['attachmentsWorkOrder'];
equipmentStatus = json['equipmentStatus'];
if (json['suppEngineerWorkOrders'] != null) {
suppEngineerWorkOrders = json['suppEngineerWorkOrders'];
}
engSignature = json['engSignature'];
nurseSignature = json['nurseSignature'];
woParentDto = json['woParentDto'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['parentWOId'] = this.parentWOId;
data['workOrderNo'] = this.workOrderNo;
data['workOrderYear'] = this.workOrderYear;
data['workOrderSequennce'] = this.workOrderSequennce;
if (this.callRequest != null) {
data['callRequest'] = this.callRequest.toJson();
}
data['assetType'] = this.assetType;
if (this.assignedEmployee != null) {
data['assignedEmployee'] = this.assignedEmployee.toJson();
}
data['visitDate'] = this.visitDate;
if (this.assistantEmployees != null) {
data['assistantEmployees'] = this.assistantEmployees.map((v) => v.toJson()).toList();
}
data['supplier'] = this.supplier;
data['vendorTicketNumber'] = this.vendorTicketNumber;
if (this.contactPersonWorkOrders != null) {
data['contactPersonWorkOrders'] = this.contactPersonWorkOrders.map((v) => v.toJson()).toList();
}
if (this.calllastSituation != null) {
data['calllastSituation'] = this.calllastSituation.toMap();
}
if (this.currentSituation != null) {
data['currentSituation'] = this.currentSituation.toMap();
}
data['repairLocation'] = this.repairLocation;
data['reason'] = this.reason;
data['startofWorkTime'] = this.startofWorkTime;
data['endofWorkTime'] = this.endofWorkTime;
data['workingHours'] = this.workingHours;
data['travelingHours'] = this.travelingHours;
data['travelingExpenses'] = this.travelingExpenses;
if (this.faultDescription != null) {
data['faultDescription'] = this.faultDescription.toJson();
}
if (this.sparePartsWorkOrders != null) {
data['sparePartsWorkOrders'] = this.sparePartsWorkOrders.map((v) => v.toJson()).toList();
}
data['reviewComment'] = this.reviewComment;
data['comment'] = this.comment;
data['attachmentsWorkOrder'] = this.attachmentsWorkOrder;
data['equipmentStatus'] = this.equipmentStatus;
if (this.suppEngineerWorkOrders != null) {
data['suppEngineerWorkOrders'] = this.suppEngineerWorkOrders.map((v) => v.toJson()).toList();
}
data['engSignature'] = this.engSignature;
data['nurseSignature'] = this.nurseSignature;
data['woParentDto'] = this.woParentDto;
return data;
}
}
class CallRequest {
int id;
String callNo;
Asset asset;
AssignedEmployee assignedEmployee;
List callSiteContactPerson;
Lookup status;
Lookup callLastSituation;
String defectType;
String firstAction;
String assetType;
CallRequest({this.id, this.callNo, this.asset, this.assignedEmployee, this.callSiteContactPerson, this.status, this.callLastSituation, this.defectType, this.firstAction, this.assetType});
CallRequest.fromJson(Map<String, dynamic> json) {
id = json['id'];
callNo = json['callNo'];
asset = json['asset'] != null ? new Asset.fromJson(json['asset']) : Asset();
assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : AssignedEmployee();
if (json['callSiteContactPerson'] != null) {
callSiteContactPerson = json['callSiteContactPerson'];
}
status = json['status'] != null ? new Lookup.fromJson(json['status']) : Lookup();
callLastSituation = json['callLastSituation'] != null ? new Lookup.fromJson(json['callLastSituation']) : Lookup();
defectType = json['defectType'];
firstAction = json['firstAction'];
assetType = json['assetType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['callNo'] = this.callNo;
if (this.asset != null) {
data['asset'] = this.asset.toJson();
}
if (this.assignedEmployee != null) {
data['assignedEmployee'] = this.assignedEmployee.toJson();
}
if (this.callSiteContactPerson != null) {
data['callSiteContactPerson'] = this.callSiteContactPerson.map((v) => v.toJson()).toList();
}
if (this.status != null) {
data['status'] = this.status.toMap();
}
if (this.callLastSituation != null) {
data['callLastSituation'] = this.callLastSituation.toMap();
}
data['defectType'] = this.defectType;
data['firstAction'] = this.firstAction;
data['assetType'] = this.assetType;
return data;
}
}
class Asset {
int id;
String assetSerialNo;
String systemID;
String assetNumber;
ModelDefinition modelDefinition;
String supplier;
String ipAddress;
String macAddress;
String portNumber;
String assetReplace;
String oldAsset;
String isParent;
String parentAsset;
String assetType;
Site site;
String building;
String floor;
String department;
String room;
String testsDay;
String purchasingPrice;
String nbv;
String currency;
String poNo;
String invoiceNumber;
String invoiceDate;
String replacementDate;
String originDepartment;
Site originSite;
String budgetYear;
String lastPOPrice;
String commissioningStatus;
String productionDate;
String edd;
String technicalInspectionDate;
String deliveryInspectionDate;
String endUserAcceptanceDate;
String receivingCommittee;
String siteWarrantyMonths;
String extendedWarrantyMonths;
String remainderWarrantyMonths;
String eomWarrantyMonthsNo;
String warrantyValue;
String warrantyEndDate;
String warrantyContractConditions;
List technicalGuidanceBooks;
String comment;
String tagCode;
Asset(
{this.id,
this.assetSerialNo,
this.systemID,
this.assetNumber,
this.modelDefinition,
this.supplier,
this.ipAddress,
this.macAddress,
this.portNumber,
this.assetReplace,
this.oldAsset,
this.isParent,
this.parentAsset,
this.assetType,
this.site,
this.building,
this.floor,
this.department,
this.room,
this.testsDay,
this.purchasingPrice,
this.nbv,
this.currency,
this.poNo,
this.invoiceNumber,
this.invoiceDate,
this.replacementDate,
this.originDepartment,
this.originSite,
this.budgetYear,
this.lastPOPrice,
this.commissioningStatus,
this.productionDate,
this.edd,
this.technicalInspectionDate,
this.deliveryInspectionDate,
this.endUserAcceptanceDate,
this.receivingCommittee,
this.siteWarrantyMonths,
this.extendedWarrantyMonths,
this.remainderWarrantyMonths,
this.eomWarrantyMonthsNo,
this.warrantyValue,
this.warrantyEndDate,
this.warrantyContractConditions,
this.technicalGuidanceBooks,
this.comment,
this.tagCode});
Asset.fromJson(Map<String, dynamic> json) {
id = json['id'];
assetSerialNo = json['assetSerialNo'];
systemID = json['systemID'];
assetNumber = json['assetNumber'];
modelDefinition = json['modelDefinition'] != null ? new ModelDefinition.fromJson(json['modelDefinition']) : ModelDefinition();
supplier = json['supplier'];
ipAddress = json['ipAddress'];
macAddress = json['macAddress'];
portNumber = json['portNumber'];
assetReplace = json['assetReplace'];
oldAsset = json['oldAsset'];
isParent = json['isParent'];
parentAsset = json['parentAsset'];
assetType = json['assetType'];
site = json['site'] != null ? new Site.fromJson(json['site']) : Site();
building = json['building'];
floor = json['floor'];
department = json['department'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['assetSerialNo'] = this.assetSerialNo;
data['systemID'] = this.systemID;
data['assetNumber'] = this.assetNumber;
if (this.modelDefinition != null) {
data['modelDefinition'] = this.modelDefinition.toJson();
}
data['supplier'] = this.supplier;
data['ipAddress'] = this.ipAddress;
data['macAddress'] = this.macAddress;
data['portNumber'] = this.portNumber;
data['assetReplace'] = this.assetReplace;
data['oldAsset'] = this.oldAsset;
data['isParent'] = this.isParent;
data['parentAsset'] = this.parentAsset;
data['assetType'] = this.assetType;
if (this.site != null) {
data['site'] = this.site.toJson();
}
data['building'] = this.building;
data['floor'] = this.floor;
data['department'] = this.department;
data['room'] = this.room;
data['testsDay'] = this.testsDay;
data['purchasingPrice'] = this.purchasingPrice;
data['nbv'] = this.nbv;
data['currency'] = this.currency;
data['poNo'] = this.poNo;
data['invoiceNumber'] = this.invoiceNumber;
data['invoiceDate'] = this.invoiceDate;
data['replacementDate'] = this.replacementDate;
data['originDepartment'] = this.originDepartment;
if (this.originSite != null) {
data['originSite'] = this.originSite.toJson();
}
data['budgetYear'] = this.budgetYear;
data['lastPOPrice'] = this.lastPOPrice;
data['commissioningStatus'] = this.commissioningStatus;
data['productionDate'] = this.productionDate;
data['edd'] = this.edd;
data['technicalInspectionDate'] = this.technicalInspectionDate;
data['deliveryInspectionDate'] = this.deliveryInspectionDate;
data['endUserAcceptanceDate'] = this.endUserAcceptanceDate;
data['receivingCommittee'] = this.receivingCommittee;
data['siteWarrantyMonths'] = this.siteWarrantyMonths;
data['extendedWarrantyMonths'] = this.extendedWarrantyMonths;
data['remainderWarrantyMonths'] = this.remainderWarrantyMonths;
data['eomWarrantyMonthsNo'] = this.eomWarrantyMonthsNo;
data['warrantyValue'] = this.warrantyValue;
data['warrantyEndDate'] = this.warrantyEndDate;
data['warrantyContractConditions'] = this.warrantyContractConditions;
if (this.technicalGuidanceBooks != null) {
data['technicalGuidanceBooks'] = this.technicalGuidanceBooks.map((v) => v.toJson()).toList();
}
data['comment'] = this.comment;
data['tagCode'] = this.tagCode;
return data;
}
}
class ModelDefinition {
int id;
String assetName;
String modelDefCode;
String modelName;
int manufacturerId;
String manufacturerName;
String supplierName;
String replacementDate;
int lifeSpan;
List<ModelDefRelatedDefects> modelDefRelatedDefects;
List suppliers;
ModelDefinition(
{this.id,
this.assetName,
this.modelDefCode,
this.modelName,
this.manufacturerId,
this.manufacturerName,
this.supplierName,
this.replacementDate,
this.lifeSpan,
this.modelDefRelatedDefects,
this.suppliers});
ModelDefinition.fromJson(Map<String, dynamic> json) {
id = json['id'];
assetName = json['assetName'];
modelDefCode = json['modelDefCode'];
modelName = json['modelName'];
manufacturerId = json['manufacturerId'];
manufacturerName = json['manufacturerName'];
supplierName = json['supplierName'];
replacementDate = json['replacementDate'];
lifeSpan = json['lifeSpan'];
if (json['modelDefRelatedDefects'] != null) {
modelDefRelatedDefects = <ModelDefRelatedDefects>[];
json['modelDefRelatedDefects'].forEach((v) {
modelDefRelatedDefects.add(new ModelDefRelatedDefects.fromJson(v));
});
}
if (json['suppliers'] != null) {
suppliers = json['suppliers'];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['assetName'] = this.assetName;
data['modelDefCode'] = this.modelDefCode;
data['modelName'] = this.modelName;
data['manufacturerId'] = this.manufacturerId;
data['manufacturerName'] = this.manufacturerName;
data['supplierName'] = this.supplierName;
data['replacementDate'] = this.replacementDate;
data['lifeSpan'] = this.lifeSpan;
if (this.modelDefRelatedDefects != null) {
data['modelDefRelatedDefects'] = this.modelDefRelatedDefects.map((v) => v.toJson()).toList();
}
if (this.suppliers != null) {
data['suppliers'] = this.suppliers.map((v) => v.toJson()).toList();
}
return data;
}
}
class ModelDefRelatedDefects {
int id;
String defectName;
String workPerformed;
String estimatedTime;
ModelDefRelatedDefects({this.id, this.defectName, this.workPerformed, this.estimatedTime});
ModelDefRelatedDefects.fromJson(Map<String, dynamic> json) {
id = json['id'];
defectName = json['defectName'];
workPerformed = json['workPerformed'];
estimatedTime = json['estimatedTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['defectName'] = this.defectName;
data['workPerformed'] = this.workPerformed;
data['estimatedTime'] = this.estimatedTime;
return data;
}
}
class Site {
int id;
int customerCode;
String custName;
List buildings;
Site({this.id, this.customerCode, this.custName, this.buildings});
Site.fromJson(Map<String, dynamic> json) {
id = json['id'];
customerCode = json['customerCode'];
custName = json['custName'];
if (json['buildings'] != null) {
buildings = json['buildings'];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['customerCode'] = this.customerCode;
data['custName'] = this.custName;
if (this.buildings != null) {
data['buildings'] = this.buildings.map((v) => v.toJson()).toList();
}
return data;
}
}
class AssignedEmployee {
String id;
String name;
AssignedEmployee({this.id, this.name});
AssignedEmployee.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}

@ -9,7 +9,6 @@ class ServiceRequestSearch{
String model;
Lookup statusValue;
ServiceRequestSearch({
this.deviceSerialNumber,
this.deviceNumber,
@ -43,7 +42,6 @@ class ServiceRequestSearch{
if (deviceName != null && deviceName.isNotEmpty) {
search["assetName"] = deviceName;
}
if (hospital != null) {

@ -209,6 +209,13 @@ class Subtitle {
String partNumber;
String number;
String quantity;
String orderWorkNumber;
String assignedEmployee;
String assetSN;
String assetName;
String site;
String maintenanceSituation;
String currentSituation;
// all
String duplicateRequest;
@ -413,6 +420,13 @@ class Subtitle {
@required this.duplicateAlert,
@required this.duplicateAlertMessage,
@required this.duplicateRequest,
@required this.orderWorkNumber,
@required this.assignedEmployee,
@required this.assetSN,
@required this.assetName,
@required this.site,
@required this.maintenanceSituation,
@required this.currentSituation,
@required this.repairLocation,
@required this.travelingExpense,
@required this.startDate,
@ -602,6 +616,13 @@ class Subtitle {
duplicateAlert: parsedJson["duplicateAlert"],
duplicateAlertMessage: parsedJson["duplicateAlertMessage"],
duplicateRequest: parsedJson["duplicateRequest"],
orderWorkNumber: parsedJson["orderWorkNumber"],
assignedEmployee: parsedJson["assignedEmployee"],
assetSN: parsedJson["assetSN"],
assetName: parsedJson["assetName"],
site: parsedJson["site"],
maintenanceSituation: parsedJson["maintenanceSituation"],
currentSituation: parsedJson["currentSituation"],
repairLocation: parsedJson["repairLocation"],
travelingExpense: parsedJson["travelingExpense"],
startDate: parsedJson["startDate"],

@ -76,7 +76,7 @@ class User {
}
UsersTypes get type {
switch (userRoles.first.name) {
switch (userRoles?.first?.name) {
case "Engineer":
return UsersTypes.engineer;
case "Hospital":

@ -73,7 +73,6 @@ class Visit{
name: parsedJson["visitStatusName"] // text value
),
assignTo: parsedJson["assignedToName"],
pentry: Pentry.fromMap(parsedJson)
);
pentry: Pentry.fromMap(parsedJson));
}
}

@ -1,4 +1,3 @@
import 'package:test_sa/models/engineer.dart';
import 'package:test_sa/models/visits/visit.dart';
@ -43,6 +42,4 @@ class VisitsGroup{
// if(taskStatus != null) jsonObject["task_status"] = taskStatus.id.toString();
return jsonObject;
}
}

@ -84,4 +84,3 @@ class VisitsSearch{
return _search;
}
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
class AColors {
AColors._();
static const Color white = Color(0xffffffff);
@ -20,21 +21,29 @@ class AColors {
static Color getRequestStatusColor(int id) {
switch (id) {
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;
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;
}
}
static Color getGasStatusColor(int id) {
switch (id) {
case 0: return AColors.orange;
case 1: return AColors.green;
default : return AColors.grey;
case 0:
return AColors.orange;
case 1:
return AColors.green;
default:
return AColors.grey;
}
}
}

@ -1,14 +1,11 @@
import 'package:flutter/material.dart';
class AppStyle {
AppStyle._();
static const double borderRadius = 10;
static const BoxShadow boxShadow = BoxShadow(
color: Colors.black26,
blurRadius: 3,
offset: Offset(0,2)
);
static const BoxShadow boxShadow = BoxShadow(color: Colors.black26, blurRadius: 3, offset: Offset(0, 2));
static double getBorderRadius(BuildContext context) {
return borderRadius * getScaleFactor(context);
@ -17,23 +14,18 @@ class AppStyle {
static double getScaleFactor(BuildContext context) {
return MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.width / (360) > 1.5
? 1.5 : MediaQuery.of(context).size.width/(360)
? 1.5
: MediaQuery.of(context).size.width / (360)
: MediaQuery.of(context).size.height / (360) > 1.5
? 1.5 : MediaQuery.of(context).size.height/(360);
? 1.5
: MediaQuery.of(context).size.height / (360);
}
static BorderRadius getCardBorder(BuildContext context) {
return BorderRadius.only(
topRight: Radius.circular(
AppStyle.borderRadius * AppStyle.getScaleFactor(context)
),
topLeft: Radius.circular(
AppStyle.borderRadius * AppStyle.getScaleFactor(context)
),
bottomRight: Radius.circular(
AppStyle.borderRadius * AppStyle.getScaleFactor(context)
),
topRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
topLeft: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
bottomRight: Radius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
);
}
}

@ -25,7 +25,6 @@ class DeviceTransferDetails extends StatefulWidget {
}
class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
final DeviceTransferInfo _model = DeviceTransferInfo();
bool _isSender = false;
bool _isReceiver = false;
@ -39,8 +38,6 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
@override
void initState() {
super.initState();
}
@ -74,10 +71,7 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
child: Center(
child: Text(
_subtitle.details,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
@ -103,20 +97,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
Row(
children: [
Expanded(
child: Text(
"Sender",
style: Theme.of(context).textTheme.headline6
),
child: Text("Sender", style: Theme.of(context).textTheme.headline6),
),
if (_isSender || true)
ASmallButton(
text: _subtitle.edit,
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_)=> UpdateDeviceTransfer(model: widget.model,isSender: true,)
)
);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => UpdateDeviceTransfer(
model: widget.model,
isSender: true,
)));
},
),
],
@ -129,20 +120,17 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
Row(
children: [
Expanded(
child: Text(
"Receiver",
style: Theme.of(context).textTheme.headline6
),
child: Text("Receiver", style: Theme.of(context).textTheme.headline6),
),
if (_isReceiver || true)
ASmallButton(
text: _subtitle.edit,
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_)=> UpdateDeviceTransfer(model: widget.model,isSender: false,)
)
);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => UpdateDeviceTransfer(
model: widget.model,
isSender: false,
)));
},
),
],
@ -151,7 +139,6 @@ class _DeviceTransferDetailsState extends State<DeviceTransferDetails> {
DeviceTransferInfoSection(
info: widget.model.receiver,
),
],
),
),

@ -9,6 +9,7 @@ import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
import 'package:test_sa/views/widgets/device_trancfer/device_transfer_list.dart';
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
class TrackDeviceTransferPage extends StatefulWidget {
static const String id = "/track-device-transfer";
@ -18,8 +19,7 @@ class TrackDeviceTransferPage extends StatefulWidget {
State<TrackDeviceTransferPage> createState() => _TrackDeviceTransferPageState();
}
class _TrackDeviceTransferPageState extends State<TrackDeviceTransferPage>
with TickerProviderStateMixin{
class _TrackDeviceTransferPageState extends State<TrackDeviceTransferPage> with TickerProviderStateMixin {
DeviceTransferProvider _deviceTransferProvider;
UserProvider _userProvider;
SettingProvider _settingProvider;
@ -59,17 +59,15 @@ class _TrackDeviceTransferPageState extends State<TrackDeviceTransferPage>
child: Center(
child: Text(
"Device Transfer",
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
const SizedBox(width: 48,)
const SizedBox(
width: 48,
)
],
),
],
),
),

@ -21,6 +21,7 @@ import 'package:test_sa/views/widgets/status/gas_refill/gas_status.dart';
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
import '../../../app_style/colors.dart';
class GasRefillDetails extends StatefulWidget {
final GasRefillModel model;
const GasRefillDetails({Key key, this.model}) : super(key: key);
@ -30,7 +31,6 @@ class GasRefillDetails extends StatefulWidget {
}
class _GasRefillDetailsState extends State<GasRefillDetails> {
final GasRefillModel _model = GasRefillModel();
bool _enableEdit = false;
bool _validate = false;
@ -51,12 +51,7 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
_isLoading = true;
setState(() {});
int status = await _gasRefillProvider.updateModel(
user: _userProvider.user,
host: _settingProvider.host,
newModel: _model,
oldModel: widget.model
);
int status = await _gasRefillProvider.updateModel(user: _userProvider.user, host: _settingProvider.host, newModel: _model, oldModel: widget.model);
_isLoading = false;
setState(() {});
if (status >= 200 && status < 300) {
@ -67,15 +62,10 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
_validate = false;
//Navigator.of(context).pop();
} else {
String errorMessage = HttpStatusManger.getStatusMessage(
status: status, subtitle: _subtitle);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
errorMessage
),
)
);
String errorMessage = HttpStatusManger.getStatusMessage(status: status, subtitle: _subtitle);
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(errorMessage),
));
}
}
@ -113,10 +103,7 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
child: Center(
child: Text(
_subtitle.details,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
@ -132,7 +119,9 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
setState(() {});
},
),
const SizedBox(width: 16,)
const SizedBox(
width: 16,
)
],
),
),
@ -150,15 +139,22 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
title: _subtitle.hospital,
info: _model.clientName,
),
_enableEdit ?
Column(
_enableEdit
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
ASubTitle(_subtitle.status),
if (_validate && _model.status == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
const SizedBox(height: 4,),
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
const SizedBox(
height: 4,
),
GasStatusMenu(
initialValue: _model.status,
onSelect: (status) {
@ -166,8 +162,8 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
},
)
],
):
Row(
)
: Row(
children: [
Expanded(
child: Text(
@ -176,15 +172,16 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
textScaleFactor: AppStyle.getScaleFactor(context),
),
),
if(_model.status?.id != null)
StatusLabel(label: _model.status.name,
color: AColors.getGasStatusColor(_model.status.id)
),
if (_model.status?.id != null) StatusLabel(label: _model.status.name, color: AColors.getGasStatusColor(_model.status.id)),
],
),
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
const ASubTitle("Gas Requests"),
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
ListView.builder(
shrinkWrap: true,
physics: const ClampingScrollPhysics(),
@ -196,12 +193,13 @@ class _GasRefillDetailsState extends State<GasRefillDetails> {
validate: _validate,
enableEdit: _enableEdit,
);
}
),
}),
if (_enableEdit)
Column(
children: [
const SizedBox(height: 16,),
const SizedBox(
height: 16,
),
AButton(
text: _subtitle.update,
onPressed: _update,

@ -22,6 +22,7 @@ import 'package:test_sa/views/widgets/status/gas_refill/gas_type.dart';
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
import '../../../../controllers/localization/localization.dart';
class RequestGasRefill extends StatefulWidget {
static const String id = "/request-gas-refill";
const RequestGasRefill({Key key}) : super(key: key);
@ -70,15 +71,10 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
);
Navigator.of(context).pop();
} else {
String errorMessage = HttpStatusManger.getStatusMessage(
status: status, subtitle: _subtitle);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
errorMessage
),
)
);
String errorMessage = HttpStatusManger.getStatusMessage(status: status, subtitle: _subtitle);
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(errorMessage),
));
}
}
@ -94,7 +90,6 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
return false;
}
_formModel.details.insert(0, _currentDetails);
_validate = false;
Scrollable.ensureVisible(_DetailsKey.currentContext);
@ -109,6 +104,7 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
_requestedQuantityController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
_subtitle = AppLocalization.of(context).subtitle;
@ -135,11 +131,7 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
padding: const EdgeInsets.all(8.0),
child: Text(
"Request Gas Refill",
style: Theme.of(context).textTheme.headline5.copyWith(
color: Theme.of(context).primaryColor,
fontSize: 28,
fontWeight: FontWeight.bold
),
style: Theme.of(context).textTheme.headline5.copyWith(color: Theme.of(context).primaryColor, fontSize: 28, fontWeight: FontWeight.bold),
),
),
),
@ -160,23 +152,37 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
// const SizedBox(height: 8,),
ASubTitle(_subtitle.status),
if (_validate && _formModel.status == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
const SizedBox(height: 4,),
GasStatusMenu(
initialValue: _formModel.status ?? const Lookup(
value: 1
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
const SizedBox(
height: 4,
),
GasStatusMenu(
initialValue: _formModel.status ?? const Lookup(value: 1),
onSelect: (status) {
_formModel.status = status;
},
),
const SizedBox(height: 8,),
Divider(color: Theme.of(context).colorScheme.primary,),
const SizedBox(height: 4,),
const SizedBox(
height: 8,
),
Divider(
color: Theme.of(context).colorScheme.primary,
),
const SizedBox(
height: 4,
),
const ASubTitle("Type"),
if (_validate && _currentDetails.type == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
const SizedBox(height: 4,),
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
const SizedBox(
height: 4,
),
GasTypeMenu(
initialValue: _currentDetails.type,
onSelect: (status) {
@ -184,41 +190,60 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
},
),
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
const ASubTitle("Cylinder Size"),
if (_validate && _currentDetails.cylinderSize == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
const SizedBox(height: 4,),
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
const SizedBox(
height: 4,
),
GasCylinderSizeMenu(
initialValue: _currentDetails.cylinderSize,
onSelect: (status) {
_currentDetails.cylinderSize = status;
},
),
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
const ASubTitle("Cylinder Type"),
if (_validate && _currentDetails.cylinderSize == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
const SizedBox(height: 4,),
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
const SizedBox(
height: 4,
),
GasCylinderTypesMenu(
initialValue: _currentDetails.cylinderType,
onSelect: (status) {
_currentDetails.cylinderType = status;
},
),
const SizedBox(height: 8,),
const SizedBox(
height: 8,
),
ASubTitle(_subtitle.quantity),
if (_validate && _currentDetails.requestedQuantity == null)
ASubTitle(_subtitle.requiredWord,color: Colors.red,),
SizedBox(height: 4,),
ASubTitle(
_subtitle.requiredWord,
color: Colors.red,
),
SizedBox(
height: 4,
),
ATextFormField(
initialValue: (_currentDetails?.requestedQuantity ?? "").toString(),
textAlign: TextAlign.center,
controller: _requestedQuantityController,
style: Theme.of(context).textTheme.subtitle1,
validator: (value) =>
Validator.isNumeric(value)
? null : "allow numbers only",
validator: (value) => Validator.isNumeric(value) ? null : "allow numbers only",
textInputType: TextInputType.number,
onSaved: (value) {
_currentDetails.requestedQuantity = double.tryParse(value);
@ -229,8 +254,7 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
text: _subtitle.add,
onPressed: _addNewModel,
),
if(_formModel.details.isNotEmpty)
const ASubTitle("Gas Requests"),
if (_formModel.details.isNotEmpty) const ASubTitle("Gas Requests"),
ListView.builder(
key: _DetailsKey,
shrinkWrap: true,
@ -245,14 +269,15 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
setState(() {});
},
);
}
),
}),
const SizedBox(height: 16),
AButton(
text: _subtitle.submit,
onPressed: _onSubmit,
),
const SizedBox(height: 100,)
const SizedBox(
height: 100,
)
],
),
),
@ -262,4 +287,3 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
);
}
}

@ -9,6 +9,7 @@ import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
import 'package:test_sa/views/widgets/gas_refill/gas_refill_list.dart';
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
class TrackGasRefillPage extends StatefulWidget {
static const String id = "/track-gas-refill";
@ -18,8 +19,7 @@ class TrackGasRefillPage extends StatefulWidget {
State<TrackGasRefillPage> createState() => _TrackGasRefillPageState();
}
class _TrackGasRefillPageState extends State<TrackGasRefillPage>
with TickerProviderStateMixin{
class _TrackGasRefillPageState extends State<TrackGasRefillPage> with TickerProviderStateMixin {
GasRefillProvider _gasRefillProvider;
UserProvider _userProvider;
SettingProvider _settingProvider;
@ -59,17 +59,15 @@ class _TrackGasRefillPageState extends State<TrackGasRefillPage>
child: Center(
child: Text(
_subtitle.serviceRequests,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.grey3A,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.grey3A, fontStyle: FontStyle.italic),
),
),
),
const SizedBox(width: 48,)
const SizedBox(
width: 48,
)
],
),
],
),
),
@ -87,7 +85,6 @@ class _TrackGasRefillPageState extends State<TrackGasRefillPage>
),
],
),
],
),
),

@ -6,6 +6,7 @@ import 'package:test_sa/views/pages/user/requests/future_request_service_details
import 'package:test_sa/views/widgets/loaders/lazy_loading.dart';
import 'package:test_sa/views/widgets/loaders/no_item_found.dart';
import 'package:test_sa/views/widgets/notifications/notification_item.dart';
class NotificationsList extends StatelessWidget {
final List<AppNotification> notifications;
final bool nextPage;
@ -17,7 +18,9 @@ class NotificationsList extends StatelessWidget {
Widget build(BuildContext context) {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
if (notifications.length == 0) {
return NoItemFound(message: _subtitle.notificationsNotFound,);
return NoItemFound(
message: _subtitle.notificationsNotFound,
);
}
return LazyLoading(
nextPage: nextPage,
@ -30,14 +33,10 @@ class NotificationsList extends StatelessWidget {
return NotificationItem(
notification: notifications[itemIndex],
onPressed: (notification) {
Navigator.of(context).pushNamed(
FutureRequestServiceDetails.id,
arguments: notification.requestId
);
Navigator.of(context).pushNamed(FutureRequestServiceDetails.id, arguments: notification.requestId);
},
);
}
),
}),
);
}
}

@ -16,6 +16,7 @@ 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;
@ -64,10 +65,7 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
),
child: Text(
_subtitle.reportIssue,
style: Theme.of(context).textTheme.headline5.copyWith(
color: AColors.cyan,
fontWeight: FontWeight.bold
),
style: Theme.of(context).textTheme.headline5.copyWith(color: AColors.cyan, fontWeight: FontWeight.bold),
),
),
),
@ -75,7 +73,6 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
height: _height / 8,
image: AssetImage("assets/images/logo.png"),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: 16,
@ -92,8 +89,7 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
color: AColors.grey,
offset: Offset(0, -1),
)
]
),
]),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -102,15 +98,15 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
hintText: _subtitle.title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headline6,
validator: (value) =>
Validator.hasValue(value)
? null : _subtitle.titleValidateMessage,
validator: (value) => Validator.hasValue(value) ? null : _subtitle.titleValidateMessage,
textInputType: TextInputType.name,
onSaved: (value) {
_issue.title = value;
},
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
Column(
children: List.generate(
_issues.length,
@ -125,9 +121,7 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
}
setState(() {});
},
)
)
),
))),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
@ -148,8 +142,7 @@ class _ReportIssuesPageState extends State<ReportIssuesPage> {
child: AButton(
text: _subtitle.submit,
onPressed: () async {
if(!_formKey.currentState.validate())
return;
if (!_formKey.currentState.validate()) return;
_formKey.currentState.save();
_issue.serviceRequestId = widget.serviceRequest.id;
_isLoading = true;

@ -9,6 +9,7 @@ import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/pages/user/requests/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";
@ -17,7 +18,6 @@ class FutureRequestServiceDetails extends StatefulWidget {
}
class _FutureRequestServiceDetailsState extends State<FutureRequestServiceDetails> {
UserProvider _userProvider;
SettingProvider _settingProvider;
@override
@ -28,17 +28,14 @@ class _FutureRequestServiceDetailsState extends State<FutureRequestServiceDetail
Subtitle _subtitle = AppLocalization.of(context).subtitle;
return Scaffold(
body: FutureBuilder<ServiceRequest>(
future: ServiceRequestsProvider().getSingleServiceRequest(
requestId: requestId,
user: _userProvider.user,
host: _settingProvider.host,
subtitle: _subtitle
),
future: ServiceRequestsProvider().getSingleServiceRequest(requestId: requestId, user: _userProvider.user, host: _settingProvider.host, subtitle: _subtitle),
builder: (BuildContext context, AsyncSnapshot<ServiceRequest> snapshot) {
if (snapshot.hasError)
return FailedLoading(
message: snapshot.error.toString(),
onReload: (){setState(() {});},
onReload: () {
setState(() {});
},
);
if (snapshot.hasData) {
return RequestDetailsPage(

@ -718,9 +718,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
// ),
// ],
// ),
const SizedBox(
height: 8,
),
const SizedBox(height: 8),
const ASubTitle("Nurse Signature"),
ESignature(
oldSignature: _serviceReport.signatureNurse,
@ -812,17 +810,13 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
text: _subtitle.submit,
onPressed: () async {
_validate = true;
print(1);
if (!_formKey.currentState.validate()) {
print(2);
setState(() {});
return;
}
print(3);
if (!_serviceReport.validate()) return;
print(4);
_formKey.currentState.save();
print(5);
_isLoading = true;
setState(() {});

@ -5,23 +5,25 @@ 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/models/service_report.dart';
import 'package:test_sa/models/service_request/search_work_order.dart';
import 'package:test_sa/models/service_request/service_request.dart';
import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/widgets/loaders/app_loading.dart';
import 'package:test_sa/views/widgets/loaders/failed_loading.dart';
import 'edit_service_report.dart';
class FutureServiceReport extends StatefulWidget {
final ServiceRequest request;
final SearchWorkOrders workOrder;
const FutureServiceReport({Key key, this.request}) : super(key: key);
const FutureServiceReport({Key key, this.request, this.workOrder}) : super(key: key);
@override
_FutureServiceReportState createState() => _FutureServiceReportState();
}
class _FutureServiceReportState extends State<FutureServiceReport> {
UserProvider _userProvider;
SettingProvider _settingProvider;
@override
@ -31,17 +33,14 @@ class _FutureServiceReportState extends State<FutureServiceReport> {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
return Scaffold(
body: FutureBuilder<ServiceReport>(
future: ServiceRequestsProvider().getSingleServiceReport(
reportId: widget.request.reportID,
user: _userProvider.user,
host: _settingProvider.host,
subtitle: _subtitle
),
future: ServiceRequestsProvider().getSingleServiceReport(reportId: widget.workOrder.id, user: _userProvider.user, host: _settingProvider.host, subtitle: _subtitle),
builder: (BuildContext context, AsyncSnapshot<ServiceReport> snapshot) {
if (snapshot.hasError)
return FailedLoading(
message: snapshot.error.toString(),
onReload: (){setState(() {});},
onReload: () {
setState(() {});
},
);
if (snapshot.hasData) {
return EditServiceReport(

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
@ -5,12 +6,12 @@ import 'package:test_sa/controllers/localization/localization.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/int_extensions.dart';
import 'package:test_sa/models/enums/user_types.dart';
import 'package:test_sa/models/service_request/service_request.dart';
import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'package:test_sa/views/pages/user/requests/create_request.dart';
import 'package:test_sa/views/pages/user/requests/report/create_service_report.dart';
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
import 'package:test_sa/views/widgets/buttons/app_button.dart';
@ -19,9 +20,11 @@ import 'package:test_sa/views/widgets/images/images_list.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 'package:test_sa/views/widgets/requests/service_request_update_dialog.dart';
import 'package:test_sa/views/widgets/sound/sound_player.dart';
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
import '../../../../models/service_request/search_work_order.dart';
import 'report/future_service_report.dart';
class RequestDetailsPage extends StatelessWidget {
@ -29,11 +32,13 @@ class RequestDetailsPage extends StatelessWidget {
final ServiceRequest serviceRequest;
const RequestDetailsPage({Key key, this.serviceRequest}) : super(key: key);
@override
Widget build(BuildContext context) {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
UserProvider _userProvider = Provider.of<UserProvider>(context);
SettingProvider _settingProvider = Provider.of<SettingProvider>(context);
List<SearchWorkOrders> workOrders = [];
ServiceRequestsProvider _serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
return DefaultTabController(
length: 2,
@ -79,15 +84,13 @@ class RequestDetailsPage extends StatelessWidget {
buttonSize: 42,
backgroundColor: AColors.green,
onPressed: () async {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => CreateRequestPage(serviceRequest: serviceRequest)),
showModalBottomSheet(
context: context,
builder: (context) {
return ServiceRequestsUpdateDialog(
request: serviceRequest,
);
// showModalBottomSheet(
// context: context,
// builder: (context) {
//
// // return ServiceRequestsUpdateDialog(request: serviceRequest,);
// });
});
// DateTime picked = await showDatePicker(
// context: context,
// initialDate: DateTime.now(),
@ -154,9 +157,7 @@ class RequestDetailsPage extends StatelessWidget {
),
),
),
SizedBox(
height: 8,
),
SizedBox(height: 8),
SizedBox(
height: 60 * AppStyle.getScaleFactor(context),
child: ImagesList(
@ -296,27 +297,72 @@ class RequestDetailsPage extends StatelessWidget {
// )
],
),
serviceRequest.viewReport
? ListView(
padding: EdgeInsets.symmetric(horizontal: 16),
// workOrders.isEmpty ?
FutureBuilder(
future: _serviceRequestsProvider.searchWorkOrders(callId: serviceRequest.requestCode),
builder: (context, snap) {
workOrders = snap.data as List<SearchWorkOrders>;
if (snap.connectionState == ConnectionState.done && (snap.data?.length ?? 0) != 0) {
return ListView.separated(
padding: EdgeInsets.all(21),
itemCount: workOrders.length,
separatorBuilder: (czt, index) => 21.height,
itemBuilder: (context, index) {
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 ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
primary: itemColor.withOpacity(.7),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
),
),
//padding: EdgeInsets.symmetric(vertical: 8,horizontal: 8),
onPressed: () {
// onPressed(request);
},
child: Column(
children: [
RequestInfoRow(
title: _subtitle.faultDescription,
content: serviceRequest.faultDescription,
title: _subtitle.callId,
content: serviceRequest.requestCode,
),
RequestInfoRow(
title: _subtitle.workPerformed,
content: serviceRequest.workPerformed,
title: _subtitle.orderWorkNumber,
info: workOrders[index].workOrderNo.toString(),
),
RequestInfoRow(
title: _subtitle.visitDate,
info: serviceRequest.visitDate,
info: workOrders[index].visitDate,
),
RequestInfoRow(title: _subtitle.assignedEmployee, info: workOrders[index].assignedEmployee.name),
RequestInfoRow(
title: _subtitle.assetSN,
info: workOrders[index].callRequest.asset.assetSerialNo,
),
RequestInfoRow(
title: _subtitle.jobSheetNumber,
info: serviceRequest.jobSheetNumber,
title: _subtitle.assetName,
info: workOrders[index].callRequest.asset.modelDefinition.assetName,
),
_userProvider.user.type == UsersTypes.engineer && serviceRequest.reportID != null
RequestInfoRow(
title: _subtitle.model,
info: workOrders[index].callRequest.asset.modelDefinition.modelName,
),
RequestInfoRow(
title: _subtitle.site,
info: workOrders[index].callRequest.asset.site.custName,
),
RequestInfoRow(
title: _subtitle.maintenanceSituation,
info: workOrders[index].calllastSituation.name ?? '',
),
RequestInfoRow(
title: _subtitle.currentSituation,
info: workOrders[index].currentSituation.name ?? '',
),
_userProvider.user.type == UsersTypes.engineer && workOrders[index].workOrderNo != null
? Padding(
padding: EdgeInsets.all(32),
child: AButton(
@ -326,6 +372,7 @@ class RequestDetailsPage extends StatelessWidget {
MaterialPageRoute(
builder: (_) => FutureServiceReport(
request: serviceRequest,
workOrder: workOrders[index],
)),
);
},
@ -333,8 +380,12 @@ class RequestDetailsPage extends StatelessWidget {
)
: SizedBox.shrink(),
],
)
: _userProvider.user.type == UsersTypes.engineer
),
);
},
);
} else {
return _userProvider.user.type == UsersTypes.engineer
? Center(
child: Padding(
padding: EdgeInsets.all(32),
@ -353,7 +404,10 @@ class RequestDetailsPage extends StatelessWidget {
)
: Center(
child: ASubTitle(_subtitle.noDateFound),
),
);
}
},
)
],
),
),

@ -49,12 +49,7 @@ class _EditPentryState extends State<EditPentry> with SingleTickerProviderStateM
_isLoading = true;
setState(() {});
int status = await _regularVisitsProvider.updatePentry(
user: _userProvider.user,
host: _settingProvider.host,
pentry: _pentry,
visit: widget.visit
);
int status = await _regularVisitsProvider.updatePentry(user: _userProvider.user, host: _settingProvider.host, pentry: _pentry, visit: widget.visit);
_isLoading = false;
setState(() {});
if (status >= 200 && status < 300) {
@ -115,10 +110,18 @@ class _EditPentryState extends State<EditPentry> with SingleTickerProviderStateM
setState(() {});
},
tabs: const [
Tab(text: "PPM Check List",),
Tab(text: "Calibration Tools",),
Tab(text: "PK Kits",),
Tab(text: "Pentry",),
Tab(
text: "PPM Check List",
),
Tab(
text: "Calibration Tools",
),
Tab(
text: "PK Kits",
),
Tab(
text: "Pentry",
),
]),
),
),
@ -157,7 +160,9 @@ class _EditPentryState extends State<EditPentry> with SingleTickerProviderStateM
ASmallButton(
text: _subtitle.back,
onPressed: () {
_tabController.animateTo(_tabController.index - 1,);
_tabController.animateTo(
_tabController.index - 1,
);
setState(() {});
},
),
@ -166,7 +171,9 @@ class _EditPentryState extends State<EditPentry> with SingleTickerProviderStateM
ASmallButton(
text: _subtitle.next,
onPressed: () {
_tabController.animateTo(_tabController.index + 1,);
_tabController.animateTo(
_tabController.index + 1,
);
setState(() {});
},
),
@ -182,12 +189,9 @@ class _EditPentryState extends State<EditPentry> with SingleTickerProviderStateM
],
),
),
],
)
),
)),
),
);
}
}

@ -10,8 +10,8 @@ import 'package:test_sa/models/visits/visit.dart';
import 'package:test_sa/views/pages/user/visits/pantry/edit_pentry.dart';
import 'package:test_sa/views/widgets/loaders/app_loading.dart';
import 'package:test_sa/views/widgets/loaders/failed_loading.dart';
class FutureEditPentry extends StatefulWidget {
class FutureEditPentry extends StatefulWidget {
final Visit visit;
const FutureEditPentry({Key key, this.visit}) : super(key: key);
@ -21,7 +21,6 @@ class FutureEditPentry extends StatefulWidget {
}
class _FutureEditPentryState extends State<FutureEditPentry> {
UserProvider _userProvider;
SettingProvider _settingProvider;
@override
@ -32,17 +31,14 @@ class _FutureEditPentryState extends State<FutureEditPentry> {
Subtitle subtitle = AppLocalization.of(context).subtitle;
return Scaffold(
body: FutureBuilder<Pentry>(
future: RegularVisitsProvider().getPently(
user: _userProvider.user,
host: _settingProvider.host,
id: widget.visit.id
),
future: RegularVisitsProvider().getPently(user: _userProvider.user, host: _settingProvider.host, id: widget.visit.id),
builder: (BuildContext context, AsyncSnapshot<Pentry> snapshot) {
if (snapshot.hasError) {
return FailedLoading(
message: subtitle.failedToCompleteRequest,
onReload: (){setState(() {});},
onReload: () {
setState(() {});
},
);
}
if (snapshot.hasData) {

@ -18,14 +18,14 @@ import 'package:test_sa/views/widgets/buttons/app_icon_button.dart';
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
import 'package:test_sa/views/widgets/search/visits_search_bar.dart';
import 'package:test_sa/views/widgets/visits/visits_list.dart';
class PreventiveMaintenanceVisitsPage extends StatefulWidget {
static final String id = "/preventive-maintenance-visits";
@override
_PreventiveMaintenanceVisitsPageState createState() => _PreventiveMaintenanceVisitsPageState();
}
class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceVisitsPage>
with TickerProviderStateMixin{
class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceVisitsPage> with TickerProviderStateMixin {
PreventiveMaintenanceVisitsProvider _visitsProvider;
UserProvider _userProvider;
SettingProvider _settingProvider;
@ -68,10 +68,7 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
child: Center(
child: Text(
_subtitle.preventiveMaintenance,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
@ -101,10 +98,11 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
}
},
),
SizedBox(width: 16,)
SizedBox(
width: 16,
)
],
),
],
),
),
@ -137,7 +135,10 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
isScrollControlled: true,
context: context,
builder: (context) {
return UpdateVisitsGroupSheet(visits: visits,title:_subtitle.updatePreventiveMaintenance,);
return UpdateVisitsGroupSheet(
visits: visits,
title: _subtitle.updatePreventiveMaintenance,
);
},
) as VisitsGroup;
if (_group != null) {
@ -151,11 +152,7 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
);
},
);
int status = await _visitsProvider.updateGroupOfVisits(
user: _userProvider.user,
host: _settingProvider.host,
group: _group
);
int status = await _visitsProvider.updateGroupOfVisits(user: _userProvider.user, host: _settingProvider.host, group: _group);
Navigator.of(context).pop();
if (status >= 200 && status < 300) {
Fluttertoast.showToast(
@ -165,10 +162,7 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
);
} else {
Fluttertoast.showToast(
msg: HttpStatusManger.getStatusMessage(
status: status,
subtitle: _subtitle
),
msg: HttpStatusManger.getStatusMessage(status: status, subtitle: _subtitle),
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.BOTTOM,
);
@ -180,7 +174,6 @@ class _PreventiveMaintenanceVisitsPageState extends State<PreventiveMaintenanceV
),
],
),
],
),
),

@ -18,14 +18,14 @@ import 'package:test_sa/views/widgets/buttons/app_icon_button.dart';
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
import 'package:test_sa/views/widgets/search/visits_search_bar.dart';
import 'package:test_sa/views/widgets/visits/visits_list.dart';
class RegularVisitsPage extends StatefulWidget {
static final String id = "/Regular-visits";
@override
_RegularVisitsPageState createState() => _RegularVisitsPageState();
}
class _RegularVisitsPageState extends State<RegularVisitsPage>
with TickerProviderStateMixin{
class _RegularVisitsPageState extends State<RegularVisitsPage> with TickerProviderStateMixin {
RegularVisitsProvider _visitsProvider;
UserProvider _userProvider;
SettingProvider _settingProvider;
@ -67,10 +67,7 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
child: Center(
child: Text(
_subtitle.preventiveMaintenance,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
@ -99,10 +96,11 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
},
),
),
SizedBox(width: 16,)
SizedBox(
width: 16,
)
],
),
],
),
),
@ -134,7 +132,10 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
isScrollControlled: true,
context: context,
builder: (context) {
return UpdateVisitsGroupSheet(visits: visits,title: _subtitle.updateRegularVisits,);
return UpdateVisitsGroupSheet(
visits: visits,
title: _subtitle.updateRegularVisits,
);
},
) as VisitsGroup;
if (_group != null) {
@ -148,11 +149,7 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
);
},
);
int status = await _visitsProvider.updateGroupOfVisits(
user: _userProvider.user,
host: _settingProvider.host,
group: _group
);
int status = await _visitsProvider.updateGroupOfVisits(user: _userProvider.user, host: _settingProvider.host, group: _group);
Navigator.of(context).pop();
if (status >= 200 && status < 300) {
Fluttertoast.showToast(
@ -162,10 +159,7 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
);
} else {
Fluttertoast.showToast(
msg: HttpStatusManger.getStatusMessage(
status: status,
subtitle: _subtitle
),
msg: HttpStatusManger.getStatusMessage(status: status, subtitle: _subtitle),
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.BOTTOM,
);
@ -177,7 +171,6 @@ class _RegularVisitsPageState extends State<RegularVisitsPage>
),
],
),
],
),
),

@ -14,6 +14,7 @@ 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/status/employee/engineers_mune.dart';
import 'package:test_sa/views/widgets/visits/visit_status.dart';
class UpdateVisitsGroupSheet extends StatefulWidget {
final List<Visit> visits;
final String title;
@ -76,14 +77,18 @@ class _UpdateVisitsGroupSheetState extends State<UpdateVisitsGroupSheet> {
),
],
),
SizedBox(height: 8 * AppStyle.getScaleFactor(context),),
SizedBox(
height: 8 * AppStyle.getScaleFactor(context),
),
EngineersMenu(
initialValue: _group.engineer,
onSelect: (engineer) {
_group.engineer = engineer;
},
),
SizedBox(height: 8 * AppStyle.getScaleFactor(context),),
SizedBox(
height: 8 * AppStyle.getScaleFactor(context),
),
// AOneImagePicker(
// image: _image,
// onPick: (image){
@ -200,7 +205,9 @@ class _UpdateVisitsGroupSheetState extends State<UpdateVisitsGroupSheet> {
// ),
// ),
// ),
SizedBox(height: 8 * AppStyle.getScaleFactor(context),),
SizedBox(
height: 8 * AppStyle.getScaleFactor(context),
),
Expanded(
child: ListView.builder(
itemCount: widget.visits.length,
@ -209,28 +216,18 @@ class _UpdateVisitsGroupSheetState extends State<UpdateVisitsGroupSheet> {
return Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
margin: EdgeInsets.symmetric(vertical: 4),
decoration: BoxDecoration(
color: AColors.primaryColor,
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
boxShadow: [
AppStyle.boxShadow
]
),
decoration: BoxDecoration(color: AColors.primaryColor, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: [AppStyle.boxShadow]),
child: Row(
children: [
Expanded(
child: Text(
"${_subtitle.sn}: " + visit.deviceSerialNumber ?? _subtitle.noSerialNumberFound,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontSize: 16,
fontWeight: FontWeight.bold
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontSize: 16, fontWeight: FontWeight.bold),
),
),
),
VisitStatusLabel(visit: visit,)
VisitStatusLabel(
visit: visit,
)
],
),
);
@ -245,7 +242,6 @@ class _UpdateVisitsGroupSheetState extends State<UpdateVisitsGroupSheet> {
),
],
),
],
),
);

@ -38,10 +38,7 @@ class VisitDetailsPage extends StatelessWidget {
child: Center(
child: Text(
_subtitle.visitInformation,
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
),
@ -51,9 +48,11 @@ class VisitDetailsPage extends StatelessWidget {
buttonSize: 42,
backgroundColor: AColors.green,
onPressed: () async {
Navigator.of(context).push(
MaterialPageRoute(builder: (_)=> EditPentry(visit: visit,pentry: visit.pentry,))
);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => EditPentry(
visit: visit,
pentry: visit.pentry,
)));
},
),
SizedBox(width: 42)
@ -64,12 +63,13 @@ class VisitDetailsPage extends StatelessWidget {
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 16),
children: [
SizedBox(height: 8,),
SizedBox(
height: 8,
),
MaterialButton(
padding: EdgeInsets.zero,
onPressed: () {
Navigator.of(context).push(
MaterialPageRoute(
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => Scaffold(
body: InteractiveViewer(
child: Center(
@ -79,9 +79,7 @@ class VisitDetailsPage extends StatelessWidget {
),
),
),
)
)
);
)));
},
child: SizedBox(
height: 140 * AppStyle.getScaleFactor(context),
@ -92,14 +90,18 @@ class VisitDetailsPage extends StatelessWidget {
),
),
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
SizedBox(
height: 60 * AppStyle.getScaleFactor(context),
child: ImagesList(
images: visit.images,
),
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
RequestInfoRow(
title: _subtitle.code,
info: visit.serialNumber,
@ -112,7 +114,6 @@ class VisitDetailsPage extends StatelessWidget {
title: _subtitle.deviceSN,
info: visit.deviceSerialNumber,
),
RequestInfoRow(
title: _subtitle.expectDate,
info: visit.expectDate,
@ -126,17 +127,18 @@ class VisitDetailsPage extends StatelessWidget {
Expanded(
child: Text(
"${_subtitle.status} : ",
style: Theme.of(context).textTheme.subtitle1.copyWith(
fontWeight: FontWeight.bold
),
style: Theme.of(context).textTheme.subtitle1.copyWith(fontWeight: FontWeight.bold),
textScaleFactor: AppStyle.getScaleFactor(context),
),
),
VisitStatusLabel(visit: visit,),
VisitStatusLabel(
visit: visit,
),
],
),
Divider(color: Theme.of(context).primaryColor,),
Divider(
color: Theme.of(context).primaryColor,
),
RequestInfoRow(
title: _subtitle.contactStatus,
info: visit.assignTo,

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class AppNameBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
@ -11,10 +12,7 @@ class AppNameBar extends StatelessWidget {
child: Center(
child: Text(
"Test SA",
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontStyle: FontStyle.italic
),
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
),
),
);

@ -13,14 +13,14 @@ class AFlatButton extends StatelessWidget {
Widget build(BuildContext context) {
return TextButton(
style: TextButton.styleFrom(
foregroundColor: this.textColor ?? Colors.black, padding: padding,
foregroundColor: this.textColor ?? Colors.black,
padding: padding,
),
onPressed: onPressed,
child: Text(
text ?? "",
style: style ?? Theme.of(context).textTheme.bodyText1,
textScaleFactor: AppStyle.getScaleFactor(context),
)
);
));
}
}

@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class AIconButton extends StatelessWidget {
class AIconButton extends StatelessWidget {
final IconData iconData;
final Color color;
final Color backgroundColor;
@ -11,16 +11,7 @@ class AIconButton extends StatelessWidget {
final double iconSize;
final double buttonSize;
const AIconButton({
Key key,
this.iconData,
this.onPressed,
this.color,
this.iconSize,
this.buttonSize = 54,
this.backgroundColor
}) : super(key: key);
const AIconButton({Key key, this.iconData, this.onPressed, this.color, this.iconSize, this.buttonSize = 54, this.backgroundColor}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -30,11 +21,7 @@ class AIconButton extends StatelessWidget {
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
(AppStyle.borderRadius - 4) * AppStyle.getScaleFactor(context)
)
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular((AppStyle.borderRadius - 4) * AppStyle.getScaleFactor(context))),
backgroundColor: backgroundColor ?? AColors.onPrimaryColor,
),
onPressed: onPressed,

@ -1,8 +1,8 @@
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 {
class AIconButton2 extends StatelessWidget {
final IconData iconData;
final Color color;
final VoidCallback onPressed;

@ -16,11 +16,7 @@ class AOutLinedButton extends StatelessWidget {
return OutlinedButton(
style: ElevatedButton.styleFrom(
padding: padding ?? EdgeInsets.symmetric(vertical: 12),
textStyle: textStyle ?? Theme
.of(context)
.textTheme
.subtitle2
.copyWith(fontSize: 18),
textStyle: textStyle ?? Theme.of(context).textTheme.subtitle2.copyWith(fontSize: 18),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context))),
),
onPressed: onPressed,
@ -29,11 +25,7 @@ class AOutLinedButton extends StatelessWidget {
Expanded(
child: Text(
text ?? "",
style: Theme
.of(context)
.textTheme
.subtitle2
.copyWith(color: AColors.primaryColor, fontSize: 14, fontWeight: FontWeight.w600),
style: Theme.of(context).textTheme.subtitle2.copyWith(color: AColors.primaryColor, fontSize: 14, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
textScaleFactor: AppStyle.getScaleFactor(context),
),

@ -15,19 +15,13 @@ class ASmallButton extends StatelessWidget {
style: ElevatedButton.styleFrom(
padding: padding,
primary: color ?? Theme.of(context).primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8)
),
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
),
style: style ?? Theme.of(context).textTheme.bodyText1.copyWith(color: color == Colors.white ? Theme.of(context).primaryColor : Colors.white),
textScaleFactor: AppStyle.getScaleFactor(context),
),
onPressed: onPressed
);
onPressed: onPressed);
}
}

@ -11,13 +11,13 @@ class CarveInImage extends CustomClipper<Path> {
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.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;
}

@ -16,23 +16,15 @@ class ADatePicker extends StatelessWidget {
foregroundColor: Colors.white,
textStyle: Theme.of(context).textTheme.subtitle2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
12 * AppStyle.getScaleFactor(context)
),
borderRadius: BorderRadius.circular(12 * AppStyle.getScaleFactor(context)),
),
),
child: Text(
date == null ? "Pick Date" :
date.toString().split(" ").first,
date == null ? "Pick Date" : date.toString().split(" ").first,
textScaleFactor: AppStyle.getScaleFactor(context),
),
onPressed: () async {
DateTime picked = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: from ?? DateTime.now(),
lastDate: to ?? DateTime.now().add(Duration(days: 365))
);
DateTime picked = await showDatePicker(context: context, initialDate: DateTime.now(), firstDate: from ?? DateTime.now(), lastDate: to ?? DateTime.now().add(Duration(days: 365)));
onDatePicker(picked);
},
);

@ -4,6 +4,7 @@ import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'date_picker.dart';
class FromToDateBar extends StatefulWidget {
final DateTime from;
final DateTime to;
@ -32,16 +33,12 @@ class _FromToDateBarState extends State<FromToDateBar> {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_subtitle.from,
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: 12,
fontWeight: FontWeight.normal
),
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.normal),
textScaleFactor: AppStyle.getScaleFactor(context),
),
ADatePicker(
@ -60,10 +57,7 @@ class _FromToDateBarState extends State<FromToDateBar> {
children: [
Text(
_subtitle.to,
style: Theme.of(context).textTheme.bodyText1.copyWith(
fontSize: 12,
fontWeight: FontWeight.normal
),
style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: 12, fontWeight: FontWeight.normal),
textScaleFactor: AppStyle.getScaleFactor(context),
),
ADatePicker(

@ -6,6 +6,7 @@ import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/app_style/colors.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;

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:test_sa/models/department.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class DepartmentItem extends StatelessWidget {
final Department department;
final Function(Department) onPressed;
@ -15,9 +16,7 @@ class DepartmentItem extends StatelessWidget {
style: ElevatedButton.styleFrom(
backgroundColor: AColors.primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
),
),
onPressed: () {
@ -26,12 +25,9 @@ class DepartmentItem extends StatelessWidget {
child: ListTile(
title: Text(
department.name ?? "",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white
),
style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white),
textDirection: TextDirection.rtl,
),
),
),
);

@ -10,6 +10,7 @@ import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
import 'package:test_sa/views/widgets/loaders/no_item_found.dart';
import '../app_text_form_field.dart';
class SingleDepartmentPicker extends StatefulWidget {
static final String id = "/single-Department-Picker";
@override
@ -45,7 +46,9 @@ class _SingleDepartmentPickerState extends State<SingleDepartmentPicker> {
},
child: Column(
children: [
SizedBox(height: 48,),
SizedBox(
height: 48,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: ATextFormField(
@ -54,19 +57,17 @@ class _SingleDepartmentPickerState extends State<SingleDepartmentPicker> {
suffixIcon: Icon(Icons.search_rounded),
onChange: (value) {
_searchableList.clear();
_searchableList.addAll(_departmentsProvider.departments.where(
(element) => element.name.toLowerCase().contains(
value.toLowerCase()
)
).toList());
_searchableList.addAll(_departmentsProvider.departments.where((element) => element.name.toLowerCase().contains(value.toLowerCase())).toList());
setState(() {});
},
),
),
Expanded(
child: _searchableList.isEmpty ?
NoItemFound(message: _subtitle.noUniteFound,):
ListView.builder(
child: _searchableList.isEmpty
? NoItemFound(
message: _subtitle.noUniteFound,
)
: ListView.builder(
padding: EdgeInsets.zero,
shrinkWrap: true,
itemCount: _searchableList.length,

@ -5,6 +5,7 @@ import 'package:test_sa/views/app_style/colors.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';
class DeviceTransferInfoSection extends StatelessWidget {
final DeviceTransferInfo info;
final VoidCallback onEdit;
@ -41,19 +42,16 @@ class DeviceTransferInfoSection extends StatelessWidget {
),
RequestInfoRow(
title: "Signature",
info: info.signature?.isEmpty != false
? subtitle.noDateFound : null,
contentWidget: info.signature?.isEmpty != false ? null :
ImageLoader(
info: info.signature?.isEmpty != false ? subtitle.noDateFound : null,
contentWidget: info.signature?.isEmpty != false
? null
: ImageLoader(
url: info.signature,
),
),
RequestInfoRow(
title: subtitle.status,
infoWidget: StatusLabel(
label: info.status?.name,
color: AColors.getGasStatusColor(info.status?.id)
),
infoWidget: StatusLabel(label: info.status?.name, color: AColors.getGasStatusColor(info.status?.id)),
),
],
);

@ -9,6 +9,7 @@ import 'package:test_sa/models/user.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart';
class DeviceTransferItem extends StatelessWidget {
final int index;
final DeviceTransfer item;
@ -19,12 +20,8 @@ class DeviceTransferItem extends StatelessWidget {
Widget build(BuildContext context) {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
User _user = Provider.of<UserProvider>(context, listen: false).user;
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;
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),
@ -33,9 +30,7 @@ class DeviceTransferItem extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
backgroundColor: itemColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
),
),
//padding: EdgeInsets.symmetric(vertical: 8,horizontal: 8),
@ -53,13 +48,11 @@ class DeviceTransferItem extends StatelessWidget {
children: [
Text(
item.title ?? "-----",
style: Theme.of(context).textTheme.headline6.copyWith(
color: onItemColor,
fontSize: 16,
fontWeight: FontWeight.bold
style: Theme.of(context).textTheme.headline6.copyWith(color: onItemColor, fontSize: 16, fontWeight: FontWeight.bold),
),
Divider(
color: onItemColor,
),
Divider(color: onItemColor,),
Row(
children: [
Expanded(
@ -74,7 +67,6 @@ class DeviceTransferItem extends StatelessWidget {
color: AColors.getRequestStatusColor(item.sender.status?.id),
label: item.sender.status?.name,
)
],
),
//const SizedBox(height: 8,),
@ -88,8 +80,6 @@ class DeviceTransferItem extends StatelessWidget {
),
),
),
],
),
if (item.sender.department.id != null)
@ -99,7 +89,9 @@ class DeviceTransferItem extends StatelessWidget {
color: onItemColor,
),
),
Divider(color: onItemColor,),
Divider(
color: onItemColor,
),
Row(
children: [
Expanded(
@ -114,7 +106,6 @@ class DeviceTransferItem extends StatelessWidget {
color: AColors.getRequestStatusColor(item.receiver.status?.id),
label: item.receiver.status?.name,
)
],
),
//const SizedBox(height: 8,),
@ -128,8 +119,6 @@ class DeviceTransferItem extends StatelessWidget {
),
),
),
],
),
if (item.receiver.department.id != null)
@ -143,7 +132,6 @@ class DeviceTransferItem extends StatelessWidget {
],
),
),
],
),
],

@ -6,6 +6,7 @@ import 'package:test_sa/views/pages/device_transfer/device_transfer_details.dart
import 'package:test_sa/views/widgets/device_trancfer/device_transfer_item.dart';
import 'package:test_sa/views/widgets/loaders/lazy_loading.dart';
import 'package:test_sa/views/widgets/loaders/no_item_found.dart';
class DeviceTransferList extends StatelessWidget {
final List<DeviceTransfer> items;
final bool nextPage;
@ -15,10 +16,11 @@ class DeviceTransferList extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (items.length == 0) {
Subtitle subtitle = AppLocalization.of(context).subtitle;
return NoItemFound(message: subtitle.noServiceRequestFound,);
return NoItemFound(
message: subtitle.noServiceRequestFound,
);
}
return LazyLoading(
nextPage: nextPage,
@ -32,15 +34,13 @@ class DeviceTransferList extends StatelessWidget {
index: itemIndex,
item: items[itemIndex],
onPressed: (model) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_)=> DeviceTransferDetails(model: model,)
)
);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => DeviceTransferDetails(
model: model,
)));
},
);
}
),
}),
);
}
}

@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:test_sa/controllers/localization/localization.dart';
import 'package:test_sa/models/subtitle.dart';
class AAlertDialog extends StatelessWidget {
final String title;
final String content;
@ -12,12 +13,8 @@ class AAlertDialog extends StatelessWidget {
Widget build(BuildContext context) {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
return CupertinoAlertDialog(
title: title != null
? Text(title)
: null,
content: content != null
? Text(content)
: null,
title: title != null ? Text(title) : null,
content: content != null ? Text(content) : null,
actions: <Widget>[
TextButton(
child: Text(_subtitle.confirm),

@ -7,18 +7,22 @@ import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/views/app_style/colors.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);
const AutoCompleteModelField({
Key key,
this.initialValue,
this.onPick,
}) : super(key: key);
@override
_AutoCompleteModelFieldState createState() => _AutoCompleteModelFieldState();
}
class _AutoCompleteModelFieldState extends State<AutoCompleteModelField> {
SettingProvider _settingProvider;
DevicesProvider _devicesProvider;
UserProvider _userProvider;
@ -35,6 +39,7 @@ class _AutoCompleteModelFieldState extends State<AutoCompleteModelField> {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
_settingProvider = Provider.of<SettingProvider>(context);
@ -42,25 +47,17 @@ class _AutoCompleteModelFieldState extends State<AutoCompleteModelField> {
_devicesProvider = Provider.of<DevicesProvider>(context);
//Subtitle _subtitle = AppLocalization.of(context).subtitle;
return Container(
padding: const EdgeInsets.symmetric(
horizontal: 16
),
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
]
),
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,

@ -4,6 +4,7 @@ import 'package:test_sa/models/device/device.dart';
import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class DeviceItem extends StatelessWidget {
final Device device;
final Function(Device) onPressed;
@ -18,36 +19,33 @@ class DeviceItem extends StatelessWidget {
style: ElevatedButton.styleFrom(
primary: AColors.primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
),
),
onPressed: () {
onPressed(device);
},
child: ListTile(
title: Text("${_subtitle.sn} : ${device.serialNumber}",
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white
),
title: Text(
"${_subtitle.sn} : ${device.serialNumber}",
style: Theme.of(context).textTheme.headline6.copyWith(color: AColors.white),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(color: Theme.of(context).scaffoldBackgroundColor,),
Text("${_subtitle.brand} : ${device.modelDefinition.manufacturerName}",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white
Divider(
color: Theme.of(context).scaffoldBackgroundColor,
),
Text(
"${_subtitle.brand} : ${device.modelDefinition.manufacturerName}",
style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white),
),
Divider(color: Theme.of(context).scaffoldBackgroundColor,),
Text("${_subtitle.model} : ${device.modelDefinition.modelName}",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white
Divider(
color: Theme.of(context).scaffoldBackgroundColor,
),
Text(
"${_subtitle.model} : ${device.modelDefinition.modelName}",
style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white),
),
],
),

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:test_sa/models/gas_refill/gas_refill_details.dart';
import 'package:test_sa/views/app_style/colors.dart';
class GasRefillCreateDetailsItem extends StatelessWidget {
class GasRefillCreateDetailsItem extends StatelessWidget {
final GasRefillDetails model;
final VoidCallback onDelete;
@ -14,14 +14,7 @@ class GasRefillCreateDetailsItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(child: Text(model.type.name)),
IconButton(
onPressed: onDelete,
color: AColors.red,
icon: const Icon(Icons.delete)
)
],
children: [Expanded(child: Text(model.type.name)), IconButton(onPressed: onDelete, color: AColors.red, icon: const Icon(Icons.delete))],
),
Wrap(
spacing: 10,

@ -9,6 +9,7 @@ import 'package:test_sa/models/user.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart';
class GasRefillItem extends StatelessWidget {
final int index;
final GasRefillModel item;
@ -19,12 +20,8 @@ class GasRefillItem extends StatelessWidget {
Widget build(BuildContext context) {
Subtitle _subtitle = AppLocalization.of(context).subtitle;
User _user = Provider.of<UserProvider>(context, listen: false).user;
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;
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),
@ -33,9 +30,7 @@ class GasRefillItem extends StatelessWidget {
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 8),
backgroundColor: itemColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
),
),
//padding: EdgeInsets.symmetric(vertical: 8,horizontal: 8),
@ -53,11 +48,7 @@ class GasRefillItem extends StatelessWidget {
children: [
Text(
item.title ?? "-----",
style: Theme.of(context).textTheme.headline6.copyWith(
color: onItemColor,
fontSize: 16,
fontWeight: FontWeight.bold
),
style: Theme.of(context).textTheme.headline6.copyWith(color: onItemColor, fontSize: 16, fontWeight: FontWeight.bold),
),
Row(
children: [
@ -76,10 +67,11 @@ class GasRefillItem extends StatelessWidget {
color: onItemColor,
),
),
],
),
Divider(color: onItemColor,),
Divider(
color: onItemColor,
),
Row(
children: [
Expanded(
@ -90,18 +82,13 @@ class GasRefillItem extends StatelessWidget {
),
),
),
if(item.status?.id != null)
StatusLabel(label: item.status.name,
color: AColors.getGasStatusColor(item.status.id)
),
if (item.status?.id != null) StatusLabel(label: item.status.name, color: AColors.getGasStatusColor(item.status.id)),
],
),
//Divider(color: onItemColor,),
],
),
),
],
),
],

@ -6,6 +6,7 @@ import 'package:test_sa/views/pages/user/gas_refill/gas_refill_details.dart';
import 'package:test_sa/views/widgets/gas_refill/gas_refill_item.dart';
import 'package:test_sa/views/widgets/loaders/lazy_loading.dart';
import 'package:test_sa/views/widgets/loaders/no_item_found.dart';
class GasRefillList extends StatelessWidget {
final List<GasRefillModel> items;
final bool nextPage;
@ -15,10 +16,11 @@ class GasRefillList extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (items.length == 0) {
Subtitle subtitle = AppLocalization.of(context).subtitle;
return NoItemFound(message: subtitle.noServiceRequestFound,);
return NoItemFound(
message: subtitle.noServiceRequestFound,
);
}
return LazyLoading(
nextPage: nextPage,
@ -32,15 +34,13 @@ class GasRefillList extends StatelessWidget {
index: itemIndex,
item: items[itemIndex],
onPressed: (model) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_)=> GasRefillDetails(model: model,)
)
);
Navigator.of(context).push(MaterialPageRoute(
builder: (_) => GasRefillDetails(
model: model,
)));
},
);
}
),
}),
);
}
}

@ -7,8 +7,8 @@ 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';
class GasRefillUpdateDetailsItem extends StatelessWidget {
class GasRefillUpdateDetailsItem extends StatelessWidget {
final GasRefillDetails details;
final bool enableEdit;
final bool validate;
@ -30,29 +30,32 @@ class GasRefillUpdateDetailsItem extends StatelessWidget {
title: "Requested Quantity",
info: details.requestedQuantity.toStringAsFixed(0),
),
enableEdit ?
Column(
enableEdit
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ASubTitle(subtitle.quantity),
if (validate && details.deliveredQuantity == null)
ASubTitle(subtitle.requiredWord,color: Colors.red,),
SizedBox(height: 4,),
ASubTitle(
subtitle.requiredWord,
color: Colors.red,
),
SizedBox(
height: 4,
),
ATextFormField(
initialValue: (details.deliveredQuantity ?? "").toString(),
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.subtitle1,
validator: (value) =>
Validator.isNumeric(value)
? null : "allow numbers only",
validator: (value) => Validator.isNumeric(value) ? null : "allow numbers only",
textInputType: TextInputType.number,
onSaved: (value) {
details.deliveredQuantity = double.tryParse(value);
},
),
],
):
RequestInfoRow(
)
: RequestInfoRow(
title: "Delivered Quantity",
info: details.deliveredQuantity?.toStringAsFixed(0),
),

@ -8,19 +8,23 @@ import 'package:test_sa/models/hospital.dart';
import 'package:test_sa/models/subtitle.dart';
import 'package:test_sa/views/app_style/colors.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);
const HospitalAutoCompleteField({
Key key,
this.onSearch,
this.initialValue,
}) : super(key: key);
@override
_HospitalAutoCompleteFieldState createState() => _HospitalAutoCompleteFieldState();
}
class _HospitalAutoCompleteFieldState extends State<HospitalAutoCompleteField> {
SettingProvider _settingProvider;
TextEditingController _controller;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save