diff --git a/lib/controllers/api_routes/urls.dart b/lib/controllers/api_routes/urls.dart index ff44c03e..b672ee62 100644 --- a/lib/controllers/api_routes/urls.dart +++ b/lib/controllers/api_routes/urls.dart @@ -12,6 +12,7 @@ class URLs { set host(String value) => _host = value; + // static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/Files/DownloadFile?fileName=$file"); static String getFileUrl(String file) => (file == null || file.isEmpty) ? null : (file.contains("/") ? file : "$_host/attachment/$file"); // API Routes diff --git a/lib/models/call_request_for_work_order_model.dart b/lib/models/call_request_for_work_order_model.dart index 188edce4..a6c2d5a5 100644 --- a/lib/models/call_request_for_work_order_model.dart +++ b/lib/models/call_request_for_work_order_model.dart @@ -457,12 +457,12 @@ class AssignedEmployee { class CallSiteContactPerson { int id; - Null employeeCode; + String employeeCode; String name; String telephone; String job; String email; - Null land; + String land; String contactUserId; CallSiteContactPerson({this.id, this.employeeCode, this.name, this.telephone, this.job, this.email, this.land, this.contactUserId}); diff --git a/lib/models/service_report.dart b/lib/models/service_report.dart index 275c8929..bf2f53d4 100644 --- a/lib/models/service_report.dart +++ b/lib/models/service_report.dart @@ -155,11 +155,6 @@ class ServiceReport { } Future validate() async { - print("visitDate:$visitDate"); - print("equipmentStatus:${equipmentStatus?.toMap()}"); - print("callLastSituation:${callLastSituation?.toMap()}"); - print("parts:$parts"); - print("reason:${reason?.toMap()}"); if (visitDate == null) { await Fluttertoast.showToast(msg: "Visit Date Required"); return false; diff --git a/lib/views/pages/user/requests/report/edit_service_report.dart b/lib/views/pages/user/requests/report/edit_service_report.dart index f10c6548..07619f16 100644 --- a/lib/views/pages/user/requests/report/edit_service_report.dart +++ b/lib/views/pages/user/requests/report/edit_service_report.dart @@ -185,8 +185,8 @@ class _EditServiceReportState extends State with TickerProvid width: double.infinity, padding: const EdgeInsets.all(16), margin: const EdgeInsets.symmetric(vertical: 16), - decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: [ - const BoxShadow( + decoration: BoxDecoration(color: AColors.grey, borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)), boxShadow: const [ + BoxShadow( color: AColors.grey, offset: Offset(0, -1), ) @@ -195,70 +195,70 @@ class _EditServiceReportState extends State with TickerProvid crossAxisAlignment: CrossAxisAlignment.start, children: [ // Report type and Reasons - Row( - children: [ - // Report Status - // Expanded( - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // ASubTitle(_subtitle.reportType), - // _validate && _serviceReport.type == null - // ? ASubTitle( - // _subtitle.requiredWord, - // color: Colors.red, - // ) - // : const SizedBox.shrink(), - // const SizedBox( - // height: 4, - // ), - // ServiceReportTypeMenu( - // initialValue: _serviceReport.type, - // onSelect: (status) { - // _serviceReport.type = status; - // }, - // ), - // ], - // ), - // ), - // const SizedBox( - // width: 8, - // ), - // visit date - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ASubTitle(_subtitle.visitDate), - _validate && _serviceReport.visitDate == null - ? ASubTitle( - _subtitle.requiredWord, - color: Colors.red, - ) - : const SizedBox.shrink(), - Row( - children: [ - Expanded( - child: ADatePicker( - date: _serviceReport.visitDate, - from: DateTime.now().subtract(const Duration(days: 365)), - to: DateTime.now().add(const Duration(days: 365)), - onDatePicker: (date) { - _serviceReport.visitDate = date; - setState(() {}); - }, - ), - ), - ], - ), - ], - ), - ), - ], - ), - const SizedBox( - height: 8, - ), + // Row( + // children: [ + // // Report Status + // // Expanded( + // // child: Column( + // // crossAxisAlignment: CrossAxisAlignment.start, + // // children: [ + // // ASubTitle(_subtitle.reportType), + // // _validate && _serviceReport.type == null + // // ? ASubTitle( + // // _subtitle.requiredWord, + // // color: Colors.red, + // // ) + // // : const SizedBox.shrink(), + // // const SizedBox( + // // height: 4, + // // ), + // // ServiceReportTypeMenu( + // // initialValue: _serviceReport.type, + // // onSelect: (status) { + // // _serviceReport.type = status; + // // }, + // // ), + // // ], + // // ), + // // ), + // // const SizedBox( + // // width: 8, + // // ), + // // visit date + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // ASubTitle(_subtitle.visitDate), + // _validate && _serviceReport.visitDate == null + // ? ASubTitle( + // _subtitle.requiredWord, + // color: Colors.red, + // ) + // : const SizedBox.shrink(), + // Row( + // children: [ + // Expanded( + // child: ADatePicker( + // date: _serviceReport.visitDate, + // from: DateTime.now().subtract(const Duration(days: 365)), + // to: DateTime.now().add(const Duration(days: 365)), + // onDatePicker: (date) { + // _serviceReport.visitDate = date; + // setState(() {}); + // }, + // ), + // ), + // ], + // ), + // ], + // ), + // ), + // ], + // ), + // const SizedBox( + // height: 8, + // ), // device sn Visibility( visible: widget.request.deviceSerialNumber == null, @@ -400,7 +400,7 @@ class _EditServiceReportState extends State with TickerProvid const SizedBox( height: 8, ), - ASubTitle("Return to Service"), + const ASubTitle("Return to Service"), Row( children: [ Expanded( @@ -721,7 +721,7 @@ class _EditServiceReportState extends State with TickerProvid }, ), const SizedBox(height: 8), - ASubTitle(_subtitle.workPreformed), + const ASubTitle("Solutions"), const SizedBox(height: 4), ATextFormField( initialValue: _serviceReport?.workPreformed, @@ -930,7 +930,7 @@ class _EditServiceReportState extends State with TickerProvid //const SizedBox(height: 8,), const SizedBox(height: 8), - ASubTitle("technical comment"), + const ASubTitle("Technical comment"), const SizedBox(height: 4), ATextFormField( initialValue: _serviceReport?.comment, diff --git a/lib/views/pages/user/requests/report/future_service_report.dart b/lib/views/pages/user/requests/report/future_service_report.dart index ceb23207..258a857b 100644 --- a/lib/views/pages/user/requests/report/future_service_report.dart +++ b/lib/views/pages/user/requests/report/future_service_report.dart @@ -31,26 +31,28 @@ class _FutureServiceReportState extends State { Widget build(BuildContext context) { _userProvider = Provider.of(context); _settingProvider = Provider.of(context); - Subtitle _subtitle = AppLocalization.of(context).subtitle; - ServiceRequestsProvider().getSingleServiceReport(reportId: widget.workOrder.id, user: _userProvider.user, host: _settingProvider.host, subtitle: _subtitle); + Subtitle subtitle = AppLocalization.of(context).subtitle; + ServiceRequestsProvider().getSingleServiceReport(reportId: widget.workOrder.id, user: _userProvider.user, host: _settingProvider.host, subtitle: subtitle); return Scaffold( body: FutureBuilder( - future: ServiceRequestsProvider().getSingleServiceReport(reportId: widget.workOrder.id, 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 snapshot) { - if (snapshot.hasError) + if (snapshot.hasError) { return FailedLoading( message: snapshot.error.toString(), onReload: () { setState(() {}); }, ); - if (snapshot.hasData) { + } + if (snapshot.connectionState == ConnectionState.done) { + print("object"); return EditServiceReport( report: snapshot.data, request: widget.request, ); } - return Center(child: ALoading()); + return const Center(child: ALoading()); }, ), ); diff --git a/lib/views/widgets/gas_refill/gas_refill_item.dart b/lib/views/widgets/gas_refill/gas_refill_item.dart index 724341f1..17b2f38a 100644 --- a/lib/views/widgets/gas_refill/gas_refill_item.dart +++ b/lib/views/widgets/gas_refill/gas_refill_item.dart @@ -79,7 +79,7 @@ class GasRefillItem extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text("Visit Date", style: Theme.of(context).textTheme.titleSmall.copyWith(color: onItemColor)), + Text("Expected Date", style: Theme.of(context).textTheme.titleSmall.copyWith(color: onItemColor)), Text(item.expectedDate.toIso8601String().split("T").first, style: Theme.of(context).textTheme.titleSmall.copyWith(color: onItemColor)), ], ),