diff --git a/lib/config/config.dart b/lib/config/config.dart index 18abad39..acb8d80a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart index 33e874db..0197873b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart @@ -4,101 +4,101 @@ 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 { - @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: [ - 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, - )), - ), - ), - ), - ], - ), - ], - ) - ], - ); - } -} +// 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 { +// @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: [ +// 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, +// )), +// ), +// ), +// ), +// ], +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart index 2df90419..4d02c27b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart +++ b/lib/pages/AlHabibMedicalService/h2o/Dialog/select_amount_dialog.dart @@ -4,163 +4,163 @@ 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 { - List 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: [ - 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: [ - 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 json) { - name = json['name']; - nameAr = json['nameAr']; - value = json['value']; - } - - Map toJson() { - final Map data = new Map(); - data['name'] = this.name; - data['nameAr'] = this.nameAr; - data['value'] = this.value; - return data; - } -} +// 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 { +// List 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: [ +// 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: [ +// 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 json) { +// name = json['name']; +// nameAr = json['nameAr']; +// value = json['value']; +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['name'] = this.name; +// data['nameAr'] = this.nameAr; +// data['value'] = this.value; +// return data; +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart index 2b22a100..641f6df7 100644 --- a/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart +++ b/lib/pages/AlHabibMedicalService/h2o/add_custom_amount.dart @@ -10,123 +10,124 @@ import 'package:flutter/material.dart'; import 'Dialog/select_amount_dialog.dart'; -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 { - 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,)); - } -} +// 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 { +// 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,)); +// } +// } diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 85c3544c..583dabbf 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -302,25 +302,11 @@ class _TodayPageState extends State { ); } - Widget _circularButton(context, int value, model, {bool isCustom = false}) { + Widget _circularButton(context, int value, model) { String _text = "$value${TranslationBase.of(context).ml}"; - if (isCustom) { - _text = TranslationBase.of(context).custom; - } return InkWell( onTap: () { - if (isCustom) { - Navigator.push( - context, - FadePage( - page: AddCustomAmount( - model: model, - ), - ), - ); - } else { - showConfirmMessage(context, value, model); - } + showConfirmMessage(context, value, model); }, child: Container( padding: EdgeInsets.all(21), diff --git a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart index 59a0a386..9b876cc1 100644 --- a/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart +++ b/lib/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart @@ -9,189 +9,193 @@ import 'package:flutter/material.dart'; import '../add_custom_amount.dart'; -class H20FloatingActionButton extends StatefulWidget { - const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key); - final H2OViewModel model; +// todo 'sikander' remove useless code - @override - _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState(); -} -class _H20FloatingActionButtonState extends State 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), - ), - ); - } -} +// 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 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), +// ), +// ); +// } +// } diff --git a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart index 1144e587..b31d4a38 100644 --- a/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart +++ b/lib/pages/ErService/EdOnline/ConfirmExitPageDialog.dart @@ -2,75 +2,75 @@ 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'; - -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, - ), - ], - ) - ], - ); - } -} +// 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, +// ), +// ], +// ) +// ], +// ); +// } +// } diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index edab81c1..457e199c 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -30,14 +30,12 @@ class _DdServicesPageState extends State { void initState() { super.initState(); pageController = new PageController(); - } _changePageViewIndex(int tab) { setState(() { pageController.jumpToPage(tab); - pageController.animateToPage(tab, - duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); }); } @@ -99,25 +97,28 @@ class _DdServicesPageState extends State { selectedQuestions: selectedQuestions, triageInformationRequest: triageInformationRequest, ), - EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,) + EdPaymentInformationPage( + selectedHospital: triageInformationRequest.selectedHospital, + ) ], ), ); } - void showConfirmMessage( - BuildContext context, - ) { - showDialog( - context: context, - child: ConfirmExitPageDialog( - onTapYes: () { - Navigator.pop(context); - }, - onTapNo: () { - Navigator.pop(context); - }, - ), - ); - } + // todo 'sikander' remove useless code + // void showConfirmMessage( + // BuildContext context, + // ) { + // showDialog( + // context: context, + // child: ConfirmExitPageDialog( + // onTapYes: () { + // Navigator.pop(context); + // }, + // onTapNo: () { + // Navigator.pop(context); + // }, + // ), + // ); + // } } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index a95fb425..731101b7 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; @@ -50,6 +51,7 @@ class _SendFeedbackPageState extends State { var _currentLocaleId; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; + int selectedStatusIndex = 5; var event = RobotProvider(); List appoList = []; @@ -165,16 +167,16 @@ class _SendFeedbackPageState extends State { }); }, child: DoctorCard( - onTap: null, - isInOutPatient: appointHistory.isInOutPatient, - name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, - // billNo: _appointmentResult.invoiceNo, - profileUrl: appointHistory.doctorImageURL, - subName: appointHistory.projectName, - isLiveCareAppointment: appointHistory.isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointHistory.appointmentDate), - rating: appointHistory.actualDoctorRate + 0.0, - appointmentTime: appointHistory.startTime.substring(0, 5), + onTap: null, + isInOutPatient: appointHistory.isInOutPatient, + name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: appointHistory.doctorImageURL, + subName: appointHistory.projectName, + isLiveCareAppointment: appointHistory.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory.appointmentDate), + rating: appointHistory.actualDoctorRate + 0.0, + appointmentTime: appointHistory.startTime.substring(0, 5), ), ), SizedBox(height: 12), @@ -182,8 +184,9 @@ class _SendFeedbackPageState extends State { Container( margin: EdgeInsets.only(bottom: 10.0), height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, - child: ListView.builder( + child: ListView.separated( itemCount: appoList.length, + separatorBuilder: (ctx, index) => SizedBox(height: 12), itemBuilder: (context, index) => InkWell( onTap: () { setState(() { @@ -309,6 +312,7 @@ class _SendFeedbackPageState extends State { messageController.text = ""; images = []; }); + selectedStatusIndex = 5; setMessageType(MessageType.NON); GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); @@ -429,6 +433,72 @@ class _SendFeedbackPageState extends State { // Show Dialog function void confirmBox(FeedbackViewModel model) { DoctorsListService service = new DoctorsListService(); + + List list = [ + RadioSelectionDialogModel(TranslationBase.of(context).notClassified, 5), + RadioSelectionDialogModel(TranslationBase.of(context).complainAppo, 1), + RadioSelectionDialogModel(TranslationBase.of(context).complainWithoutAppo, 2), + RadioSelectionDialogModel(TranslationBase.of(context).question, 3), + RadioSelectionDialogModel(TranslationBase.of(context).compliment, 4), + RadioSelectionDialogModel(TranslationBase.of(context).suggestion, 6), + ]; + + showDialog( + context: context, + child: RadioSelectionDialog( + listData: list, + selectedIndex: selectedStatusIndex, + onValueSelected: (index) { + selectedStatusIndex = index; + + if (index == 1) { + messageType = MessageType.ComplaintOnAnAppointment; + } else if (index == 2) { + messageType = MessageType.ComplaintWithoutAppointment; + } else if (index == 3) { + messageType = MessageType.Question; + } else if (index == 4) { + messageType = MessageType.Compliment; + } else if (index == 5) { + messageType = MessageType.NON; + } else { + messageType = MessageType.Suggestion; + } + + if (messageType == MessageType.ComplaintOnAnAppointment) { + appoList.clear(); + GifLoaderDialogUtils.showMyDialog(context); + service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + if (res['MessageStatus'] == 1) { + if (res['AppoimentAllHistoryResultList'].length != 0) { + res['AppoimentAllHistoryResultList'].forEach((v) { + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + setState(() { + appointHistory = null; + isShowListAppointHistory = true; + }); + } else {} + } else {} + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + // print(err); + // AppToast.showErrorToast(message: err); + // Navigator.of(context).pop(); + }); + } else { + isShowListAppointHistory = false; + } + setMessageType(messageType); + }, + ), + ); + + return; + // todo 'sikander' remove useless code showDialog( context: context, child: FeedbackTypeDialog( @@ -450,8 +520,7 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = true; }); } else {} - } else { - } + } else {} }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index cebcacdc..120428c4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -388,11 +388,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } - showDialogs(String message) { - ConfirmDialog dialog = new ConfirmDialog( - context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); - dialog.showAlertDialog(context); - } + // todo 'sikander' remove useless code + // showDialogs(String message) { + // ConfirmDialog dialog = new ConfirmDialog( + // context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); + // dialog.showAlertDialog(context); + // } Future> requestPermissions() async { var permissionResults = [ diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 3fa6ce39..b5535982 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,11 +21,12 @@ class MedicalReports extends StatelessWidget { void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, - child: ConfirmDialog( - appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).confirmMsgReport, + onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), ); + return; } ProjectViewModel projectViewModel = Provider.of(context); @@ -36,182 +39,100 @@ class MedicalReports extends StatelessWidget { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF7F7F7), - body: ListView.separated( - physics: BouncingScrollPhysics(), - itemCount: model.appointHistoryList.length, - padding: EdgeInsets.all(21), - separatorBuilder: (context, index) => SizedBox(height: 14), - itemBuilder: (context, index) { - AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; - return InkWell( - onTap: () => confirmBox(model.appointHistoryList[index], model), - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - //spreadRadius: 5, - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - color: Colors.white), - child: Padding( - padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) - Text( - _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - Text( - DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), - ], - ), - if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - LargeAvatar( - name: _appointmenHistory.doctorName, - url: _appointmenHistory.doctorImageURL, - width: 48, - height: 48, + body: model.appointHistoryList.isEmpty + ? getNoDataWidget(context) + : ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.appointHistoryList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; + return InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) + Text( + _appointmenHistory.doctorTitle.toString() + " " + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Text( + DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + ], + ), + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), + Row( mainAxisSize: MainAxisSize.min, children: [ - if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), - if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RatingBar.readOnly( - initialRating: _appointmenHistory.actualDoctorRate.toDouble(), - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - Icon(Icons.email, color: Color(0xff2B353E)) - ], + LargeAvatar( + name: _appointmenHistory.doctorName, + url: _appointmenHistory.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), + if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: _appointmenHistory.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Icon(Icons.email, color: Color(0xff2B353E)) + ], + ), + ], + ), ), ], ), - ), - ], - ), - ], - ), - ), - ), - ); - }, - ), - ), - ); - } -} - -class ConfirmDialog extends StatefulWidget { - final Function(AppointmentHistory) onOkSelected; - final AppointmentHistory appointmentHistory; - - ConfirmDialog({this.onOkSelected, this.appointmentHistory}); - - @override - _ConfirmDialogState createState() => _ConfirmDialogState(); -} - -class _ConfirmDialogState extends State { - @override - Widget build(BuildContext context) { - return SimpleDialog( - title: Texts(TranslationBase.of(context).confirm), - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts(TranslationBase.of(context).confirmMsgReport), - SizedBox( - height: 5.0, - ), - Divider( - height: 2.5, - color: Colors.grey[500], - ), - SizedBox( - height: 5, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - 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, - color: Colors.red, - ), - ), + ], ), ), ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onOkSelected(widget.appointmentHistory); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - ), - ), - ), - ), - ), - ], - ) - ], - ), - ) - ], + ); + }, + ), + ), ); } -} +} \ No newline at end of file