Merge branch 'development_new_design_2.0' into zik_new_design_2.0
* development_new_design_2.0: Translation update Fixes & updates Blood donation fixes Pharmacy Payment method design fix, Blood Donation fix improvements blood donation dialog change & improvements. Pharmacy updates Pharmacy prescriptions page design LiveCare design fixesmerge-update-with-lab-changes
commit
4c5b9b4244
@ -1,104 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// todo 'sikander' remove useless code
|
||||
// ignore: must_be_immutable
|
||||
// class ConfirmAddAmountDialog extends StatefulWidget {
|
||||
// final int amount;
|
||||
// final String unit;
|
||||
// final H2OViewModel model;
|
||||
//
|
||||
// ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
|
||||
//
|
||||
// @override
|
||||
// _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
|
||||
// }
|
||||
//
|
||||
// class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return SimpleDialog(
|
||||
// contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
|
||||
// titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
|
||||
// title: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).confirm,
|
||||
// textAlign: TextAlign.center,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// children: [
|
||||
// Column(
|
||||
// children: [
|
||||
// Divider(),
|
||||
// Center(
|
||||
// child: Texts(
|
||||
// "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?",
|
||||
// textAlign: TextAlign.center,
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 16.0,
|
||||
// ),
|
||||
// Row(
|
||||
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Container(
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).cancel.toUpperCase(),
|
||||
// color: Colors.red,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// width: 1,
|
||||
// height: 30,
|
||||
// color: Colors.grey[500],
|
||||
// ),
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () async {
|
||||
// InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
|
||||
// await widget.model.insertUserActivity(insertUserActivityRequestModel);
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).ok.toUpperCase(),
|
||||
// fontWeight: FontWeight.w400,
|
||||
// )),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@ -1,166 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// todo 'sikander' remove useless code
|
||||
// ignore: must_be_immutable
|
||||
// class SelectAmountDialog extends StatefulWidget {
|
||||
// final Function(AmountModel) onValueSelected;
|
||||
// AmountModel selectedAmount;
|
||||
//
|
||||
// SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount});
|
||||
//
|
||||
// @override
|
||||
// _SelectAmountDialogState createState() => _SelectAmountDialogState();
|
||||
// }
|
||||
//
|
||||
// class _SelectAmountDialogState extends State<SelectAmountDialog> {
|
||||
// List<AmountModel> searchAmount = [
|
||||
// AmountModel(name: "l", nameAr: "لتر", value: 1),
|
||||
// AmountModel(name: "ml", nameAr: "مم لتر", value: 2),
|
||||
// ];
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// widget.selectedAmount = widget.selectedAmount ?? searchAmount[0];
|
||||
// getLanguage();
|
||||
// }
|
||||
//
|
||||
// String languageID = "en";
|
||||
//
|
||||
// void getLanguage() async {
|
||||
// languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||
// setState(() {});
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return SimpleDialog(
|
||||
// children: [
|
||||
// Column(
|
||||
// children: [
|
||||
// Texts(
|
||||
// TranslationBase.of(context).preferredunit,
|
||||
// fontSize: 20,
|
||||
// ),
|
||||
// Divider(),
|
||||
// ...List.generate(
|
||||
// searchAmount.length,
|
||||
// (index) => Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 2,
|
||||
// ),
|
||||
// Row(
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// setState(() {
|
||||
// widget.selectedAmount = searchAmount[index];
|
||||
// });
|
||||
// },
|
||||
// child: ListTile(
|
||||
// title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name),
|
||||
// leading: Radio(
|
||||
// value: searchAmount[index],
|
||||
// groupValue: widget.selectedAmount,
|
||||
// activeColor: Colors.red[800],
|
||||
// onChanged: (value) {
|
||||
// setState(() {
|
||||
// widget.selectedAmount = value;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 5.0,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 5.0,
|
||||
// ),
|
||||
// Row(
|
||||
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Container(
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).cancel.toUpperCase(),
|
||||
// color: Colors.red,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// width: 1,
|
||||
// height: 30,
|
||||
// color: Colors.grey[500],
|
||||
// ),
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// widget.onValueSelected(widget.selectedAmount);
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).ok,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// )),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class AmountModel {
|
||||
// String name;
|
||||
// String nameAr;
|
||||
// int value;
|
||||
//
|
||||
// AmountModel({this.name, this.nameAr, this.value});
|
||||
//
|
||||
// AmountModel.fromJson(Map<String, dynamic> json) {
|
||||
// name = json['name'];
|
||||
// nameAr = json['nameAr'];
|
||||
// value = json['value'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['name'] = this.name;
|
||||
// data['nameAr'] = this.nameAr;
|
||||
// data['value'] = this.value;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
@ -1,133 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
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 'Dialog/select_amount_dialog.dart';
|
||||
|
||||
// todo 'sikander' remove useless code
|
||||
// class AddCustomAmount extends StatefulWidget {
|
||||
// final H2OViewModel model;
|
||||
// final Function changePageViewIndex;
|
||||
//
|
||||
// const AddCustomAmount({Key key, this.model, this.changePageViewIndex})
|
||||
// : super(key: key);
|
||||
//
|
||||
// @override
|
||||
// _AddCustomAmountState createState() => _AddCustomAmountState();
|
||||
// }
|
||||
//
|
||||
// class _AddCustomAmountState extends State<AddCustomAmount> {
|
||||
// TextEditingController _nameTextController = TextEditingController();
|
||||
// AmountModel selectedAmount;
|
||||
//
|
||||
// @override
|
||||
// void initState() {
|
||||
// setState(() {
|
||||
// _nameTextController.text = "0";
|
||||
// });
|
||||
// super.initState();
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return AppScaffold(
|
||||
// isShowAppBar: true,
|
||||
// appBarTitle:TranslationBase.of(context).customLabel,
|
||||
// body: SingleChildScrollView(
|
||||
// physics: ScrollPhysics(),
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.all(12),
|
||||
// child: Center(
|
||||
// child: FractionallySizedBox(
|
||||
// widthFactor: 0.94,
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 12,
|
||||
// ),
|
||||
// NewTextFields(
|
||||
// hintText: TranslationBase.of(context).h2oAmountOfWater,
|
||||
// // type: "Number",
|
||||
// controller: _nameTextController,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 12,
|
||||
// ),
|
||||
// InkWell(
|
||||
// onTap: () => confirmAmountTypeDialog(),
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.all(12),
|
||||
// width: double.infinity,
|
||||
// height: 65,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(12),
|
||||
// color: Colors.white),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Texts(getAmountName()),
|
||||
// Icon(Icons.arrow_drop_down)
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 12,
|
||||
// ),
|
||||
// SecondaryButton(
|
||||
// textColor: Colors.white,
|
||||
// label: TranslationBase.of(context).ok,
|
||||
// onTap: () async {
|
||||
// Navigator.of(context).pop();
|
||||
// showConfirmMessage (int.parse(_nameTextController.text), widget.model);
|
||||
// },
|
||||
// // loading: model.state == ViewState.BusyLocal,
|
||||
// disabled: _nameTextController.text.isEmpty || selectedAmount == null),
|
||||
// SizedBox(
|
||||
// height: 12,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// void confirmAmountTypeDialog() {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// child: SelectAmountDialog(
|
||||
// selectedAmount: selectedAmount,
|
||||
// onValueSelected: (value) {
|
||||
// setState(() {
|
||||
// selectedAmount = value;
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
//
|
||||
// String getAmountName() {
|
||||
// if (selectedAmount != null)
|
||||
// return selectedAmount.name;
|
||||
// else
|
||||
// return TranslationBase.of(context).selectUnit;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// void showConfirmMessage(int amount, H2OViewModel model) {
|
||||
// showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
|
||||
// }
|
||||
// }
|
||||
@ -1,201 +0,0 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../add_custom_amount.dart';
|
||||
|
||||
|
||||
// todo 'sikander' remove useless code
|
||||
|
||||
|
||||
// class H20FloatingActionButton extends StatefulWidget {
|
||||
// const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
|
||||
//
|
||||
// final H2OViewModel model;
|
||||
//
|
||||
// @override
|
||||
// _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
|
||||
// }
|
||||
//
|
||||
// class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
|
||||
// AnimationController _controller;
|
||||
// @override
|
||||
// void initState() {
|
||||
// _controller = new AnimationController(
|
||||
// vsync: this,
|
||||
// duration: const Duration(milliseconds: 500),
|
||||
// );
|
||||
// super.initState();
|
||||
// }
|
||||
//
|
||||
// void showConfirmMessage(int amount, H2OViewModel model) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// child: ConfirmAddAmountDialog(
|
||||
// model: model,
|
||||
// amount: amount,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Container(
|
||||
// margin: EdgeInsets.only(left: 20, right: 20),
|
||||
// child: new Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||
// children: [
|
||||
// ActionButton(
|
||||
// controller: _controller,
|
||||
// text: "600${TranslationBase.of(context).ml}",
|
||||
// onTap: () {
|
||||
// showConfirmMessage(600, widget.model);
|
||||
// },
|
||||
// ),
|
||||
// ActionButton(
|
||||
// controller: _controller,
|
||||
// text: "330${TranslationBase.of(context).ml}",
|
||||
// onTap: () {
|
||||
// showConfirmMessage(330, widget.model);
|
||||
// },
|
||||
// ),
|
||||
// ActionButton(
|
||||
// controller: _controller,
|
||||
// text: "200${TranslationBase.of(context).ml}",
|
||||
// onTap: () {
|
||||
// showConfirmMessage(200, widget.model);
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// FloatingActionButton(
|
||||
// heroTag: null,
|
||||
// child: new AnimatedBuilder(
|
||||
// animation: _controller,
|
||||
// builder: (BuildContext context, Widget child) {
|
||||
// return new Transform(
|
||||
// transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
|
||||
// alignment: FractionalOffset.center,
|
||||
// child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// if (_controller.isDismissed) {
|
||||
// _controller.forward();
|
||||
// } else {
|
||||
// _controller.reverse();
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// new Container(
|
||||
// margin: EdgeInsets.only(left: 8, bottom: 4),
|
||||
// alignment: FractionalOffset.topCenter,
|
||||
// child: new ScaleTransition(
|
||||
// scale: new CurvedAnimation(
|
||||
// parent: _controller,
|
||||
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
|
||||
// ),
|
||||
// child: new FloatingActionButton(
|
||||
// backgroundColor: Colors.white,
|
||||
// heroTag: null,
|
||||
// // mini: true,
|
||||
// child: Text(
|
||||
// TranslationBase.of(context).custom,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(fontSize: 12, color: Colors.grey),
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// FadePage(
|
||||
// page: AddCustomAmount(
|
||||
// model: widget.model,
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// new Container(
|
||||
// margin: EdgeInsets.only(left: 8, bottom: 4),
|
||||
// alignment: FractionalOffset.topCenter,
|
||||
// child: new ScaleTransition(
|
||||
// scale: new CurvedAnimation(
|
||||
// parent: _controller,
|
||||
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
|
||||
// ),
|
||||
// child: new FloatingActionButton(
|
||||
// backgroundColor: Colors.white,
|
||||
// heroTag: null,
|
||||
// //mini: true,
|
||||
// child: Text(
|
||||
// TranslationBase.of(context).undo,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(fontSize: 12.0, color: Colors.grey),
|
||||
// ),
|
||||
// onPressed: undoVolume,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ]),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// void undoVolume() async {
|
||||
// GifLoaderDialogUtils.showMyDialog(context);
|
||||
// await widget.model.undoUserActivity();
|
||||
// GifLoaderDialogUtils.hideDialog(context);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class ActionButton extends StatelessWidget {
|
||||
// const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
|
||||
// : _controller = controller,
|
||||
// super(key: key);
|
||||
//
|
||||
// final AnimationController _controller;
|
||||
// final String text;
|
||||
// final Function onTap;
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Container(
|
||||
// margin: EdgeInsets.only(left: 4, bottom: 8),
|
||||
// alignment: FractionalOffset.topCenter,
|
||||
// child: new ScaleTransition(
|
||||
// scale: new CurvedAnimation(
|
||||
// parent: _controller,
|
||||
// curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
|
||||
// ),
|
||||
// child: new FloatingActionButton(
|
||||
// heroTag: null,
|
||||
// backgroundColor: Colors.white,
|
||||
// //mini: true,
|
||||
// child: Text(
|
||||
// text,
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(fontSize: 12.0, color: Colors.grey),
|
||||
// ),
|
||||
// onPressed: onTap),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@ -1,76 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
// todo 'sikander' remove useless code
|
||||
// class ConfirmExitPageDialog extends StatelessWidget {
|
||||
// final GestureTapCallback onTapYes;
|
||||
// final GestureTapCallback onTapNo;
|
||||
//
|
||||
// const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo})
|
||||
// : super(key: key);
|
||||
//
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return SimpleDialog(
|
||||
// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
|
||||
// title: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).confirm,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Texts(
|
||||
// "Are you sure you want to exit this page ?",
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
// Divider(),
|
||||
// SizedBox(
|
||||
// height: 5.0,
|
||||
// ),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// onTapNo();
|
||||
// },
|
||||
// child: Container(
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).no,
|
||||
// color: Colors.red,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.pop(context);
|
||||
// onTapYes();
|
||||
// },
|
||||
// child: Container(
|
||||
// child: Center(
|
||||
// child: Texts(TranslationBase.of(context).yes),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 20.0,
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@ -1,420 +0,0 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CartOrderPage extends StatefulWidget {
|
||||
final Function(int) changeTab;
|
||||
|
||||
const CartOrderPage({Key key, this.changeTab}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CartOrderPageState createState() => _CartOrderPageState();
|
||||
}
|
||||
|
||||
class _CartOrderPageState extends State<CartOrderPage> {
|
||||
bool isLoading = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getData();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final mediaQuery = MediaQuery.of(context);
|
||||
OrderPreviewViewModel model = Provider.of(context);
|
||||
|
||||
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
|
||||
AppScaffold appScaffold;
|
||||
return NetworkBaseView(
|
||||
isLoading: isLoading,
|
||||
isLocalLoader: true,
|
||||
child: appScaffold = AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).shoppingCart,
|
||||
isShowAppBar: true,
|
||||
isPharmacy: true,
|
||||
showHomeAppBarIcon: false,
|
||||
isShowDecPage: true,
|
||||
baseViewModel: model,
|
||||
backButtonTab:
|
||||
widget.changeTab != null ? () => widget.changeTab(0) : null,
|
||||
backgroundColor: Colors.white,
|
||||
body: !(model.cartResponse.shoppingCarts == null ||
|
||||
model.cartResponse.shoppingCarts.length == 0)
|
||||
? Container(
|
||||
height: height * 0.85,
|
||||
width: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureIconButton(
|
||||
TranslationBase.of(context).deleteAllItems,
|
||||
Icon(
|
||||
Icons.delete_outline_sharp,
|
||||
color: Colors.grey.shade700,
|
||||
),
|
||||
onTap: () => {model.deleteShoppingCart()},
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Container(
|
||||
child: Column(
|
||||
children: [
|
||||
...List.generate(
|
||||
model.cartResponse.shoppingCarts != null
|
||||
? model.cartResponse.shoppingCarts.length
|
||||
: 0,
|
||||
(index) => ProductOrderItem(
|
||||
model.cartResponse
|
||||
.shoppingCarts[index], () {
|
||||
print(model.cartResponse
|
||||
.shoppingCarts[index].quantity);
|
||||
model
|
||||
.changeProductQuantity(model
|
||||
.cartResponse
|
||||
.shoppingCarts[index])
|
||||
.then((value) {
|
||||
if (model.state != ViewState.Error) {
|
||||
appScaffold.appBar.badgeUpdater(
|
||||
'${value.quantityCount ?? 0}');
|
||||
}
|
||||
if (model.state ==
|
||||
ViewState.ErrorLocal) {
|
||||
Utils.showErrorToast(model.error);
|
||||
}
|
||||
});
|
||||
}, () {
|
||||
model
|
||||
.deleteProduct(model.cartResponse
|
||||
.shoppingCarts[index])
|
||||
.then((value) {
|
||||
if (model.state != ViewState.Error) {
|
||||
appScaffold.appBar.badgeUpdater(
|
||||
'${value.quantityCount ?? 0}');
|
||||
}
|
||||
});
|
||||
}))
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 20,
|
||||
thickness: 2,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).subtotal,
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
Texts(
|
||||
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
"${TranslationBase.of(context).vat}",
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
Texts(
|
||||
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(
|
||||
TranslationBase.of(context).total,
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
Texts(
|
||||
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
||||
fontSize: 14,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Image.asset(
|
||||
"assets/images/pharmacy_module/payment_image.png",
|
||||
width: mediaQuery.size.width - 20,
|
||||
height: 30.0,
|
||||
fit: BoxFit.scaleDown,
|
||||
),
|
||||
SizedBox(
|
||||
height: 120,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
'assets/images/new-design/empty_box.png',
|
||||
width: 100,
|
||||
height: 100,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
TranslationBase.of(context).noData,
|
||||
// 'There is no data',
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: !(model.cartResponse.shoppingCarts == null ||
|
||||
model.cartResponse.shoppingCarts.length == 0)
|
||||
? height * 0.15
|
||||
: 0,
|
||||
color: Colors.white,
|
||||
child: OrderBottomWidget(model.addresses, height),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void getData() async {
|
||||
await Provider.of<OrderPreviewViewModel>(context, listen: false)
|
||||
.getShoppingCart();
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class OrderBottomWidget extends StatefulWidget {
|
||||
final List<Addresses> addresses;
|
||||
final double height;
|
||||
|
||||
OrderBottomWidget(this.addresses, this.height);
|
||||
|
||||
@override
|
||||
_OrderBottomWidgetState createState() => _OrderBottomWidgetState();
|
||||
}
|
||||
|
||||
class _OrderBottomWidgetState extends State<OrderBottomWidget> {
|
||||
bool isAgree = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectProvider = Provider.of(context);
|
||||
OrderPreviewViewModel cart = Provider.of(context);
|
||||
return !(cart.cartResponse.shoppingCarts == null ||
|
||||
cart.cartResponse.shoppingCarts.length == 0)
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Divider(
|
||||
color: Color(0xFFD6D6D6),
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
Container(
|
||||
height: widget.height * 0.070,
|
||||
color: Color(0xffe6ffe0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
isAgree = !isAgree;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 25.0,
|
||||
height: widget.height * 0.070,
|
||||
decoration: new BoxDecoration(
|
||||
color: !isAgree ? Color(0xffeeeeee) : Colors.green,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: !isAgree
|
||||
? null
|
||||
: Padding(
|
||||
padding: const EdgeInsets.all(0.0),
|
||||
child: Icon(
|
||||
Icons.check,
|
||||
color: Colors.white,
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 4),
|
||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Texts(
|
||||
TranslationBase.of(context)
|
||||
.pharmacyServiceTermsCondition,
|
||||
fontSize: 13,
|
||||
color: Colors.grey.shade800,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => {
|
||||
Navigator.push(
|
||||
context, FadePage(page: PharmacyTermsConditions()))
|
||||
},
|
||||
child: Container(
|
||||
child: Icon(
|
||||
Icons.info,
|
||||
size: 25,
|
||||
color: Color(0xff005aff),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: widget.height * 0.065,
|
||||
margin: EdgeInsets.symmetric(vertical: 2),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 0, vertical: 0),
|
||||
child: Row(
|
||||
children: [
|
||||
Texts(
|
||||
"${TranslationBase.of(context).sar} ${(cart.cartResponse.subtotal).toStringAsFixed(2)}",
|
||||
fontSize: projectProvider.isArabic ? 12 : 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Texts(
|
||||
"${TranslationBase.of(context).inclusiveVat}",
|
||||
fontSize: 8,
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Texts(
|
||||
"${cart.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
||||
fontSize: 10,
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
RaisedButton(
|
||||
onPressed: isAgree
|
||||
? () => {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page:
|
||||
OrderPreviewPage(widget.addresses)))
|
||||
}
|
||||
: null,
|
||||
child: new Text(
|
||||
"${TranslationBase.of(context).checkOut}",
|
||||
style: new TextStyle(
|
||||
color:
|
||||
isAgree ? Colors.white : Colors.grey.shade300,
|
||||
fontSize: 14),
|
||||
),
|
||||
elevation: 0,
|
||||
color: Color(0xff005aff),
|
||||
disabledColor: Color(0xff005aff),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue