Merge branch 'development_new_design_2.0' into haroon-new-design

merge-update-with-lab-changes
haroon amjad 5 years ago
commit 2db050a228

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -4,101 +4,101 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable // ignore: must_be_immutable
class ConfirmAddAmountDialog extends StatefulWidget { // class ConfirmAddAmountDialog extends StatefulWidget {
final int amount; // final int amount;
final String unit; // final String unit;
final H2OViewModel model; // final H2OViewModel model;
//
ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"}); // ConfirmAddAmountDialog({Key key, this.model, this.amount, this.unit = "ml"});
//
@override // @override
_ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState(); // _ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
} // }
//
class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> { // class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0), // contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 8.0),
titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0), // titlePadding: EdgeInsets.fromLTRB(24.0, 16.0, 24.0, 8.0),
title: Center( // title: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).confirm, // TranslationBase.of(context).confirm,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
color: Colors.black, // color: Colors.black,
), // ),
), // ),
children: [ // children: [
Column( // Column(
children: [ // children: [
Divider(), // Divider(),
Center( // Center(
child: Texts( // child: Texts(
"${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?", // "${TranslationBase.of(context).areyousure} ${widget.amount} ${widget.unit} ?",
textAlign: TextAlign.center, // textAlign: TextAlign.center,
color: Colors.grey, // color: Colors.grey,
), // ),
), // ),
SizedBox( // SizedBox(
height: 16.0, // height: 16.0,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel.toUpperCase(), // TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () async { // onTap: () async {
InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount); // InsertUserActivityRequestModel insertUserActivityRequestModel = InsertUserActivityRequestModel(quantityIntake: widget.amount);
await widget.model.insertUserActivity(insertUserActivityRequestModel); // await widget.model.insertUserActivity(insertUserActivityRequestModel);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok.toUpperCase(), // TranslationBase.of(context).ok.toUpperCase(),
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
), // ),
), // ),
], // ],
), // ),
], // ],
) // )
], // ],
); // );
} // }
} // }

