Merge remote-tracking branch 'origin/main_design2.0' into main_design2.0
# Conflicts: # lib/views/widgets/pentry/pentry_ppm_check_list_form.dartmain_design2.0
commit
258fb2c333
@ -0,0 +1,35 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
import 'package:test_sa/models/lookup.dart';
|
||||||
|
import 'package:test_sa/providers/loading_list_notifier.dart';
|
||||||
|
|
||||||
|
import '../../../controllers/api_routes/api_manager.dart';
|
||||||
|
import '../../../controllers/api_routes/urls.dart';
|
||||||
|
|
||||||
|
class PentryTaskStatusProvider extends LoadingListNotifier<Lookup> {
|
||||||
|
@override
|
||||||
|
Future getDate() async {
|
||||||
|
if (loading ?? false) return -2;
|
||||||
|
loading = true;
|
||||||
|
notifyListeners();
|
||||||
|
Response response;
|
||||||
|
try {
|
||||||
|
response = await ApiManager.instance.get(URLs.getPentryTaskStatus);
|
||||||
|
} catch (error) {
|
||||||
|
loading = false;
|
||||||
|
stateCode = -1;
|
||||||
|
notifyListeners();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
stateCode = response.statusCode;
|
||||||
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
||||||
|
// client's request was successfully received
|
||||||
|
List listJson = json.decode(response.body)["data"];
|
||||||
|
items = listJson.map((department) => Lookup.fromJson(department)).toList();
|
||||||
|
}
|
||||||
|
loading = false;
|
||||||
|
notifyListeners();
|
||||||
|
return response.statusCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
import 'package:test_sa/models/lookup.dart';
|
||||||
|
|
||||||
|
import '../../controllers/api_routes/api_manager.dart';
|
||||||
|
import '../../controllers/api_routes/urls.dart';
|
||||||
|
import 'loading_list_notifier.dart';
|
||||||
|
|
||||||
|
class PPMDeviceStatusProvider extends LoadingListNotifier<Lookup> {
|
||||||
|
@override
|
||||||
|
Future getDate() async {
|
||||||
|
if (loading ?? false) return -2;
|
||||||
|
loading = true;
|
||||||
|
notifyListeners();
|
||||||
|
Response response;
|
||||||
|
try {
|
||||||
|
response = await ApiManager.instance.get(URLs.getPentryStatus);
|
||||||
|
} catch (error) {
|
||||||
|
loading = false;
|
||||||
|
stateCode = -1;
|
||||||
|
notifyListeners();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
stateCode = response.statusCode;
|
||||||
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
||||||
|
// client's request was successfully received
|
||||||
|
List listJson = json.decode(response.body)["data"];
|
||||||
|
items = listJson.map((department) => Lookup.fromJson(department)).toList();
|
||||||
|
}
|
||||||
|
loading = false;
|
||||||
|
notifyListeners();
|
||||||
|
return response.statusCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:http/http.dart';
|
||||||
|
import 'package:test_sa/models/lookup.dart';
|
||||||
|
|
||||||
|
import '../../controllers/api_routes/api_manager.dart';
|
||||||
|
import '../../controllers/api_routes/urls.dart';
|
||||||
|
import 'loading_list_notifier.dart';
|
||||||
|
|
||||||
|
class PPMVisitStatusProvider extends LoadingListNotifier<Lookup> {
|
||||||
|
@override
|
||||||
|
Future getDate() async {
|
||||||
|
if (loading ?? false) return -2;
|
||||||
|
loading = true;
|
||||||
|
notifyListeners();
|
||||||
|
Response response;
|
||||||
|
try {
|
||||||
|
response = await ApiManager.instance.get(URLs.getPentryVisitStatus);
|
||||||
|
} catch (error) {
|
||||||
|
loading = false;
|
||||||
|
stateCode = -1;
|
||||||
|
notifyListeners();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
stateCode = response.statusCode;
|
||||||
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
||||||
|
// client's request was successfully received
|
||||||
|
List listJson = json.decode(response.body)["data"];
|
||||||
|
items = listJson.map((department) => Lookup.fromJson(department)).toList();
|
||||||
|
}
|
||||||
|
loading = false;
|
||||||
|
notifyListeners();
|
||||||
|
return response.statusCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,209 +0,0 @@
|
|||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
||||||
import 'package:test_sa/extensions/context_extension.dart';
|
|
||||||
import 'package:test_sa/models/pantry/pentry.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/date_and_time/date_picker.dart';
|
|
||||||
import 'package:test_sa/views/widgets/e_signature/e_signature.dart';
|
|
||||||
import 'package:test_sa/views/widgets/status/pentry/pentry_visit_status_mune.dart';
|
|
||||||
import 'package:test_sa/views/widgets/timer/app_timer.dart';
|
|
||||||
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
|
|
||||||
import '../images/multi_image_picker.dart';
|
|
||||||
import '../status/pentry/pentry_status_mune.dart';
|
|
||||||
|
|
||||||
class PentryInfoForm extends StatefulWidget {
|
|
||||||
final Pentry model;
|
|
||||||
final bool enableValidate;
|
|
||||||
|
|
||||||
const PentryInfoForm({
|
|
||||||
Key key,
|
|
||||||
this.model,
|
|
||||||
this.enableValidate,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<PentryInfoForm> createState() => _PentryInfoFormState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _PentryInfoFormState extends State<PentryInfoForm> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
widget.model?.files ??= [];
|
|
||||||
|
|
||||||
final userProvider = Provider.of<UserProvider>(context);
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 12 * AppStyle.getScaleFactor(context), left: 12 * AppStyle.getScaleFactor(context), right: 12 * AppStyle.getScaleFactor(context), bottom: 80 * AppStyle.getScaleFactor(context)),
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("PPM Visit Status"),
|
|
||||||
if (widget.enableValidate && widget.model.ppmVisitStatus == null)
|
|
||||||
ASubTitle(
|
|
||||||
context.translation.requiredWord,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
PentryVisitsStatusMenu(
|
|
||||||
initialValue: widget.model.ppmVisitStatus,
|
|
||||||
onSelect: (status) {
|
|
||||||
if (status != null) {
|
|
||||||
widget.model.ppmVisitStatus = status;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Timer"),
|
|
||||||
if (widget.enableValidate && widget.model?.timer?.endAt == null)
|
|
||||||
ASubTitle(
|
|
||||||
context.translation.requiredWord,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
AppTimer(
|
|
||||||
timer: widget.model.timer,
|
|
||||||
enabled: widget.model.timer.endAt == null,
|
|
||||||
onChange: (timer) async {
|
|
||||||
widget.model.timer = timer;
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Status"),
|
|
||||||
if (widget.enableValidate && widget.model.status == null)
|
|
||||||
ASubTitle(
|
|
||||||
context.translation.requiredWord,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
PentryStatusMenu(
|
|
||||||
initialValue: widget.model.status,
|
|
||||||
onSelect: (status) {
|
|
||||||
widget.model.status = status;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Actual Visit Date"),
|
|
||||||
if (widget.enableValidate && widget.model.actualVisitDate == null)
|
|
||||||
ASubTitle(
|
|
||||||
context.translation.requiredWord,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ADatePicker(
|
|
||||||
date: widget.model.actualVisitDate,
|
|
||||||
from: DateTime.now().subtract(const Duration(days: 30)),
|
|
||||||
onDatePicker: (date) {
|
|
||||||
if (date == null) return;
|
|
||||||
widget.model.actualVisitDate = date;
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Expected Visit Date"),
|
|
||||||
if (widget.enableValidate && widget.model.expectedVisitDate == null)
|
|
||||||
ASubTitle(
|
|
||||||
context.translation.requiredWord,
|
|
||||||
color: Colors.red,
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ADatePicker(
|
|
||||||
date: widget.model.expectedVisitDate,
|
|
||||||
from: DateTime.now().subtract(const Duration(days: 30)),
|
|
||||||
onDatePicker: (date) {
|
|
||||||
if (date == null) return;
|
|
||||||
widget.model.expectedVisitDate = date;
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Traveling Hours"),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ATextFormField(
|
|
||||||
initialValue: (widget.model.travelingHours ?? "").toString(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: Theme.of(context).textTheme.titleMedium,
|
|
||||||
textInputType: TextInputType.number,
|
|
||||||
onChange: (value) {
|
|
||||||
widget.model.travelingHours = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
|
||||||
MultiFilesPicker(label: "PPM Attachments", files: widget.model.files),
|
|
||||||
// AMiniOneFilePicker(
|
|
||||||
// //error: _validate && _serviceReport.image == null,
|
|
||||||
// file: widget.model.file,
|
|
||||||
// onPick: (file) {
|
|
||||||
// widget.model.file = file;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Nurse Signature"),
|
|
||||||
ESignature(
|
|
||||||
oldSignature: widget.model.signatureNurse,
|
|
||||||
newSignature: widget.model.localNurseSignature,
|
|
||||||
onChange: (signature) {
|
|
||||||
if (signature == null || signature.isEmpty) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
widget.model.localNurseSignature = signature;
|
|
||||||
widget.model.signatureNurse = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Engineer Signature"),
|
|
||||||
ESignature(
|
|
||||||
oldSignature: widget.model.signatureEngineer,
|
|
||||||
newSignature: widget.model.localEngineerSignature,
|
|
||||||
onChange: (signature) {
|
|
||||||
if (signature == null || signature.isEmpty) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
widget.model.localEngineerSignature = signature;
|
|
||||||
widget.model.signatureEngineer = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,135 +1,49 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:test_sa/controllers/localization/localization.dart';
|
|
||||||
import 'package:test_sa/extensions/context_extension.dart';
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/extensions/text_extensions.dart';
|
||||||
import 'package:test_sa/models/pantry/ppm_check_list.dart';
|
import 'package:test_sa/models/pantry/ppm_check_list.dart';
|
||||||
import 'package:test_sa/views/app_style/sizing.dart';
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
||||||
import 'package:test_sa/views/widgets/app_text_form_field.dart';
|
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
||||||
import 'package:test_sa/views/widgets/buttons/app_button.dart';
|
|
||||||
import 'package:test_sa/views/widgets/buttons/app_small_button.dart';
|
|
||||||
import 'package:test_sa/views/widgets/status/pentry/pentry_task_status_mune.dart';
|
|
||||||
import 'package:test_sa/views/widgets/titles/app_sub_title.dart';
|
|
||||||
|
|
||||||
class PentryPPMCheckListForm extends StatefulWidget {
|
class PentryPMChecklistForm extends StatefulWidget {
|
||||||
final List<PPMCheckList> models;
|
final List<PPMCheckList> models;
|
||||||
final bool enableValidate;
|
final bool enableValidate;
|
||||||
|
|
||||||
const PentryPPMCheckListForm({
|
const PentryPMChecklistForm({Key key, this.models, this.enableValidate}) : super(key: key);
|
||||||
Key key,
|
|
||||||
this.models,
|
|
||||||
this.enableValidate,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PentryPPMCheckListForm> createState() => _PentryPPMCheckListFormState();
|
State<PentryPMChecklistForm> createState() => _PentryPMChecklistFormState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _PentryPPMCheckListFormState extends State<PentryPPMCheckListForm> {
|
class _PentryPMChecklistFormState extends State<PentryPMChecklistForm> {
|
||||||
|
PPMCheckList item = PPMCheckList();
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(top: 16.toScreenHeight),
|
||||||
top: 12 * AppStyle.getScaleFactor(context), left: 12 * AppStyle.getScaleFactor(context), right: 12 * AppStyle.getScaleFactor(context), bottom: 80 * AppStyle.getScaleFactor(context)),
|
itemCount: widget.models.length,
|
||||||
itemCount: widget.models.length + 1,
|
shrinkWrap: true,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == widget.models.length) {
|
final model = widget.models[index];
|
||||||
return AButton(
|
return Card(
|
||||||
text: context.translation.add,
|
child: ExpansionTile(
|
||||||
onPressed: () {
|
shape: const Border(),
|
||||||
widget.models.add(PPMCheckList());
|
title: (model.title ?? "").heading5(context),
|
||||||
setState(() {});
|
subtitle: "Status ${model.status?.name}".bodyText(context),
|
||||||
},
|
initiallyExpanded: index == 0,
|
||||||
);
|
iconColor: AppColor.neutral50,
|
||||||
}
|
collapsedIconColor: AppColor.neutral50,
|
||||||
final model = widget.models[index];
|
childrenPadding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
|
||||||
return ListView(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: const ClampingScrollPhysics(),
|
|
||||||
children: [
|
children: [
|
||||||
Row(
|
AppTextFormField(labelText: "Measured Value", initialValue: model.measuredValue, enable: false),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
8.height,
|
||||||
children: [
|
AppTextFormField(labelText: context.translation.comment, initialValue: model.comment, enable: false),
|
||||||
ASubTitle("#${index + 1}"),
|
8.height,
|
||||||
if (index != 0)
|
|
||||||
ASmallButton(
|
|
||||||
color: Theme.of(context).colorScheme.error,
|
|
||||||
text: context.translation.delete,
|
|
||||||
onPressed: () {
|
|
||||||
widget.models.remove(model);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Task"),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ATextFormField(
|
|
||||||
initialValue: (model.title?.trim() ?? "").toString(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
textInputType: TextInputType.text,
|
|
||||||
onChange: (value) {
|
|
||||||
model.title = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
ASubTitle(context.translation.status),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
PentryTaskStatusMenu(
|
|
||||||
initialValue: model.status,
|
|
||||||
onSelect: (status) {
|
|
||||||
model.status = status;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Comment"),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ATextFormField(
|
|
||||||
initialValue: (model.comment ?? "").toString(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
textInputType: TextInputType.text,
|
|
||||||
onChange: (value) {
|
|
||||||
model.comment = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
const ASubTitle("Measured Value"),
|
|
||||||
const SizedBox(
|
|
||||||
height: 4,
|
|
||||||
),
|
|
||||||
ATextFormField(
|
|
||||||
initialValue: (model.measuredValue ?? "").toString(),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: Theme.of(context).textTheme.subtitle1,
|
|
||||||
textInputType: TextInputType.text,
|
|
||||||
onChange: (value) {
|
|
||||||
model.measuredValue = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
color: Theme.of(context).textTheme.titleMedium.color,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
),
|
||||||
});
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,147 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:test_sa/extensions/context_extension.dart';
|
||||||
|
import 'package:test_sa/extensions/int_extensions.dart';
|
||||||
|
import 'package:test_sa/models/lookup.dart';
|
||||||
|
import 'package:test_sa/models/pantry/pentry.dart';
|
||||||
|
import 'package:test_sa/new_views/common_widgets/single_item_drop_down_menu.dart';
|
||||||
|
import 'package:test_sa/providers/ppm_device_status_provider.dart';
|
||||||
|
import 'package:test_sa/providers/ppm_visit_status_provider.dart';
|
||||||
|
import 'package:test_sa/views/widgets/e_signature/e_signature.dart';
|
||||||
|
import 'package:test_sa/views/widgets/timer/app_timer.dart';
|
||||||
|
|
||||||
|
import '../date_and_time/date_picker.dart';
|
||||||
|
import '../images/multi_image_picker.dart';
|
||||||
|
|
||||||
|
class PentryTBSForm extends StatefulWidget {
|
||||||
|
final Pentry model;
|
||||||
|
final bool enableValidate;
|
||||||
|
|
||||||
|
const PentryTBSForm({
|
||||||
|
Key key,
|
||||||
|
this.model,
|
||||||
|
this.enableValidate,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PentryTBSForm> createState() => _PentryTBSFormState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PentryTBSFormState extends State<PentryTBSForm> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
widget.model?.files ??= [];
|
||||||
|
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
8.height,
|
||||||
|
SingleItemDropDownMenu<Lookup, PPMVisitStatusProvider>(
|
||||||
|
context: context,
|
||||||
|
initialValue: widget.model.ppmVisitStatus,
|
||||||
|
title: "PPM Visit Status",
|
||||||
|
onSelect: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
widget.model.ppmVisitStatus = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
AppTimer(
|
||||||
|
timer: widget.model.timer,
|
||||||
|
enabled: widget.model.timer.endAt == null,
|
||||||
|
onChange: (timer) async {
|
||||||
|
widget.model.timer = timer;
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
SingleItemDropDownMenu<Lookup, PPMDeviceStatusProvider>(
|
||||||
|
context: context,
|
||||||
|
initialValue: widget.model.status,
|
||||||
|
title: "Device Status",
|
||||||
|
onSelect: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
widget.model.status = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
ADatePicker(
|
||||||
|
label: "Actual Visit Date",
|
||||||
|
date: widget.model.actualVisitDate,
|
||||||
|
from: DateTime.now().subtract(const Duration(days: 30)),
|
||||||
|
onDatePicker: (date) {
|
||||||
|
if (date == null) return;
|
||||||
|
widget.model.actualVisitDate = date;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
ADatePicker(
|
||||||
|
label: "Expected Visit Date",
|
||||||
|
date: widget.model.expectedVisitDate,
|
||||||
|
from: DateTime.now().subtract(const Duration(days: 30)),
|
||||||
|
onDatePicker: (date) {
|
||||||
|
if (date == null) return;
|
||||||
|
widget.model.expectedVisitDate = date;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
// const ASubTitle("Traveling Hours"),
|
||||||
|
// const SizedBox(
|
||||||
|
// height: 4,
|
||||||
|
// ),
|
||||||
|
// ATextFormField(
|
||||||
|
// initialValue: (widget.model.travelingHours ?? "").toString(),
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
// textInputType: TextInputType.number,
|
||||||
|
// onChange: (value) {
|
||||||
|
// widget.model.travelingHours = value;
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
8.height,
|
||||||
|
MultiFilesPicker(label: "Attach Image", files: widget.model.files),
|
||||||
|
// AMiniOneFilePicker(
|
||||||
|
// //error: _validate && _serviceReport.image == null,
|
||||||
|
// file: widget.model.file,
|
||||||
|
// onPick: (file) {
|
||||||
|
// widget.model.file = file;
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
8.height,
|
||||||
|
ESignature(
|
||||||
|
title: "Nurse Signature",
|
||||||
|
oldSignature: widget.model.signatureNurse,
|
||||||
|
newSignature: widget.model.localNurseSignature,
|
||||||
|
onChange: (signature) {
|
||||||
|
// if (signature == null || signature.isEmpty) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
widget.model.localNurseSignature = signature;
|
||||||
|
widget.model.signatureNurse = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
ESignature(
|
||||||
|
title: context.translation.engSign,
|
||||||
|
oldSignature: widget.model.signatureEngineer,
|
||||||
|
newSignature: widget.model.localEngineerSignature,
|
||||||
|
onChange: (signature) {
|
||||||
|
// if (signature == null || signature.isEmpty) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
widget.model.localEngineerSignature = signature;
|
||||||
|
widget.model.signatureEngineer = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
||||||
|
},
|
||||||
|
),
|
||||||
|
8.height,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue