|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/localization/localization.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/subtitle.dart';
|
|
|
|
|
import 'package:test_sa/models/visits/visit.dart';
|
|
|
|
|
import 'package:test_sa/views/app_style/colors.dart';
|
|
|
|
|
@ -8,6 +9,7 @@ import 'package:test_sa/views/app_style/sizing.dart';
|
|
|
|
|
import 'package:test_sa/views/pages/user/visits/pantry/edit_pentry.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_back_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/buttons/app_icon_button.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/images/files_list.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/images/images_list.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/requests/info_row.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/visits/visit_status.dart';
|
|
|
|
|
@ -21,6 +23,7 @@ class VisitDetailsPage extends StatelessWidget {
|
|
|
|
|
final Visit visit;
|
|
|
|
|
|
|
|
|
|
const VisitDetailsPage({Key key, this.visit}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
Subtitle subtitle = AppLocalization.of(context).subtitle;
|
|
|
|
|
@ -70,44 +73,45 @@ class VisitDetailsPage extends StatelessWidget {
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
|
|
|
|
children: [
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
MaterialButton(
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if ((visit.images?.isNotEmpty ?? false) && (visit.images?.first?.isNotEmpty ?? false)) {
|
|
|
|
|
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 ? " " : visit.images.first,
|
|
|
|
|
boxFit: BoxFit.cover,
|
|
|
|
|
// MaterialButton(
|
|
|
|
|
// padding: EdgeInsets.zero,
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// if ((visit.images?.isNotEmpty ?? false) && (visit.images?.first?.isNotEmpty ?? false)) {
|
|
|
|
|
// 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 ? " " : visit.images.first,
|
|
|
|
|
// boxFit: BoxFit.cover,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
// height: 8,
|
|
|
|
|
// ),
|
|
|
|
|
if (visit?.images?.isNotEmpty ?? false)
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 60 * AppStyle.getScaleFactor(context),
|
|
|
|
|
child: FilesList(
|
|
|
|
|
images: visit.images,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 60 * AppStyle.getScaleFactor(context),
|
|
|
|
|
child: ImagesList(
|
|
|
|
|
images: visit.images,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(top: 4, bottom: 4),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
|