|
|
|
|
@ -35,6 +35,7 @@ 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 '../../../../widgets/speech_to_text/speech_to_text.dart';
|
|
|
|
|
import '../../../../widgets/status/report/service_report_repair_location.dart';
|
|
|
|
|
|
|
|
|
|
class CreateServiceReport extends StatefulWidget {
|
|
|
|
|
@ -330,6 +331,54 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
const ASubTitle("Start Date"),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
ADatePicker(
|
|
|
|
|
date: _serviceReport.startDate,
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
_serviceReport.startDate = date;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
const ASubTitle("End Date"),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
ADatePicker(
|
|
|
|
|
date: _serviceReport.endDate,
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDatePicker: (date) {
|
|
|
|
|
_serviceReport.endDate = date;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
const ASubTitle("Assigned Employee"),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
@ -404,65 +453,69 @@ class _CreateServiceReportState extends State<CreateServiceReport> with TickerPr
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// ASubTitle(_subtitle.faultDescription),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: SizedBox(
|
|
|
|
|
// height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
// child: SpeechToTextButton(
|
|
|
|
|
// controller: _faultController,
|
|
|
|
|
// mini: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(height: 4,),
|
|
|
|
|
// ATextFormField(
|
|
|
|
|
// initialValue: _serviceReport?.faultDescriptionId,
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// controller: _faultController,
|
|
|
|
|
// style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
// validator: (value) =>
|
|
|
|
|
// Validator.hasValue(value)
|
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
|
// textInputType: TextInputType.multiline,
|
|
|
|
|
// onSaved: (value){
|
|
|
|
|
// _serviceReport.faultDescriptionId = value;
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// ASubTitle(_subtitle.workPreformed),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: SizedBox(
|
|
|
|
|
// height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
// child: SpeechToTextButton(
|
|
|
|
|
// controller: _workPreformedController,
|
|
|
|
|
// mini: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(height: 4,),
|
|
|
|
|
// ATextFormField(
|
|
|
|
|
// initialValue: _serviceReport?.workPreformed,
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// controller: _workPreformedController,
|
|
|
|
|
// style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
// validator: (value) =>
|
|
|
|
|
// Validator.hasValue(value)
|
|
|
|
|
// ? null : _subtitle.requiredWord,
|
|
|
|
|
// textInputType: TextInputType.multiline,
|
|
|
|
|
// onSaved: (value){
|
|
|
|
|
// _serviceReport.workPreformed = value;
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(height: 8,),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.faultDescription),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
child: SpeechToTextButton(
|
|
|
|
|
controller: _faultController,
|
|
|
|
|
mini: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.faultDescriptionId?.toString(),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
controller: _faultController,
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.faultDescriptionId = int.tryParse(value) ?? 0;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
ASubTitle(_subtitle.workPreformed),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 32 * AppStyle.getScaleFactor(context),
|
|
|
|
|
child: SpeechToTextButton(
|
|
|
|
|
controller: _workPreformedController,
|
|
|
|
|
mini: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
ATextFormField(
|
|
|
|
|
initialValue: _serviceReport?.workPreformed,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
controller: _workPreformedController,
|
|
|
|
|
style: Theme.of(context).textTheme.subtitle1,
|
|
|
|
|
validator: (value) => Validator.hasValue(value) ? null : _subtitle.requiredWord,
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
onSaved: (value) {
|
|
|
|
|
_serviceReport.workPreformed = value;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
|