Merge remote-tracking branch 'origin/main_latest_merged' into main_latest_merged
# Conflicts: # ios/Podfile.lock # ios/Runner.xcodeproj/project.pbxprojmain_design2.0
commit
c6c6aa5bce
Binary file not shown.
|
After Width: | Height: | Size: 73 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@ -0,0 +1,268 @@
|
||||
PODS:
|
||||
- audioplayers_darwin (0.0.1):
|
||||
- Flutter
|
||||
- DKImagePickerController/Core (4.3.4):
|
||||
- DKImagePickerController/ImageDataManager
|
||||
- DKImagePickerController/Resource
|
||||
- DKImagePickerController/ImageDataManager (4.3.4)
|
||||
- DKImagePickerController/PhotoGallery (4.3.4):
|
||||
- DKImagePickerController/Core
|
||||
- DKPhotoGallery
|
||||
- DKImagePickerController/Resource (4.3.4)
|
||||
- DKPhotoGallery (0.0.17):
|
||||
- DKPhotoGallery/Core (= 0.0.17)
|
||||
- DKPhotoGallery/Model (= 0.0.17)
|
||||
- DKPhotoGallery/Preview (= 0.0.17)
|
||||
- DKPhotoGallery/Resource (= 0.0.17)
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Core (0.0.17):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Preview
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Model (0.0.17):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Preview (0.0.17):
|
||||
- DKPhotoGallery/Model
|
||||
- DKPhotoGallery/Resource
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- DKPhotoGallery/Resource (0.0.17):
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- file_picker (0.0.1):
|
||||
- DKImagePickerController/PhotoGallery
|
||||
- Flutter
|
||||
- Firebase/CoreOnly (10.12.0):
|
||||
- FirebaseCore (= 10.12.0)
|
||||
- Firebase/Messaging (10.12.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseMessaging (~> 10.12.0)
|
||||
- firebase_core (2.15.0):
|
||||
- Firebase/CoreOnly (= 10.12.0)
|
||||
- Flutter
|
||||
- firebase_messaging (14.6.5):
|
||||
- Firebase/Messaging (= 10.12.0)
|
||||
- firebase_core
|
||||
- Flutter
|
||||
- FirebaseCore (10.12.0):
|
||||
- FirebaseCoreInternal (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/Logger (~> 7.8)
|
||||
- FirebaseCoreInternal (10.12.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||
- FirebaseInstallations (10.12.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||
- PromisesObjC (~> 2.1)
|
||||
- FirebaseMessaging (10.12.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- FirebaseInstallations (~> 10.0)
|
||||
- GoogleDataTransport (~> 9.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/Reachability (~> 7.8)
|
||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_keyboard_visibility (0.0.1):
|
||||
- Flutter
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- flutter_sound (9.2.13):
|
||||
- Flutter
|
||||
- flutter_sound_core (= 9.2.13)
|
||||
- flutter_sound_core (9.2.13)
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- GoogleDataTransport (9.2.3):
|
||||
- GoogleUtilities/Environment (~> 7.7)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (7.11.4):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Environment (7.11.4):
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/Logger (7.11.4):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Network (7.11.4):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (7.11.4)"
|
||||
- GoogleUtilities/Reachability (7.11.4):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/UserDefaults (7.11.4):
|
||||
- GoogleUtilities/Logger
|
||||
- image_picker_ios (0.0.1):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner (5.0.11)
|
||||
- nanopb (2.30909.0):
|
||||
- nanopb/decode (= 2.30909.0)
|
||||
- nanopb/encode (= 2.30909.0)
|
||||
- nanopb/decode (2.30909.0)
|
||||
- nanopb/encode (2.30909.0)
|
||||
- package_info (0.0.1):
|
||||
- Flutter
|
||||
- path_provider_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- permission_handler_apple (9.1.1):
|
||||
- Flutter
|
||||
- PromisesObjC (2.3.1)
|
||||
- qr_code_scanner (0.2.0):
|
||||
- Flutter
|
||||
- MTBBarcodeScanner
|
||||
- SDWebImage (5.17.0):
|
||||
- SDWebImage/Core (= 5.17.0)
|
||||
- SDWebImage/Core (5.17.0)
|
||||
- share (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- speech_to_text (0.0.1):
|
||||
- Flutter
|
||||
- Try
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
- SwiftyGif (5.4.4)
|
||||
- Toast (4.0.0)
|
||||
- Try (2.1.1)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
|
||||
- file_picker (from `.symlinks/plugins/file_picker/ios`)
|
||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- flutter_sound (from `.symlinks/plugins/flutter_sound/ios`)
|
||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- package_info (from `.symlinks/plugins/package_info/ios`)
|
||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
|
||||
- share (from `.symlinks/plugins/share/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
|
||||
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
|
||||
- sqflite (from `.symlinks/plugins/sqflite/ios`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- DKImagePickerController
|
||||
- DKPhotoGallery
|
||||
- Firebase
|
||||
- FirebaseCore
|
||||
- FirebaseCoreInternal
|
||||
- FirebaseInstallations
|
||||
- FirebaseMessaging
|
||||
- flutter_sound_core
|
||||
- FMDB
|
||||
- GoogleDataTransport
|
||||
- GoogleUtilities
|
||||
- MTBBarcodeScanner
|
||||
- nanopb
|
||||
- PromisesObjC
|
||||
- SDWebImage
|
||||
- SwiftyGif
|
||||
- Toast
|
||||
- Try
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
audioplayers_darwin:
|
||||
:path: ".symlinks/plugins/audioplayers_darwin/ios"
|
||||
file_picker:
|
||||
:path: ".symlinks/plugins/file_picker/ios"
|
||||
firebase_core:
|
||||
:path: ".symlinks/plugins/firebase_core/ios"
|
||||
firebase_messaging:
|
||||
:path: ".symlinks/plugins/firebase_messaging/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_keyboard_visibility:
|
||||
:path: ".symlinks/plugins/flutter_keyboard_visibility/ios"
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
flutter_sound:
|
||||
:path: ".symlinks/plugins/flutter_sound/ios"
|
||||
fluttertoast:
|
||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
package_info:
|
||||
:path: ".symlinks/plugins/package_info/ios"
|
||||
path_provider_foundation:
|
||||
:path: ".symlinks/plugins/path_provider_foundation/ios"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
qr_code_scanner:
|
||||
:path: ".symlinks/plugins/qr_code_scanner/ios"
|
||||
share:
|
||||
:path: ".symlinks/plugins/share/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
|
||||
speech_to_text:
|
||||
:path: ".symlinks/plugins/speech_to_text/ios"
|
||||
sqflite:
|
||||
:path: ".symlinks/plugins/sqflite/ios"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
|
||||
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
|
||||
Firebase: 07150e75d142fb9399f6777fa56a187b17f833a0
|
||||
firebase_core: e477125798fc37cd4ab43ca6a8536bf7e0929c00
|
||||
firebase_messaging: 334d68c3a36b6d4d5cd91e4f42509e0d4ae49828
|
||||
FirebaseCore: f86a1394906b97ac445ae49c92552a9425831bed
|
||||
FirebaseCoreInternal: 950500ad8a08963657f6d8c67b579740c06d6aa1
|
||||
FirebaseInstallations: 7b99ef103f013624444c614397038219c45f8e63
|
||||
FirebaseMessaging: bb2c4f6422a753038fe137d90ae7c1af57251316
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
|
||||
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
|
||||
flutter_sound: c60effa2a350fb977885f0db2fbc4c1ad5160900
|
||||
flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae
|
||||
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
GoogleDataTransport: f0308f5905a745f94fb91fea9c6cbaf3831cb1bd
|
||||
GoogleUtilities: c63691989bf362ba0505507da00eeb326192e83e
|
||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
|
||||
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
|
||||
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
|
||||
SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9
|
||||
share: 0b2c3e82132f5888bccca3351c504d0003b3b410
|
||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
|
||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||
|
||||
PODFILE CHECKSUM: 9addd1ae6176ca7bfe24f8bac9acf6aeb76cd8f5
|
||||
|
||||
COCOAPODS: 1.12.1
|
||||
@ -0,0 +1,75 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
||||
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||
import 'package:test_sa/models/lookup.dart';
|
||||
import 'package:test_sa/models/user.dart';
|
||||
|
||||
class AssetTransferStatusProvider extends ChangeNotifier {
|
||||
//reset provider data
|
||||
void reset() {
|
||||
_items = null;
|
||||
_loading = null;
|
||||
_stateCode = null;
|
||||
}
|
||||
|
||||
// state code of current request to defied error message
|
||||
// like 400 customer request failed
|
||||
// 500 service not available
|
||||
int _stateCode;
|
||||
|
||||
int get stateCode => _stateCode;
|
||||
|
||||
// contain user data
|
||||
// when user not login or register _user = null
|
||||
List<Lookup> _items;
|
||||
|
||||
List<Lookup> get items => _items;
|
||||
|
||||
// when categories in-process _loading = true
|
||||
// done _loading = true
|
||||
// failed _loading = false
|
||||
bool _loading;
|
||||
|
||||
bool get isLoading => _loading;
|
||||
|
||||
set isLoading(bool isLoading) {
|
||||
_loading = isLoading;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// return -2 if request in progress
|
||||
/// return -1 if error happen when sending request
|
||||
/// return state code if request complete may be 200, 404 or 403
|
||||
/// for more details check http state manager
|
||||
/// lib\controllers\http_status_manger\http_status_manger.dart
|
||||
Future<int> getData({
|
||||
String host,
|
||||
User user,
|
||||
}) async {
|
||||
if (_loading == true) return -2;
|
||||
_loading = true;
|
||||
notifyListeners();
|
||||
Response response;
|
||||
try {
|
||||
response = await ApiManager.instance.get(URLs.getAssetTransferStatus);
|
||||
_stateCode = response.statusCode;
|
||||
if (response.statusCode >= 200 && response.statusCode < 300) {
|
||||
// client's request was successfully received
|
||||
List categoriesListJson = json.decode(response.body)["data"];
|
||||
_items = categoriesListJson.map((item) => Lookup.fromJson(item)).toList();
|
||||
}
|
||||
_loading = false;
|
||||
notifyListeners();
|
||||
return response.statusCode;
|
||||
} catch (error) {
|
||||
_loading = false;
|
||||
_stateCode = -1;
|
||||
notifyListeners();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
||||
import 'package:test_sa/controllers/api_routes/urls.dart';
|
||||
import 'package:test_sa/models/service_request/search_work_order.dart';
|
||||
|
||||
class VendorProvider extends ChangeNotifier {
|
||||
void reset() {
|
||||
_vendors = null;
|
||||
_loading = null;
|
||||
_stateCode = null;
|
||||
}
|
||||
|
||||
int _stateCode;
|
||||
int get stateCode => _stateCode;
|
||||
|
||||
List<Supplier> _vendors;
|
||||
List<Supplier> get vendors => _vendors;
|
||||
|
||||
bool _loading;
|
||||
bool get isLoading => _loading;
|
||||
set isLoading(bool isLoading) {
|
||||
_loading = isLoading;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
Future<int> getVendors(String text) async {
|
||||
if (_loading == true) return -2;
|
||||
_loading = true;
|
||||
notifyListeners();
|
||||
Response response;
|
||||
try {
|
||||
response = await ApiManager.instance.get("${URLs.getSuppliersAutoComplete}?searchText=$text");
|
||||
_stateCode = response.statusCode;
|
||||
if (response.statusCode >= 200 && response.statusCode < 300) {
|
||||
// client's request was successfully received
|
||||
List suppliersJson = json.decode(response.body)["data"];
|
||||
_vendors = suppliersJson.map((type) => Supplier.fromJson(type)).toList();
|
||||
}
|
||||
_loading = false;
|
||||
notifyListeners();
|
||||
return response.statusCode;
|
||||
} catch (error) {
|
||||
_loading = false;
|
||||
_stateCode = -1;
|
||||
notifyListeners();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
import 'package:test_sa/models/device/device.dart';
|
||||
|
||||
import '../hospital.dart';
|
||||
|
||||
class DeviceTransferSearch {
|
||||
Device device;
|
||||
String title, room;
|
||||
bool mostRecent;
|
||||
Hospital hospital;
|
||||
Buildings building;
|
||||
List<Buildings> buildingsList;
|
||||
Floors floor;
|
||||
List<Floors> floorsList;
|
||||
Departments department;
|
||||
List<Departments> departmentsList;
|
||||
|
||||
DeviceTransferSearch({
|
||||
this.device,
|
||||
this.hospital,
|
||||
this.building,
|
||||
this.floor,
|
||||
this.department,
|
||||
this.room,
|
||||
this.title,
|
||||
this.mostRecent = true,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
Map<String, dynamic> search = {};
|
||||
if (title != null && title.isNotEmpty) {
|
||||
search["transferCode"] = title;
|
||||
}
|
||||
if (device != null) {
|
||||
search["assetId"] = device.id;
|
||||
}
|
||||
if (mostRecent != null) {
|
||||
search["mostRecent"] = mostRecent;
|
||||
}
|
||||
if (hospital?.id != null) {
|
||||
search["destSiteId"] = hospital.id;
|
||||
}
|
||||
if (building?.id != null) {
|
||||
search["destBuildingId"] = building.id;
|
||||
}
|
||||
if (floor?.id != null) {
|
||||
search["destFloorId"] = floor.id;
|
||||
}
|
||||
if (department?.id != null) {
|
||||
search["destDepartmentId"] = department.id;
|
||||
}
|
||||
if (room != null && room.isNotEmpty) {
|
||||
search["destRoom"] = department.id;
|
||||
}
|
||||
return search;
|
||||
}
|
||||
|
||||
void fromSearch(DeviceTransferSearch newSearch) {
|
||||
title = newSearch.title;
|
||||
room = newSearch.room;
|
||||
mostRecent = newSearch.mostRecent;
|
||||
device = newSearch.device;
|
||||
hospital = newSearch.hospital;
|
||||
building = newSearch.building;
|
||||
floor = newSearch.floor;
|
||||
department = newSearch.department;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,73 @@
|
||||
import 'package:test_sa/models/lookup.dart';
|
||||
import 'package:test_sa/models/service_request/search_work_order.dart';
|
||||
|
||||
import '../fault_description.dart';
|
||||
|
||||
class SubWorkOrderDetails {
|
||||
Lookup equipmentStatus;
|
||||
Lookup reason;
|
||||
FaultDescription faultDescription;
|
||||
List<SparePartsWorkOrders> sparePartsWorkOrders;
|
||||
List<SuppEngineerWorkOrders> suppEngineerWorkOrders;
|
||||
SupplierModel supplier;
|
||||
|
||||
SubWorkOrderDetails({
|
||||
this.equipmentStatus,
|
||||
this.reason,
|
||||
this.faultDescription,
|
||||
this.sparePartsWorkOrders,
|
||||
this.supplier,
|
||||
this.suppEngineerWorkOrders,
|
||||
});
|
||||
|
||||
SubWorkOrderDetails.fromJson(dynamic json) {
|
||||
if (json['equipmentStatus'] != null) equipmentStatus = Lookup.fromJson(json['equipmentStatus']);
|
||||
if (json['reason'] != null) reason = Lookup.fromJson(json['reason']);
|
||||
if (json['faultDescription'] != null) faultDescription = FaultDescription.fromJson(json['faultDescription']);
|
||||
if (json['supplier'] != null) supplier = SupplierModel.fromJson(json['supplier']);
|
||||
if (json['sparePartsWorkOrders'] != null) {
|
||||
sparePartsWorkOrders = [];
|
||||
json['sparePartsWorkOrders'].forEach((v) {
|
||||
sparePartsWorkOrders.add(SparePartsWorkOrders.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['suppEngineerWorkOrders'] != null) {
|
||||
suppEngineerWorkOrders = [];
|
||||
json['suppEngineerWorkOrders'].forEach((v) {
|
||||
suppEngineerWorkOrders.add(SuppEngineerWorkOrders.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
SubWorkOrderDetails copyWith({
|
||||
Lookup equipmentStatus,
|
||||
Lookup reason,
|
||||
FaultDescription faultDescription,
|
||||
List<SparePartsWorkOrders> sparePartsWorkOrders,
|
||||
SupplierModel supplier,
|
||||
SuppEngineerWorkOrders suppEngineerWorkOrders,
|
||||
}) =>
|
||||
SubWorkOrderDetails(
|
||||
equipmentStatus: equipmentStatus ?? this.equipmentStatus,
|
||||
reason: reason ?? this.reason,
|
||||
faultDescription: faultDescription ?? this.faultDescription,
|
||||
sparePartsWorkOrders: sparePartsWorkOrders ?? this.sparePartsWorkOrders,
|
||||
supplier: supplier ?? this.supplier,
|
||||
suppEngineerWorkOrders: suppEngineerWorkOrders ?? this.suppEngineerWorkOrders,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['equipmentStatus'] = equipmentStatus?.toMap();
|
||||
map['reason'] = reason?.toMap();
|
||||
map['faultDescription'] = faultDescription?.toJson();
|
||||
if (sparePartsWorkOrders?.isNotEmpty ?? false) {
|
||||
map['sparePartsWorkOrders'] = sparePartsWorkOrders?.map((e) => e.toJson())?.toList();
|
||||
}
|
||||
if (suppEngineerWorkOrders?.isNotEmpty ?? false) {
|
||||
map['suppEngineerWorkOrders'] = suppEngineerWorkOrders?.map((e) => e.toJson())?.toList();
|
||||
}
|
||||
map['supplier'] = supplier?.toJson();
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:test_sa/models/service_request/search_work_order.dart';
|
||||
|
||||
import '../../../controllers/providers/api/status_drop_down/report/vendor_provider.dart';
|
||||
import '../../app_style/colors.dart';
|
||||
import '../../app_style/sizing.dart';
|
||||
|
||||
class AutoGeneratedVendorName extends StatefulWidget {
|
||||
final String initialValue;
|
||||
final Function(Supplier) onSearch;
|
||||
const AutoGeneratedVendorName({Key key, this.initialValue, this.onSearch}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AutoGeneratedVendorName> createState() => _AutoGeneratedVendorNameState();
|
||||
}
|
||||
|
||||
class _AutoGeneratedVendorNameState extends State<AutoGeneratedVendorName> {
|
||||
TextEditingController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = TextEditingController(text: widget.initialValue ?? "");
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant AutoGeneratedVendorName oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.initialValue != widget.initialValue) {
|
||||
_controller = TextEditingController(text: widget.initialValue ?? "");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final vendorProvider = Provider.of<VendorProvider>(context, listen: false);
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: AColors.inputFieldBackgroundColor,
|
||||
border: Border.all(
|
||||
color: const Color(0xffefefef),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(AppStyle.borderRadius * AppStyle.getScaleFactor(context)),
|
||||
// boxShadow: [
|
||||
// AppStyle.boxShadow
|
||||
// ]
|
||||
),
|
||||
child: TypeAheadField<Supplier>(
|
||||
textFieldConfiguration: TextFieldConfiguration(
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
controller: _controller,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(
|
||||
hintText: "Vendor Name",
|
||||
border: InputBorder.none,
|
||||
disabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
),
|
||||
textInputAction: TextInputAction.search,
|
||||
),
|
||||
suggestionsCallback: (vale) async {
|
||||
await vendorProvider.getVendors(_controller.text.trim());
|
||||
return vendorProvider.vendors;
|
||||
},
|
||||
itemBuilder: (context, vendor) {
|
||||
return ListTile(title: Text(vendor.suppliername));
|
||||
},
|
||||
onSuggestionSelected: (hospital) {
|
||||
widget.onSearch(hospital);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue