|
|
|
|
@ -1,47 +1,40 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:test_sa/controllers/http_status_manger/http_status_manger.dart';
|
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/status_drop_down/report/service_report_last_calls_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/service_requests_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/validator/validator.dart';
|
|
|
|
|
import 'package:test_sa/models/device/device.dart';
|
|
|
|
|
import 'package:test_sa/models/part.dart';
|
|
|
|
|
import 'package:test_sa/models/service_report.dart';
|
|
|
|
|
import 'package:test_sa/models/service_request/service_request.dart';
|
|
|
|
|
import 'package:test_sa/models/lookup.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/widgets/app_text_form_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/equipment/auto_complete_devices_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/images/mini_one_image_picker.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/loading_manager.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/parts/auto_complete_parts_field.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/parts/part_item.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/speech_to_text/speech_to_text.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_last_call.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_reasons.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_status.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_report_type.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/status/report/service_status.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/timer/app_timer.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/rendering.dart';
|
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../../../../controllers/localization/localization.dart';
|
|
|
|
|
import '../../../../../controllers/providers/api/service_requests_provider.dart';
|
|
|
|
|
import '../../../../../controllers/providers/api/status_drop_down/report/service_report_last_calls_provider.dart';
|
|
|
|
|
import '../../../../../controllers/providers/api/user_provider.dart';
|
|
|
|
|
import '../../../../../controllers/providers/settings/setting_provider.dart';
|
|
|
|
|
import '../../../../../controllers/validator/validator.dart';
|
|
|
|
|
import '../../../../../models/device/device.dart';
|
|
|
|
|
import '../../../../../models/lookup.dart';
|
|
|
|
|
import '../../../../../models/service_report.dart';
|
|
|
|
|
import '../../../../../models/service_request/service_request.dart';
|
|
|
|
|
import '../../../../../models/subtitle.dart';
|
|
|
|
|
import '../../../../app_style/colors.dart';
|
|
|
|
|
import '../../../../app_style/sizing.dart';
|
|
|
|
|
import '../../../../widgets/app_text_form_field.dart';
|
|
|
|
|
import '../../../../widgets/date_and_time/date_picker.dart';
|
|
|
|
|
import '../../../../widgets/equipment/auto_complete_devices_field.dart';
|
|
|
|
|
import '../../../../widgets/images/mini_one_image_picker.dart';
|
|
|
|
|
import '../../../../widgets/loaders/loading_manager.dart';
|
|
|
|
|
import '../../../../widgets/speech_to_text/speech_to_text.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_last_call.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_reasons.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_status.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_status.dart';
|
|
|
|
|
import '../../../../widgets/titles/app_sub_title.dart';
|
|
|
|
|
class CreateServiceReport extends StatefulWidget {
|
|
|
|
|
static final String id = "/create-service-report";
|
|
|
|
|
final ServiceRequest request ;
|
|
|
|
|
final ServiceRequest? request ;
|
|
|
|
|
|
|
|
|
|
const CreateServiceReport({Key key, this.request}) : super(key: key);
|
|
|
|
|
const CreateServiceReport({Key? key, this.request}) : super(key: key);
|
|
|
|
|
@override
|
|
|
|
|
_CreateServiceReportState createState() => _CreateServiceReportState();
|
|
|
|
|
}
|
|
|
|
|
@ -49,16 +42,16 @@ class CreateServiceReport extends StatefulWidget {
|
|
|
|
|
class _CreateServiceReportState extends State<CreateServiceReport> with TickerProviderStateMixin{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserProvider _userProvider;
|
|
|
|
|
SettingProvider _settingProvider;
|
|
|
|
|
ServiceRequestsProvider _serviceRequestsProvider;
|
|
|
|
|
UserProvider? _userProvider;
|
|
|
|
|
SettingProvider? _settingProvider;
|
|
|
|
|
ServiceRequestsProvider? _serviceRequestsProvider;
|
|
|
|
|
|
|
|
|
|
bool _validate = false;
|
|
|
|
|
ServiceReport _serviceReport;
|
|
|
|
|
ServiceReport? _serviceReport;
|
|
|
|
|
bool _isLoading = false;
|
|
|
|
|
|
|
|
|
|
Subtitle _subtitle;
|
|
|
|
|
File _image;
|
|
|
|
|
Subtitle? _subtitle;
|
|
|
|
|
File? _image;
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
TextEditingController _faultController = TextEditingController();
|
|
|
|
|
@ -70,8 +63,8 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
visitDate: DateTime.now(),
|
|
|
|
|
type: const Lookup(id: 2),
|
|
|
|
|
device: Device(
|
|
|
|
|
id: widget.request.deviceId,
|
|
|
|
|
serialNumber: widget.request.deviceSerialNumber,
|
|
|
|
|
id: widget.request?.deviceId,
|
|
|
|
|
serialNumber: widget.request?.deviceSerialNumber,
|
|
|
|
|
),
|
|
|
|
|
parts: []
|
|
|
|
|
);
|
|
|
|
|
@ -89,7 +82,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
_userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
_settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
|
_serviceRequestsProvider = Provider.of<ServiceRequestsProvider>(context);
|
|
|
|
|
_subtitle = AppLocalization.of(context).subtitle;
|
|
|
|
|
_subtitle = AppLocalization.of(context)?.subtitle;
|
|
|
|
|
return Scaffold(
|
|
|
|
|
key: _scaffoldKey,
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
@ -110,8 +103,8 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
_subtitle.newServiceReport,
|
|
|
|
|
style: Theme.of(context).textTheme.headline5.copyWith(
|
|
|
|
|
_subtitle?.newServiceReport??"",
|
|
|
|
|
style: Theme.of(context).textTheme.headline5?.copyWith(
|
|
|
|
|
color: AColors.cyan,
|
|
|
|
|
fontSize: 28,
|
|
|
|
|
fontWeight: FontWeight.bold
|
|
|
|
|
@ -139,12 +132,12 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
Wrap(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle("${_subtitle.callId}: ${widget.request.requestCode}",font: 14,),
|
|
|
|
|
widget.request.deviceSerialNumber == null ? const SizedBox():
|
|
|
|
|
ASubTitle("${_subtitle.deviceSN}: ${widget.request.deviceSerialNumber}",font: 14,),
|
|
|
|
|
ASubTitle("${_subtitle?.callId}: ${widget.request?.requestCode}",font: 14,),
|
|
|
|
|
widget.request?.deviceSerialNumber == null ? const SizedBox():
|
|
|
|
|
ASubTitle("${_subtitle?.deviceSN}: ${widget.request?.deviceSerialNumber}",font: 14,),
|
|
|
|
|
Text(
|
|
|
|
|
"${_subtitle.customer}: ${widget.request.hospitalName}",
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1.copyWith(
|
|
|
|
|
"${_subtitle?.customer}: ${widget.request?.hospitalName}",
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1?.copyWith(
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
@ -183,19 +176,19 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.visitDate),
|
|
|
|
|
_validate && _serviceReport.visitDate == null ?
|
|
|
|
|
ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
ASubTitle(_subtitle?.visitDate??""),
|
|
|
|
|
_validate && _serviceReport?.visitDate == null ?
|
|
|
|
|
ASubTitle(_subtitle?.requiredWord??"",color: Colors.red,):
|
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ADatePicker(
|
|
|
|
|
date: _serviceReport.visitDate,
|
|
|
|
|
date: _serviceReport?.visitDate??DateTime.now(),
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDatePicker: (date){
|
|
|
|
|
_serviceReport.visitDate = date;
|
|
|
|
|
_serviceReport?.visitDate = date;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -211,19 +204,19 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
// device sn
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: widget.request.deviceSerialNumber == null,
|
|
|
|
|
visible: widget.request?.deviceSerialNumber == null,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.deviceSN),
|
|
|
|
|
_validate && _serviceReport.device?.id == null ?
|
|
|
|
|
ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
ASubTitle(_subtitle?.deviceSN??""),
|
|
|
|
|
_validate && _serviceReport?.device?.id == null ?
|
|
|
|
|
ASubTitle(_subtitle?.requiredWord??"",color: Colors.red,):
|
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
|
AutoCompleteDeviceField(
|
|
|
|
|
hospitalId: widget.request.hospitalId,
|
|
|
|
|
initialValue: _serviceReport.device,
|
|
|
|
|
hospitalId: widget.request?.hospitalId??"",
|
|
|
|
|
initialValue: _serviceReport?.device,
|
|
|
|
|
onPick: (id){
|
|
|
|
|
_serviceReport.device.id = id;
|
|
|
|
|
_serviceReport?.device?.id = id;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
@ -231,15 +224,15 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
ASubTitle(_subtitle.serviceType),
|
|
|
|
|
_validate && _serviceReport.serviceType == null ?
|
|
|
|
|
ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
ASubTitle(_subtitle?.serviceType??""),
|
|
|
|
|
_validate && _serviceReport?.serviceType == null ?
|
|
|
|
|
ASubTitle(_subtitle?.requiredWord??"",color: Colors.red,):
|
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ServiceStatusMenu(
|
|
|
|
|
initialValue: _serviceReport.serviceType,
|
|
|
|
|
initialValue: _serviceReport?.serviceType,
|
|
|
|
|
onSelect: (status){
|
|
|
|
|
_serviceReport.serviceType = status;
|
|
|
|
|
_serviceReport?.serviceType = status;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
@ -251,15 +244,15 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.reportStatus),
|
|
|
|
|
_validate && _serviceReport.status == null ?
|
|
|
|
|
ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
ASubTitle(_subtitle?.reportStatus??""),
|
|
|
|
|
_validate && _serviceReport?.status == null ?
|
|
|
|
|
ASubTitle(_subtitle?.requiredWord??"",color: Colors.red,):
|
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ServiceReportStatusMenu(
|
|
|
|
|
report: _serviceReport,
|
|
|
|
|
onSelect: (status){
|
|
|
|
|
_serviceReport.status = status;
|
|
|
|
|
_serviceReport?.status = status;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -274,20 +267,20 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
|
|
ASubTitle(_subtitle.callLastSituation),
|
|
|
|
|
_validate && _serviceReport.callLastSituation == null ?
|
|
|
|
|
ASubTitle(_subtitle.requiredWord,color: Colors.red,):
|
|
|
|
|
ASubTitle(_subtitle?.callLastSituation??""),
|
|
|
|
|
_validate && _serviceReport?.callLastSituation == null ?
|
|
|
|
|
ASubTitle(_subtitle?.requiredWord??"",color: Colors.red,):
|
|
|
|
|
const SizedBox.shrink(),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ServiceReportLastCallsMenu(
|
|
|
|
|
report: _serviceReport,
|
|
|
|
|
onSelect: (status){
|
|
|
|
|
if(status?.id == 12
|
|
|
|
|
|| _serviceReport.callLastSituation?.id == 12){
|
|
|
|
|
_serviceReport.callLastSituation = status;
|
|
|
|
|
|| _serviceReport?.callLastSituation?.id == 12){
|
|
|
|
|
_serviceReport?.callLastSituation = status;
|
|
|
|
|
setState(() {});
|
|
|
|
|
} else {
|
|
|
|
|
_serviceReport.callLastSituation = status;
|
|
|
|
|
_serviceReport?.callLastSituation = status;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -298,25 +291,25 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
// invoice number & code
|
|
|
|
|
_serviceReport.callLastSituation?.id != 12 ? const SizedBox.shrink():
|
|
|
|
|
_serviceReport?.callLastSituation?.id != 12 ? const SizedBox.shrink():
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceNumber),
|
|
|
|
|
ASubTitle(_subtitle?.invoiceNumber??""),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceNumber,
|
|
|
|
|
initialValue: _serviceReport?.invoiceNumber??"",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) =>
|
|
|
|
|
Validator.hasValue(value)
|
|
|
|
|
? null : _subtitle.requiredWord,
|
|
|
|
|
? null : _subtitle?.requiredWord,
|
|
|
|
|
textInputType: TextInputType.number,
|
|
|
|
|
onSaved: (value){
|
|
|
|
|
_serviceReport.invoiceNumber = value;
|
|
|
|
|
_serviceReport?.invoiceNumber = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -327,18 +320,18 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.invoiceCode),
|
|
|
|
|
ASubTitle(_subtitle?.invoiceCode??""),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.invoiceCode,
|
|
|
|
|
initialValue: _serviceReport?.invoiceCode??"",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) =>
|
|
|
|
|
Validator.hasValue(value)
|
|
|
|
|
? null : _subtitle.requiredWord,
|
|
|
|
|
? null : _subtitle?.requiredWord,
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
onSaved: (value){
|
|
|
|
|
_serviceReport.invoiceCode = value;
|
|
|
|
|
_serviceReport?.invoiceCode = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -350,7 +343,7 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.faultDescription),
|
|
|
|
|
ASubTitle(_subtitle?.faultDescription??""),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
@ -364,22 +357,22 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.faultDescription,
|
|
|
|
|
initialValue: _serviceReport?.faultDescription??"",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
controller: _faultController,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) =>
|
|
|
|
|
Validator.hasValue(value)
|
|
|
|
|
? null : _subtitle.requiredWord,
|
|
|
|
|
? null : _subtitle?.requiredWord,
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
onSaved: (value){
|
|
|
|
|
_serviceReport.faultDescription = value;
|
|
|
|
|
_serviceReport?.faultDescription = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
|
ASubTitle(_subtitle?.workPreformed??""),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
@ -393,16 +386,16 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.workPreformed,
|
|
|
|
|
initialValue: _serviceReport?.workPreformed??"",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
controller: _workPreformedController,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) =>
|
|
|
|
|
Validator.hasValue(value)
|
|
|
|
|
? null : _subtitle.requiredWord,
|
|
|
|
|
? null : _subtitle?.requiredWord,
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
onSaved: (value){
|
|
|
|
|
_serviceReport.workPreformed = value;
|
|
|
|
|
_serviceReport?.workPreformed = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8,),
|
|
|
|
|
@ -415,12 +408,12 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.reasons),
|
|
|
|
|
ASubTitle(_subtitle?.reasons??""),
|
|
|
|
|
const SizedBox(height: 4,),
|
|
|
|
|
ServiceReportReasonsMenu(
|
|
|
|
|
initialValue: _serviceReport.reason,
|
|
|
|
|
initialValue: _serviceReport?.reason,
|
|
|
|
|
onSelect: (status){
|
|
|
|
|
_serviceReport.reason = status;
|
|
|
|
|
_serviceReport?.reason = status;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -431,13 +424,13 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.attachImage),
|
|
|
|
|
ASubTitle(_subtitle?.attachImage??""),
|
|
|
|
|
AMiniOneImagePicker(
|
|
|
|
|
//error: _validate && _serviceReport.image == null,
|
|
|
|
|
image: _image,
|
|
|
|
|
onPick: (image){
|
|
|
|
|
_image =image;
|
|
|
|
|
_serviceReport.image = base64Encode(image.readAsBytesSync());
|
|
|
|
|
_serviceReport?.image = base64Encode(image.readAsBytesSync());
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|