Enhancements

main_design2.0
zaid_daoud 2 years ago
parent 6caab58171
commit 66100c36a4

@ -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

@ -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});

@ -155,11 +155,6 @@ class ServiceReport {
}
Future<bool> 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;

@ -185,8 +185,8 @@ class _EditServiceReportState extends State<EditServiceReport> 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<EditServiceReport> 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<EditServiceReport> 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<EditServiceReport> 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<EditServiceReport> 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,

@ -31,26 +31,28 @@ class _FutureServiceReportState extends State<FutureServiceReport> {
Widget build(BuildContext context) {
_userProvider = Provider.of<UserProvider>(context);
_settingProvider = Provider.of<SettingProvider>(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<ServiceReport>(
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<ServiceReport> 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());
},
),
);

@ -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)),
],
),

Loading…
Cancel
Save