@ -4,163 +4,163 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
// ignore: must_be_immutable // ignore: must_be_immutable
class SelectAmountDialog extends StatefulWidget { // class SelectAmountDialog extends StatefulWidget {
final Function(AmountModel) onValueSelected; // final Function(AmountModel) onValueSelected;
AmountModel selectedAmount; // AmountModel selectedAmount;
//
SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount}); // SelectAmountDialog({Key key, this.onValueSelected, this.selectedAmount});
//
@override // @override
_SelectAmountDialogState createState() => _SelectAmountDialogState(); // _SelectAmountDialogState createState() => _SelectAmountDialogState();
} // }
//
class _SelectAmountDialogState extends State<SelectAmountDialog> { // class _SelectAmountDialogState extends State<SelectAmountDialog> {
List<AmountModel> searchAmount = [ // List<AmountModel> searchAmount = [
AmountModel(name: "l", nameAr: "لتر", value: 1), // AmountModel(name: "l", nameAr: "لتر", value: 1),
AmountModel(name: "ml", nameAr: "مم لتر", value: 2), // AmountModel(name: "ml", nameAr: "مم لتر", value: 2),
]; // ];
@override // @override
void initState() { // void initState() {
super.initState(); // super.initState();
widget.selectedAmount = widget.selectedAmount ?? searchAmount[0]; // widget.selectedAmount = widget.selectedAmount ?? searchAmount[0];
getLanguage(); // getLanguage();
} // }
//
String languageID = "en"; // String languageID = "en";
//
void getLanguage() async { // void getLanguage() async {
languageID = await sharedPref.getString(APP_LANGUAGE); // languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {}); // setState(() {});
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
children: [ // children: [
Column( // Column(
children: [ // children: [
Texts( // Texts(
TranslationBase.of(context).preferredunit, // TranslationBase.of(context).preferredunit,
fontSize: 20, // fontSize: 20,
), // ),
Divider(), // Divider(),
...List.generate( // ...List.generate(
searchAmount.length, // searchAmount.length,
(index) => Column( // (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
SizedBox( // SizedBox(
height: 2, // height: 2,
), // ),
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
setState(() { // setState(() {
widget.selectedAmount = searchAmount[index]; // widget.selectedAmount = searchAmount[index];
}); // });
}, // },
child: ListTile( // child: ListTile(
title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name), // title: Text(languageID == "ar" ? searchAmount[index].nameAr : searchAmount[index].name),
leading: Radio( // leading: Radio(
value: searchAmount[index], // value: searchAmount[index],
groupValue: widget.selectedAmount, // groupValue: widget.selectedAmount,
activeColor: Colors.red[800], // activeColor: Colors.red[800],
onChanged: (value) { // onChanged: (value) {
setState(() { // setState(() {
widget.selectedAmount = value; // widget.selectedAmount = value;
}); // });
}, // },
), // ),
), // ),
), // ),
) // )
], // ],
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).cancel.toUpperCase(), // TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
Container( // Container(
width: 1, // width: 1,
height: 30, // height: 30,
color: Colors.grey[500], // color: Colors.grey[500],
), // ),
Expanded( // Expanded(
flex: 1, // flex: 1,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
widget.onValueSelected(widget.selectedAmount); // widget.onValueSelected(widget.selectedAmount);
Navigator.pop(context); // Navigator.pop(context);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).ok, // TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, // fontWeight: FontWeight.w400,
)), // )),
), // ),
), // ),
), // ),
], // ],
) // )
], // ],
) // )
], // ],
); // );
} // }
} // }
//
class AmountModel { // class AmountModel {
String name; // String name;
String nameAr; // String nameAr;
int value; // int value;
//
AmountModel({this.name, this.nameAr, this.value}); // AmountModel({this.name, this.nameAr, this.value});
//
AmountModel.fromJson(Map<String, dynamic> json) { // AmountModel.fromJson(Map<String, dynamic> json) {
name = json['name']; // name = json['name'];
nameAr = json['nameAr']; // nameAr = json['nameAr'];
value = json['value']; // value = json['value'];
} // }
//
Map<String, dynamic> toJson() { // Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); // final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name; // data['name'] = this.name;
data['nameAr'] = this.nameAr; // data['nameAr'] = this.nameAr;
data['value'] = this.value; // data['value'] = this.value;
return data; // return data;
} // }
} // }

