|
|
|
@ -27,6 +27,7 @@ import 'package:test_sa/providers/work_order/fault_description_provider.dart';
|
|
|
|
import 'package:test_sa/providers/work_order/reason_provider.dart';
|
|
|
|
import 'package:test_sa/providers/work_order/reason_provider.dart';
|
|
|
|
import 'package:test_sa/providers/work_order/wo_frame_provider.dart';
|
|
|
|
import 'package:test_sa/providers/work_order/wo_frame_provider.dart';
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/date_picker.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/date_and_time/time_picker.dart';
|
|
|
|
import 'package:test_sa/views/widgets/equipment/pick_asset.dart';
|
|
|
|
import 'package:test_sa/views/widgets/equipment/pick_asset.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class VerifyAssetDetails extends StatefulWidget {
|
|
|
|
class VerifyAssetDetails extends StatefulWidget {
|
|
|
|
@ -141,72 +142,9 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
|
|
|
|
date: DateTime.tryParse(updateAssetModel?.returnToService ?? ""),
|
|
|
|
date: DateTime.tryParse(updateAssetModel?.returnToService ?? ""),
|
|
|
|
formatDateWithTime: true,
|
|
|
|
formatDateWithTime: true,
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
showTimePicker(
|
|
|
|
showThemedTimePicker(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
builder: (BuildContext context, Widget? child) {
|
|
|
|
|
|
|
|
return Theme(
|
|
|
|
|
|
|
|
data: Theme.of(context).copyWith(
|
|
|
|
|
|
|
|
timePickerTheme: TimePickerThemeData(
|
|
|
|
|
|
|
|
backgroundColor: AppColor.bottomSheetColor(context),
|
|
|
|
|
|
|
|
hourMinuteShape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
|
|
|
side: BorderSide(color: AppColor.borderColor(context)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
dayPeriodBorderSide: BorderSide(color: AppColor.borderColor(context)),
|
|
|
|
|
|
|
|
dayPeriodColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return AppColor.primary10;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Colors.transparent;
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dayPeriodTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dialHandColor: AppColor.primary10,
|
|
|
|
|
|
|
|
dialBackgroundColor: AppColor.scaffoldBackground(context),
|
|
|
|
|
|
|
|
hourMinuteColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return AppColor.primary10;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.scaffoldBackground(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
hourMinuteTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dialTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
entryModeIconColor: AppColor.primary10,
|
|
|
|
|
|
|
|
helpTextStyle: TextStyle(
|
|
|
|
|
|
|
|
color: AppColor.textStyleColor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textButtonTheme: TextButtonThemeData(
|
|
|
|
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
|
|
|
|
foregroundColor: AppColor.primary10,
|
|
|
|
|
|
|
|
textStyle: const TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: child!,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).then((selectedTime) {
|
|
|
|
).then((selectedTime) {
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
if (selectedTime != null) {
|
|
|
|
if (selectedTime != null) {
|
|
|
|
@ -321,72 +259,9 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
|
|
|
|
date: DateTime.tryParse(updateAssetModel?.edd ?? ""),
|
|
|
|
date: DateTime.tryParse(updateAssetModel?.edd ?? ""),
|
|
|
|
formatDateWithTime: true,
|
|
|
|
formatDateWithTime: true,
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
showTimePicker(
|
|
|
|
showThemedTimePicker(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
builder: (BuildContext context, Widget? child) {
|
|
|
|
|
|
|
|
return Theme(
|
|
|
|
|
|
|
|
data: Theme.of(context).copyWith(
|
|
|
|
|
|
|
|
timePickerTheme: TimePickerThemeData(
|
|
|
|
|
|
|
|
backgroundColor: AppColor.bottomSheetColor(context),
|
|
|
|
|
|
|
|
hourMinuteShape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
|
|
|
side: BorderSide(color: AppColor.borderColor(context)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
dayPeriodBorderSide: BorderSide(color: AppColor.borderColor(context)),
|
|
|
|
|
|
|
|
dayPeriodColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return AppColor.primary10;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Colors.transparent;
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dayPeriodTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dialHandColor: AppColor.primary10,
|
|
|
|
|
|
|
|
dialBackgroundColor: AppColor.scaffoldBackground(context),
|
|
|
|
|
|
|
|
hourMinuteColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return AppColor.primary10;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.scaffoldBackground(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
hourMinuteTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
dialTextColor: WidgetStateColor.resolveWith((states) {
|
|
|
|
|
|
|
|
if (states.contains(WidgetState.selected)) {
|
|
|
|
|
|
|
|
return Colors.white;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return AppColor.textStyleColor(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
entryModeIconColor: AppColor.primary10,
|
|
|
|
|
|
|
|
helpTextStyle: TextStyle(
|
|
|
|
|
|
|
|
color: AppColor.textStyleColor(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textButtonTheme: TextButtonThemeData(
|
|
|
|
|
|
|
|
style: TextButton.styleFrom(
|
|
|
|
|
|
|
|
foregroundColor: AppColor.primary10,
|
|
|
|
|
|
|
|
textStyle: const TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: child!,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).then((selectedTime) {
|
|
|
|
).then((selectedTime) {
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
if (selectedTime != null) {
|
|
|
|
if (selectedTime != null) {
|
|
|
|
|