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.
HMG_Patient_App/lib/pages/AlHabibMedicalService/parking_page.dart

198 lines
8.7 KiB
Dart

4 years ago
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
6 years ago
import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
4 years ago
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
6 years ago
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
4 years ago
import '../../d_q_icons_icons.dart';
6 years ago
class ParkingPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
6 years ago
return BaseView<QrViewModel>(
onModelReady: (model) => model.getIsSaveParking(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
4 years ago
showNewAppBar: true,
showNewAppBarTitle: true,
6 years ago
appBarTitle: TranslationBase.of(context).parking,
description: TranslationBase.of(context).parkingDescription,
4 years ago
imagesInfo: [ImagesInfo(imageAr: 'assets/images/bc_parking.png', imageEn: 'assets/images/bc_parking.png', isAsset: true)],
6 years ago
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: !model.isSavePark
? Column(
children: <Widget>[
Texts(
4 years ago
TranslationBase.of(context).parkingDescription,
6 years ago
fontWeight: FontWeight.normal,
fontSize: 15,
),
SizedBox(
height: 12,
),
Image.asset(
'assets/images/timeline_bg.png',
width: double.infinity,
)
],
)
: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: Container(
child: Icon(/*Icons.landscape*/ DQIcons.parking_icon, size: 130),
),
),
6 years ago
SizedBox(
width: 15,
),
Expanded(
child: Container(
height: 150,
padding: EdgeInsets.all(8),
4 years ago
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
6 years ago
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Texts(model.qrParkingModel.parkingDescriptionN),
Divider(
height: 3,
),
Texts(model.qrParkingModel.rowDescriptionN)
],
),
),
),
],
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(8),
width: double.infinity,
4 years ago
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
6 years ago
height: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).showMyPark),
4 years ago
Texts(projectViewModel.isArabic ? model.qrParkingModel.floorDescriptionN : model.qrParkingModel.floorDescription),
6 years ago
],
),
),
SizedBox(
height: 15,
),
Container(
4 years ago
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
6 years ago
padding: EdgeInsets.all(8),
width: double.infinity,
height: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).gate),
4 years ago
Texts(projectViewModel.isArabic ? model.qrParkingModel.gateDescriptionN : model.qrParkingModel.gateDescription),
6 years ago
],
),
),
SizedBox(
height: 15,
),
Container(
4 years ago
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
6 years ago
padding: EdgeInsets.all(8),
width: double.infinity,
height: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).building),
4 years ago
Texts(projectViewModel.isArabic ? model.qrParkingModel.buildingDescriptionN : model.qrParkingModel.buildingDescription),
6 years ago
],
),
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(8),
4 years ago
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), color: Colors.white, shape: BoxShape.rectangle),
6 years ago
width: double.infinity,
height: 70,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(TranslationBase.of(context).branch),
4 years ago
Texts(projectViewModel.isArabic ? model.qrParkingModel.branchDescriptionN : model.qrParkingModel.branchDescription),
6 years ago
],
),
),
SizedBox(
height: 15,
),
],
),
),
bottomSheet: !model.isSavePark
? Container(
4 years ago
color: Theme.of(context).scaffoldBackgroundColor,
6 years ago
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
4 years ago
child: DefaultButton(TranslationBase.of(context).readBarcode, () => {model.readQr()}),
6 years ago
),
],
),
)
: Container(
height: MediaQuery.of(context).size.height * 0.15,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
4 years ago
child: DefaultButton(
TranslationBase.of(context).showMyPark,
() => {
MapsLauncher.launchCoordinates(
model.qrParkingModel.latitude,
model.qrParkingModel.longitude,
),
}),
6 years ago
),
SizedBox(
height: 12,
),
InkWell(
onTap: () => model.clearParking(),
child: Texts(
TranslationBase.of(context).clearMyData,
color: Colors.red,
decoration: TextDecoration.underline,
))
],
),
),
),
);
}
}