You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
171 lines
6.3 KiB
Dart
171 lines
6.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../../../controllers/localization/localization.dart';
|
|
import '../../../../controllers/providers/api/regular_visits_provider.dart';
|
|
import '../../../../models/subtitle.dart';
|
|
import '../../../../models/visits/visit.dart';
|
|
import '../../../app_style/colors.dart';
|
|
import '../../../app_style/sizing.dart';
|
|
import '../../../widgets/buttons/app_back_button.dart';
|
|
import '../../../widgets/buttons/app_icon_button.dart';
|
|
import '../../../widgets/requests/info_row.dart';
|
|
import '../../../widgets/visits/visit_status.dart';
|
|
import 'pantry/future_edit_pently.dart';
|
|
|
|
class VisitDetailsPage extends StatelessWidget {
|
|
static const String id = "/visit-details";
|
|
final Visit visit;
|
|
|
|
const VisitDetailsPage({Key? key, required this.visit}) : super(key: key);
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Subtitle subtitle = AppLocalization.of(context)!.subtitle!;
|
|
final regularVisitsProvider = Provider.of<RegularVisitsProvider>(context);
|
|
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
color: AColors.primaryColor,
|
|
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
child: Row(
|
|
children: [
|
|
ABackButton(),
|
|
Expanded(
|
|
child: Center(
|
|
child: Text(
|
|
subtitle.visitInformation,
|
|
style: Theme.of(context).textTheme.headline6?.copyWith(color: AColors.white, fontStyle: FontStyle.italic),
|
|
),
|
|
),
|
|
),
|
|
AIconButton(
|
|
iconData: Icons.edit,
|
|
color: AColors.white,
|
|
buttonSize: 42,
|
|
backgroundColor: AColors.green,
|
|
onPressed: () async {
|
|
Navigator.of(context).push(MaterialPageRoute(
|
|
builder: (_) => FutureEditPentry(
|
|
visit: visit,
|
|
)));
|
|
},
|
|
),
|
|
SizedBox(
|
|
width: 16,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: ListView(
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
children: [
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
// MaterialButton(
|
|
// padding: EdgeInsets.zero,
|
|
// onPressed: () {
|
|
// Navigator.of(context).push(MaterialPageRoute(
|
|
// builder: (_) => Scaffold(
|
|
// body: InteractiveViewer(
|
|
// child: Center(
|
|
// child: ImageLoader(
|
|
// url: visit.images?.first,
|
|
// boxFit: BoxFit.contain,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
// )));
|
|
// },
|
|
// child: SizedBox(
|
|
// height: 140 * AppStyle.getScaleFactor(context),
|
|
// width: MediaQuery.of(context).size.width,
|
|
// child: ImageLoader(
|
|
// url: (visit.images?.isEmpty ?? false) ? " " : visit.images?.first,
|
|
// boxFit: BoxFit.cover,
|
|
// ),
|
|
// ),
|
|
// ),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
// SizedBox(
|
|
// height: 60 * AppStyle.getScaleFactor(context),
|
|
// child: ImagesList(
|
|
// images: visit.images!,
|
|
// ),
|
|
// ),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.code,
|
|
info: visit.assetSerialNo,
|
|
),
|
|
RequestInfoRow(
|
|
title: "Asset Number",
|
|
info: visit.deviceStatusName,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.deviceSN,
|
|
info: visit.assetSerialNo,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.expectDate,
|
|
info: visit.expectedDate,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.actualDate,
|
|
info: visit.actualDate,
|
|
),
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: Text(
|
|
"${subtitle.status} : ",
|
|
style: Theme.of(context).textTheme.subtitle1?.copyWith(fontWeight: FontWeight.bold),
|
|
textScaleFactor: AppStyle.getScaleFactor(context),
|
|
),
|
|
),
|
|
VisitStatusLabel(
|
|
visit: visit,
|
|
),
|
|
],
|
|
),
|
|
Divider(
|
|
color: Theme.of(context).primaryColor,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.contactStatus,
|
|
info: visit.assignedToName,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.engineerName,
|
|
info: visit.assignedEmployeeName,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.hospital,
|
|
content: visit.assetName,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.deviceArName,
|
|
content: visit.assetName,
|
|
),
|
|
RequestInfoRow(
|
|
title: subtitle.deviceEnName,
|
|
content: visit.assetName,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|