@ -10,123 +10,124 @@ import 'package:flutter/material.dart';
import 'Dialog/select_amount_dialog.dart'; import 'Dialog/select_amount_dialog.dart';
class AddCustomAmount extends StatefulWidget { // todo 'sikander' remove useless code
final H2OViewModel model; // class AddCustomAmount extends StatefulWidget {
final Function changePageViewIndex; // final H2OViewModel model;
// final Function changePageViewIndex;
const AddCustomAmount({Key key, this.model, this.changePageViewIndex}) //
: super(key: key); // const AddCustomAmount({Key key, this.model, this.changePageViewIndex})
// : super(key: key);
@override //
_AddCustomAmountState createState() => _AddCustomAmountState(); // @override
} // _AddCustomAmountState createState() => _AddCustomAmountState();
// }
class _AddCustomAmountState extends State<AddCustomAmount> { //
TextEditingController _nameTextController = TextEditingController(); // class _AddCustomAmountState extends State<AddCustomAmount> {
AmountModel selectedAmount; // TextEditingController _nameTextController = TextEditingController();
// AmountModel selectedAmount;
@override //
void initState() { // @override
setState(() { // void initState() {
_nameTextController.text = "0"; // setState(() {
}); // _nameTextController.text = "0";
super.initState(); // });
} // super.initState();
// }
@override //
Widget build(BuildContext context) { // @override
return AppScaffold( // Widget build(BuildContext context) {
isShowAppBar: true, // return AppScaffold(
appBarTitle:TranslationBase.of(context).customLabel, // isShowAppBar: true,
body: SingleChildScrollView( // appBarTitle:TranslationBase.of(context).customLabel,
physics: ScrollPhysics(), // body: SingleChildScrollView(
child: Container( // physics: ScrollPhysics(),
margin: EdgeInsets.all(12), // child: Container(
child: Center( // margin: EdgeInsets.all(12),
child: FractionallySizedBox( // child: Center(
widthFactor: 0.94, // child: FractionallySizedBox(
child: Column( // widthFactor: 0.94,
crossAxisAlignment: CrossAxisAlignment.start, // child: Column(
children: [ // crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( // children: [
height: 12, // SizedBox(
), // height: 12,
NewTextFields( // ),
hintText: TranslationBase.of(context).h2oAmountOfWater, // NewTextFields(
// type: "Number", // hintText: TranslationBase.of(context).h2oAmountOfWater,
controller: _nameTextController, // // type: "Number",
), // controller: _nameTextController,
SizedBox( // ),
height: 12, // SizedBox(
), // height: 12,
InkWell( // ),
onTap: () => confirmAmountTypeDialog(), // InkWell(
child: Container( // onTap: () => confirmAmountTypeDialog(),
padding: EdgeInsets.all(12), // child: Container(
width: double.infinity, // padding: EdgeInsets.all(12),
height: 65, // width: double.infinity,
decoration: BoxDecoration( // height: 65,
borderRadius: BorderRadius.circular(12), // decoration: BoxDecoration(
color: Colors.white), // borderRadius: BorderRadius.circular(12),
child: Row( // color: Colors.white),
mainAxisAlignment: MainAxisAlignment.spaceBetween, // child: Row(
children: [ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
Texts(getAmountName()), // children: [
Icon(Icons.arrow_drop_down) // Texts(getAmountName()),
], // Icon(Icons.arrow_drop_down)
), // ],
), // ),
), // ),
SizedBox( // ),
height: 12, // SizedBox(
), // height: 12,
SecondaryButton( // ),
textColor: Colors.white, // SecondaryButton(
label: TranslationBase.of(context).ok, // textColor: Colors.white,
onTap: () async { // label: TranslationBase.of(context).ok,
Navigator.of(context).pop(); // onTap: () async {
showConfirmMessage (int.parse(_nameTextController.text), widget.model); // Navigator.of(context).pop();
}, // showConfirmMessage (int.parse(_nameTextController.text), widget.model);
// loading: model.state == ViewState.BusyLocal, // },
disabled: _nameTextController.text.isEmpty || selectedAmount == null), // // loading: model.state == ViewState.BusyLocal,
SizedBox( // disabled: _nameTextController.text.isEmpty || selectedAmount == null),
height: 12, // SizedBox(
), // height: 12,
], // ),
), // ],
), // ),
), // ),
), // ),
), // ),
); // ),
} // );
// }
//
void confirmAmountTypeDialog() { //
showDialog( // void confirmAmountTypeDialog() {
context: context, // showDialog(
child: SelectAmountDialog( // context: context,
selectedAmount: selectedAmount, // child: SelectAmountDialog(
onValueSelected: (value) { // selectedAmount: selectedAmount,
setState(() { // onValueSelected: (value) {
selectedAmount = value; // setState(() {
}); // selectedAmount = value;
}, // });
), // },
); // ),
} // );
// }
//
String getAmountName() { //
if (selectedAmount != null) // String getAmountName() {
return selectedAmount.name; // if (selectedAmount != null)
else // return selectedAmount.name;
return TranslationBase.of(context).selectUnit; // else
} // return TranslationBase.of(context).selectUnit;
// }
//
//
void showConfirmMessage(int amount, H2OViewModel model) { //
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,)); // void showConfirmMessage(int amount, H2OViewModel model) {
} // showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
} // }
// }

@ -302,25 +302,11 @@ class _TodayPageState extends State<TodayPage> {
); );
} }
Widget _circularButton(context, int value, model, {bool isCustom = false}) { Widget _circularButton(context, int value, model) {
String _text = "$value${TranslationBase.of(context).ml}"; String _text = "$value${TranslationBase.of(context).ml}";
if (isCustom) {
_text = TranslationBase.of(context).custom;
}
return InkWell( return InkWell(
onTap: () { onTap: () {
if (isCustom) { showConfirmMessage(context, value, model);
Navigator.push(
context,
FadePage(
page: AddCustomAmount(
model: model,
),
),
);
} else {
showConfirmMessage(context, value, model);
}
}, },
child: Container( child: Container(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),

@ -9,189 +9,193 @@ import 'package:flutter/material.dart';
import '../add_custom_amount.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<H20FloatingActionButton> with TickerProviderStateMixin { // class H20FloatingActionButton extends StatefulWidget {
AnimationController _controller; // const H20FloatingActionButton({Key key, @required AnimationController controller, @required this.model}) : super(key: key);
@override //
void initState() { // final H2OViewModel model;
_controller = new AnimationController( //
vsync: this, // @override
duration: const Duration(milliseconds: 500), // _H20FloatingActionButtonState createState() => _H20FloatingActionButtonState();
); // }
super.initState(); //
} // class _H20FloatingActionButtonState extends State<H20FloatingActionButton> with TickerProviderStateMixin {
// AnimationController _controller;
void showConfirmMessage(int amount, H2OViewModel model) { // @override
showDialog( // void initState() {
context: context, // _controller = new AnimationController(
child: ConfirmAddAmountDialog( // vsync: this,
model: model, // duration: const Duration(milliseconds: 500),
amount: amount, // );
), // super.initState();
); // }
} //
// void showConfirmMessage(int amount, H2OViewModel model) {
@override // showDialog(
Widget build(BuildContext context) { // context: context,
return Container( // child: ConfirmAddAmountDialog(
margin: EdgeInsets.only(left: 20, right: 20), // model: model,
child: new Column(mainAxisSize: MainAxisSize.min, children: [ // amount: amount,
Row( // ),
mainAxisAlignment: MainAxisAlignment.start, // );
children: [ // }
Column( //
crossAxisAlignment: CrossAxisAlignment.end, // @override
children: [ // Widget build(BuildContext context) {
ActionButton( // return Container(
controller: _controller, // margin: EdgeInsets.only(left: 20, right: 20),
text: "600${TranslationBase.of(context).ml}", // child: new Column(mainAxisSize: MainAxisSize.min, children: [
onTap: () { // Row(
showConfirmMessage(600, widget.model); // mainAxisAlignment: MainAxisAlignment.start,
}, // children: [
), // Column(
ActionButton( // crossAxisAlignment: CrossAxisAlignment.end,
controller: _controller, // children: [
text: "330${TranslationBase.of(context).ml}", // ActionButton(
onTap: () { // controller: _controller,
showConfirmMessage(330, widget.model); // text: "600${TranslationBase.of(context).ml}",
}, // onTap: () {
), // showConfirmMessage(600, widget.model);
ActionButton( // },
controller: _controller, // ),
text: "200${TranslationBase.of(context).ml}", // ActionButton(
onTap: () { // controller: _controller,
showConfirmMessage(200, widget.model); // text: "330${TranslationBase.of(context).ml}",
}, // onTap: () {
), // showConfirmMessage(330, widget.model);
], // },
), // ),
], // ActionButton(
), // controller: _controller,
Row( // text: "200${TranslationBase.of(context).ml}",
mainAxisAlignment: MainAxisAlignment.start, // onTap: () {
children: [ // showConfirmMessage(200, widget.model);
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), // Row(
alignment: FractionalOffset.center, // mainAxisAlignment: MainAxisAlignment.start,
child: new Icon(_controller.isDismissed ? Icons.add : Icons.close), // children: [
); // FloatingActionButton(
}, // heroTag: null,
), // child: new AnimatedBuilder(
onPressed: () { // animation: _controller,
if (_controller.isDismissed) { // builder: (BuildContext context, Widget child) {
_controller.forward(); // return new Transform(
} else { // transform: new Matrix4.rotationZ(_controller.value * 0.5 * math.pi),
_controller.reverse(); // alignment: FractionalOffset.center,
} // child: new Icon(_controller.isDismissed ? Icons.add : Icons.close),
}, // );
), // },
new Container( // ),
margin: EdgeInsets.only(left: 8, bottom: 4), // onPressed: () {
alignment: FractionalOffset.topCenter, // if (_controller.isDismissed) {
child: new ScaleTransition( // _controller.forward();
scale: new CurvedAnimation( // } else {
parent: _controller, // _controller.reverse();
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), // }
), // },
child: new FloatingActionButton( // ),
backgroundColor: Colors.white, // new Container(
heroTag: null, // margin: EdgeInsets.only(left: 8, bottom: 4),
// mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
TranslationBase.of(context).custom, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: () { // child: new FloatingActionButton(
Navigator.push( // backgroundColor: Colors.white,
context, // heroTag: null,
FadePage( // // mini: true,
page: AddCustomAmount( // child: Text(
model: widget.model, // TranslationBase.of(context).custom,
), // textAlign: TextAlign.center,
), // style: TextStyle(fontSize: 12, color: Colors.grey),
); // ),
}, // onPressed: () {
), // Navigator.push(
), // context,
), // FadePage(
new Container( // page: AddCustomAmount(
margin: EdgeInsets.only(left: 8, bottom: 4), // model: widget.model,
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, // new Container(
heroTag: null, // margin: EdgeInsets.only(left: 8, bottom: 4),
//mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
TranslationBase.of(context).undo, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12.0, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: undoVolume, // 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, // void undoVolume() async {
super(key: key); // GifLoaderDialogUtils.showMyDialog(context);
// await widget.model.undoUserActivity();
final AnimationController _controller; // GifLoaderDialogUtils.hideDialog(context);
final String text; // }
final Function onTap; // }
//
@override // class ActionButton extends StatelessWidget {
Widget build(BuildContext context) { // const ActionButton({Key key, @required AnimationController controller, @required this.text, this.onTap})
return Container( // : _controller = controller,
margin: EdgeInsets.only(left: 4, bottom: 8), // super(key: key);
alignment: FractionalOffset.topCenter, //
child: new ScaleTransition( // final AnimationController _controller;
scale: new CurvedAnimation( // final String text;
parent: _controller, // final Function onTap;
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut), //
), // @override
child: new FloatingActionButton( // Widget build(BuildContext context) {
heroTag: null, // return Container(
backgroundColor: Colors.white, // margin: EdgeInsets.only(left: 4, bottom: 8),
//mini: true, // alignment: FractionalOffset.topCenter,
child: Text( // child: new ScaleTransition(
text, // scale: new CurvedAnimation(
textAlign: TextAlign.center, // parent: _controller,
style: TextStyle(fontSize: 12.0, color: Colors.grey), // curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
), // ),
onPressed: onTap), // 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),
// ),
// );
// }
// }

@ -2,75 +2,75 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// todo 'sikander' remove useless code
class ConfirmExitPageDialog extends StatelessWidget { // class ConfirmExitPageDialog extends StatelessWidget {
final GestureTapCallback onTapYes; // final GestureTapCallback onTapYes;
final GestureTapCallback onTapNo; // final GestureTapCallback onTapNo;
//
const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo}) // const ConfirmExitPageDialog({Key key, this.onTapYes, this.onTapNo})
: super(key: key); // : super(key: key);
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return SimpleDialog( // return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), // contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center( // title: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).confirm, // TranslationBase.of(context).confirm,
color: Colors.black, // color: Colors.black,
), // ),
), // ),
children: [ // children: [
Column( // Column(
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
Texts( // Texts(
"Are you sure you want to exit this page ?", // "Are you sure you want to exit this page ?",
color: Colors.grey, // color: Colors.grey,
), // ),
SizedBox( // SizedBox(
height: 5, // height: 5,
), // ),
Divider(), // Divider(),
SizedBox( // SizedBox(
height: 5.0, // height: 5.0,
), // ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ // children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
onTapNo(); // onTapNo();
}, // },
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts( // child: Texts(
TranslationBase.of(context).no, // TranslationBase.of(context).no,
color: Colors.red, // color: Colors.red,
), // ),
), // ),
), // ),
), // ),
//
InkWell( // InkWell(
onTap: () { // onTap: () {
Navigator.pop(context); // Navigator.pop(context);
onTapYes(); // onTapYes();
}, // },
child: Container( // child: Container(
child: Center( // child: Center(
child: Texts(TranslationBase.of(context).yes), // child: Texts(TranslationBase.of(context).yes),
), // ),
), // ),
), // ),
], // ],
), // ),
SizedBox( // SizedBox(
height: 20.0, // height: 20.0,
), // ),
], // ],
) // )
], // ],
); // );
} // }
} // }

@ -30,14 +30,12 @@ class _DdServicesPageState extends State<DdServicesPage> {
void initState() { void initState() {
super.initState(); super.initState();
pageController = new PageController(); pageController = new PageController();
} }
_changePageViewIndex(int tab) { _changePageViewIndex(int tab) {
setState(() { setState(() {
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
pageController.animateToPage(tab, pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}); });
} }
@ -99,25 +97,28 @@ class _DdServicesPageState extends State<DdServicesPage> {
selectedQuestions: selectedQuestions, selectedQuestions: selectedQuestions,
triageInformationRequest: triageInformationRequest, triageInformationRequest: triageInformationRequest,
), ),
EdPaymentInformationPage(selectedHospital: triageInformationRequest.selectedHospital,) EdPaymentInformationPage(
selectedHospital: triageInformationRequest.selectedHospital,
)
], ],
), ),
); );
} }
void showConfirmMessage( // todo 'sikander' remove useless code
BuildContext context, // void showConfirmMessage(
) { // BuildContext context,
showDialog( // ) {
context: context, // showDialog(
child: ConfirmExitPageDialog( // context: context,
onTapYes: () { // child: ConfirmExitPageDialog(
Navigator.pop(context); // onTapYes: () {
}, // Navigator.pop(context);
onTapNo: () { // },
Navigator.pop(context); // onTapNo: () {
}, // Navigator.pop(context);
), // },
); // ),
} // );
// }
} }

@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
@ -50,6 +51,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
var _currentLocaleId; var _currentLocaleId;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
int selectedStatusIndex = 5;
var event = RobotProvider(); var event = RobotProvider();
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
@ -165,16 +167,16 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}); });
}, },
child: DoctorCard( child: DoctorCard(
onTap: null, onTap: null,
isInOutPatient: appointHistory.isInOutPatient, isInOutPatient: appointHistory.isInOutPatient,
name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj,
// billNo: _appointmentResult.invoiceNo, // billNo: _appointmentResult.invoiceNo,
profileUrl: appointHistory.doctorImageURL, profileUrl: appointHistory.doctorImageURL,
subName: appointHistory.projectName, subName: appointHistory.projectName,
isLiveCareAppointment: appointHistory.isLiveCareAppointment, isLiveCareAppointment: appointHistory.isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointHistory.appointmentDate), date: DateUtil.convertStringToDate(appointHistory.appointmentDate),
rating: appointHistory.actualDoctorRate + 0.0, rating: appointHistory.actualDoctorRate + 0.0,
appointmentTime: appointHistory.startTime.substring(0, 5), appointmentTime: appointHistory.startTime.substring(0, 5),
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
@ -182,8 +184,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
height: appoList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, 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, itemCount: appoList.length,
separatorBuilder: (ctx, index) => SizedBox(height: 12),
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
@ -309,6 +312,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
messageController.text = ""; messageController.text = "";
images = []; images = [];
}); });
selectedStatusIndex = 5;
setMessageType(MessageType.NON); setMessageType(MessageType.NON);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback);
@ -429,6 +433,72 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
// Show Dialog function // Show Dialog function
void confirmBox(FeedbackViewModel model) { void confirmBox(FeedbackViewModel model) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<RadioSelectionDialogModel> 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( showDialog(
context: context, context: context,
child: FeedbackTypeDialog( child: FeedbackTypeDialog(
@ -450,8 +520,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
isShowListAppointHistory = true; isShowListAppointHistory = true;
}); });
} else {} } else {}
} else { } else {}
}
}); });
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -388,11 +388,12 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
showDialogs(String message) { // todo 'sikander' remove useless code
ConfirmDialog dialog = new ConfirmDialog( // showDialogs(String message) {
context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); // ConfirmDialog dialog = new ConfirmDialog(
dialog.showAlertDialog(context); // context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {});
} // dialog.showAlertDialog(context);
// }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [ var permissionResults = [

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,11 +21,12 @@ class MedicalReports extends StatelessWidget {
void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmDialog( child: ConfirmWithMessageDialog(
appointmentHistory: model, message: TranslationBase.of(context).confirmMsgReport,
onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), onTap: () => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport),
), ),
); );
return;
} }
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -36,182 +39,100 @@ class MedicalReports extends StatelessWidget {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7), backgroundColor: Color(0xffF7F7F7),
body: ListView.separated( body: model.appointHistoryList.isEmpty
physics: BouncingScrollPhysics(), ? getNoDataWidget(context)
itemCount: model.appointHistoryList.length, : ListView.separated(
padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) => SizedBox(height: 14), itemCount: model.appointHistoryList.length,
itemBuilder: (context, index) { padding: EdgeInsets.all(21),
AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; separatorBuilder: (context, index) => SizedBox(height: 14),
return InkWell( itemBuilder: (context, index) {
onTap: () => confirmBox(model.appointHistoryList[index], model), AppointmentHistory _appointmenHistory = model.appointHistoryList[index];
child: Container( return InkWell(
decoration: BoxDecoration( onTap: () => confirmBox(model.appointHistoryList[index], model),
borderRadius: BorderRadius.all( child: Container(
Radius.circular(10.0), decoration: BoxDecoration(
), borderRadius: BorderRadius.all(
boxShadow: [ Radius.circular(10.0),
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: <Widget>[
LargeAvatar(
name: _appointmenHistory.doctorName,
url: _appointmenHistory.doctorImageURL,
width: 48,
height: 48,
), ),
SizedBox(width: 11), boxShadow: [
Expanded( BoxShadow(
child: Column( color: Color(0xff000000).withOpacity(.05),
crossAxisAlignment: CrossAxisAlignment.start, //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, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), LargeAvatar(
if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), name: _appointmenHistory.doctorName,
Row( url: _appointmenHistory.doctorImageURL,
mainAxisAlignment: MainAxisAlignment.spaceBetween, width: 48,
mainAxisSize: MainAxisSize.max, height: 48,
crossAxisAlignment: CrossAxisAlignment.start, ),
children: <Widget>[ SizedBox(width: 11),
RatingBar.readOnly( Expanded(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(), child: Column(
size: 16.0, crossAxisAlignment: CrossAxisAlignment.start,
filledColor: Color(0XFFD02127), mainAxisSize: MainAxisSize.min,
emptyColor: Color(0XFFD02127), children: <Widget>[
isHalfAllowed: true, if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic),
halfFilledIcon: Icons.star_half, if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic),
filledIcon: Icons.star, Row(
emptyIcon: Icons.star_border, mainAxisAlignment: MainAxisAlignment.spaceBetween,
), mainAxisSize: MainAxisSize.max,
Icon(Icons.email, color: Color(0xff2B353E)) crossAxisAlignment: CrossAxisAlignment.start,
], children: <Widget>[
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<ConfirmDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Texts(TranslationBase.of(context).confirm),
children: <Widget>[
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
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: <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,
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,
),
),
),
),
),
],
)
],
),
)
],
); );
} }
} }
Loading…
Cancel
Save