Merge branch 'new_design_sikander' into development_new_design_2.0

# Conflicts:
#	lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart
#	lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart
merge-requests/460/merge
Sikander Saleem 5 years ago
commit d8476df6dd

@ -51,36 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget {
}, },
)); ));
return; return;
// todo 'sikander' remove useless code
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders();
GifLoaderDialogUtils.hideDialog(context);
}
});
// await model.updateCmcPresOrder(updatePresOrderRequestModel);
// if (model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(model.error);
// } else {
// AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// await model.getCmcAllPresOrders();
// }
},
),
);
} }
return AppScaffold( return AppScaffold(

@ -95,7 +95,7 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
), ),
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.all(16), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).next, TranslationBase.of(context).next,
(this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)

@ -87,15 +87,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return PageView(
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _controller, controller: _controller,
onPageChanged: (index) { onPageChanged: (index) {
@ -186,7 +178,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.createdOn)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
@ -310,13 +302,6 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
model: widget.model, model: widget.model,
), ),
], ],
),
),
],
),
),
),
),
); );
} }
} }

@ -45,27 +45,6 @@ class OrdersLogDetailsPage extends StatelessWidget {
), ),
); );
return; return;
// todo 'sikander' remove useless code
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.iD, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getHHCAllPresOrders();
// await model.getHHCAllServices();
}
},
),
);
} }
return AppScaffold( return AppScaffold(

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

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

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

@ -126,7 +126,7 @@ class _H2oSettingState extends State<H2oSetting> {
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget(inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).name, _nameController)), inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).name, _nameController).withBorderedContainer,
SizedBox(height: 16), SizedBox(height: 16),
Text( Text(
TranslationBase.of(context).preferredunit, TranslationBase.of(context).preferredunit,
@ -210,8 +210,7 @@ class _H2oSettingState extends State<H2oSetting> {
}, },
_weightPopupList), _weightPopupList),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).dateOfBirth, DateUtil.getFormattedDate(_dobDate, "dd MMMM, yyyy"), () {
_commonDropDownView(TranslationBase.of(context).dateOfBirth, DateUtil.getFormattedDate(_dobDate, "dd MMMM, yyyy"), () {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
builder: (context) { builder: (context) {
@ -262,11 +261,10 @@ class _H2oSettingState extends State<H2oSetting> {
]), ]),
); );
}); });
}, iconData: Icons.calendar_today), }, iconData: Icons.calendar_today)
), .withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
_commonDropDownView(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < _activityLevelListEng.length; i++) RadioSelectionDialogModel(_activityLevelListEng[i], i + 1), for (int i = 0; i < _activityLevelListEng.length; i++) RadioSelectionDialogModel(_activityLevelListEng[i], i + 1),
]; ];
@ -282,8 +280,7 @@ class _H2oSettingState extends State<H2oSetting> {
}, },
), ),
); );
}), }).withBorderedContainer,
),
SizedBox(height: 18), SizedBox(height: 18),
Text( Text(
TranslationBase.of(context).reminderLabel, TranslationBase.of(context).reminderLabel,
@ -296,8 +293,7 @@ class _H2oSettingState extends State<H2oSetting> {
), ),
), ),
SizedBox(height: 12), SizedBox(height: 12),
_containerWidget( CommonDropDownView(TranslationBase.of(context).reminderTimesLabel, _remindedTimeListEng[_selectedRemindedTime], () {
_commonDropDownView(TranslationBase.of(context).reminderTimesLabel, _remindedTimeListEng[_selectedRemindedTime], () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < _remindedTimeListEng.length; i++) RadioSelectionDialogModel(_remindedTimeListEng[i], i), for (int i = 0; i < _remindedTimeListEng.length; i++) RadioSelectionDialogModel(_remindedTimeListEng[i], i),
]; ];
@ -313,8 +309,7 @@ class _H2oSettingState extends State<H2oSetting> {
}, },
), ),
); );
}), }).withBorderedContainer,
),
], ],
), ),
), ),
@ -333,58 +328,6 @@ class _H2oSettingState extends State<H2oSetting> {
); );
} }
Widget _containerWidget(Widget child) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: child,
);
}
Widget _commonDropDownView(String title, String value, VoidCallback callback, {IconData iconData}) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return InkWell( return InkWell(
onTap: hasSelection ? () {} : null, onTap: hasSelection ? () {} : null,
@ -501,8 +444,7 @@ class _H2oSettingState extends State<H2oSetting> {
Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle, Widget _commonInputAndUnitRow(_title, _controller, double _minValue, double _maxValue, double _valueOrg, Function(String) onTextValueChange, Function(double) onValueChange, String unitTitle,
Function(bool) onUnitTap, _list) { Function(bool) onUnitTap, _list) {
return _containerWidget( return Row(
Row(
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 3,
@ -567,15 +509,14 @@ class _H2oSettingState extends State<H2oSetting> {
Expanded( Expanded(
flex: 1, flex: 1,
child: PopupMenuButton( child: PopupMenuButton(
child: _commonDropDownView(TranslationBase.of(context).unit, unitTitle, null), child: CommonDropDownView(TranslationBase.of(context).unit, unitTitle, null),
onSelected: (value) { onSelected: (value) {
onUnitTap(value); onUnitTap(value);
}, },
itemBuilder: (context) => _list), itemBuilder: (context) => _list),
) )
], ],
), ).withBorderedContainer;
);
} }
void _updateUserDetails() async { void _updateUserDetails() async {
@ -627,3 +568,65 @@ class _H2oSettingState extends State<H2oSetting> {
}); });
} }
} }
// todo 'sikander' move these to separate file once usability known
class CommonDropDownView extends StatelessWidget {
final String title;
final String value;
final VoidCallback callback;
final IconData iconData;
CommonDropDownView(this.title, this.value, this.callback, {Key key, this.iconData}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: callback,
child: Row(
children: [
Expanded(
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(
title,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.44,
),
),
Text(
value,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
),
]),
),
Icon(
iconData ?? Icons.keyboard_arrow_down_sharp,
color: Color(0xff2E303A),
)
],
),
);
}
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -18,9 +17,6 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:wave/config.dart'; import 'package:wave/config.dart';
import 'package:wave/wave.dart'; import 'package:wave/wave.dart';
import 'Dialog/confirm_add_amount_dialog.dart';
import 'add_custom_amount.dart';
class TodayPage extends StatefulWidget { class TodayPage extends StatefulWidget {
TodayPage({Key key}) : super(key: key); TodayPage({Key key}) : super(key: key);

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

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
@ -10,14 +11,14 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -26,8 +27,6 @@ import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'dialogs/SelectBeneficiaryDialog.dart'; import 'dialogs/SelectBeneficiaryDialog.dart';
import 'dialogs/SelectBloodDialog.dart';
import 'dialogs/SelectGenderDialog.dart';
import 'dialogs/SelectPatientFamilyDialog.dart'; import 'dialogs/SelectPatientFamilyDialog.dart';
import 'dialogs/SelectPatientInfoDialog.dart'; import 'dialogs/SelectPatientInfoDialog.dart';
@ -44,11 +43,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController(); TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male; //Gender.NON;
Blood blood = Blood.Aminus; //Blood.NON; // Gender gender = Gender.Male; //Gender.NON;
// Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital; //HospitalsModel _selectedHospital;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0;
String amount = ""; String amount = "";
String email; String email;
PatientInfo _selectedPatientInfo; PatientInfo _selectedPatientInfo;
@ -83,104 +87,116 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Color(0xffF7F7F7),
showNewAppBarTitle: true, showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).bloodDonationInfo, description: TranslationBase.of(context).bloodDonationInfo,
appBarTitle: TranslationBase.of(context).bloodD, appBarTitle: TranslationBase.of(context).bloodD,
body: SingleChildScrollView( body: Column(
physics: ScrollPhysics(), children: [
child: Container( Expanded(
margin: EdgeInsets.all(12), child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).bloodDEnterDesc TranslationBase.of(context).bloodDEnterDesc,
), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
SizedBox( ),
height: 12, SizedBox(height: 12),
), CommonDropDownView(
InkWell( TranslationBase.of(context).city,
onTap: () => confirmSelectHospitalDialog(model.CitiesModelList), model.CitiesModelList.isNotEmpty
//model.hospitals ? projectProvider.isArabic
child: Container( ? model.CitiesModelList[_selectedHospitalIndex].descriptionN
padding: EdgeInsets.all(12), : model.CitiesModelList[_selectedHospitalIndex].description
width: double.infinity, : "", () {
height: 65, List<RadioSelectionDialogModel> list = [
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), for (int i = 0; i < model.CitiesModelList.length; i++)
child: Row( RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ];
children: [Texts(getHospitalName(projectProvider, context), color: Colors.black), Icon(Icons.arrow_drop_down)],
), showDialog(
), context: context,
), child: RadioSelectionDialog(
SizedBox( listData: list,
height: 12, selectedIndex: _selectedHospitalIndex,
), isScrollable: true,
InkWell( onValueSelected: (index) {
//======Gender======== _selectedHospitalIndex = index;
onTap: () => confirmSelectGenderDialog(), _selectedHospital = model.CitiesModelList[index];
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(getGender(context), color: Colors.black),
Icon(Icons.arrow_drop_down)
],
),
),
),
SizedBox(
height: 12,
),
InkWell(
//======Gender========
onTap: () => confirmSelectBloodDialog(),
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(getBlood(), color: Colors.black), Icon(Icons.arrow_drop_down)],
),
), ),
);
}).withBorderedContainer,
SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).gender, _selectedGenderIndex == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female, () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).male, 1),
RadioSelectionDialogModel(TranslationBase.of(context).female, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: _selectedGenderIndex,
onValueSelected: (index) {
_selectedGenderIndex = index;
setState(() {});
},
), ),
SizedBox( );
height: 12, }).withBorderedContainer,
SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, getBlood(_selectedBloodTypeIndex), () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1),
RadioSelectionDialogModel("AB+", 2),
RadioSelectionDialogModel("AB-", 3),
RadioSelectionDialogModel("A+", 4),
RadioSelectionDialogModel("A-", 5),
RadioSelectionDialogModel("B+", 6),
RadioSelectionDialogModel("B-", 7),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: _selectedBloodTypeIndex,
isScrollable: true,
onValueSelected: (index) {
_selectedBloodTypeIndex = index;
setState(() {});
},
), ),
);
}).withBorderedContainer,
SizedBox(height: 12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Text(
child: Text(
TranslationBase.of(context).viewTermsConditions + ":", TranslationBase.of(context).viewTermsConditions + ":",
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.w600, color: Color(0xff2E303A), fontSize: 14, letterSpacing: -0.56),
),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context).push(FadePage(page: UserAgreementPage())); Navigator.of(context).push(FadePage(page: UserAgreementPage()));
}, },
child: Container( child: Text(
child: Texts(
TranslationBase.of(context).clickHere, TranslationBase.of(context).clickHere,
color: Colors.blue, style: TextStyle(fontWeight: FontWeight.w600, color: Colors.blue, fontSize: 14, letterSpacing: -0.56),
fontSize: 14.0,
),
), ),
) )
], ],
), ),
SizedBox( SizedBox(height: 12),
height: 12,
),
Row( Row(
children: [ children: [
Checkbox( Checkbox(
@ -237,26 +253,25 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
), ),
), ),
bottomSheet: Container( DefaultButton(TranslationBase.of(context).save, () async {
width: double.infinity,
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(20),
child: DefaultButton(TranslationBase.of(context).save, () async {
if (_selectedHospital == null) { if (_selectedHospital == null) {
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return; return;
} }
bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = gender == Gender.Male ? 1 : 2; bloodDetails.gender = _selectedGenderIndex;
bloodDetails.bloodGroup = getBlood(_selectedBloodTypeIndex);
await model.updateBloodGroup(bloodDetails); await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} }
}), }).insideContainer
)), ],
),
),
); );
} }
@ -280,106 +295,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
} }
void confirmSelectBloodDialog() {
showDialog(
context: context,
child: SelectBloodDialog(
bloodType: blood,
onValueSelected: (value) {
setState(() {
if (value == Blood.Oplus) {
bloodDetails.bloodGroup = "O+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Ominus) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.bloodGroup = "O-";
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.ABplus) {
bloodDetails.bloodGroup = "AB+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.ABminus) {
bloodDetails.bloodGroup = "AB-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Aplus) {
bloodDetails.bloodGroup = "A+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Aminus) {
bloodDetails.bloodGroup = "A-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Bplus) {
bloodDetails.bloodGroup = "B+";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else if (value == Blood.Bminus) {
bloodDetails.bloodGroup = "B-";
// _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else
_fileTextController.text = "";
// beneficiaryType = value;
blood = value;
});
},
),
);
}
void confirmSelectGenderDialog() {
showDialog(
context: context,
child: SelectGenderDialog(
beneficiaryType: gender,
onValueSelected: (value) {
setState(() {
if (value == Gender.Male) {
// _fileTextController.text = model.user.patientID.toString();
bloodDetails.patientType = 1;
// advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName;
} else
// _fileTextController.text = "";
{
bloodDetails.gender = 2;
}
// beneficiaryType = value;
gender = value;
});
},
),
);
}
//void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
void confirmSelectHospitalDialog(List<CitiesModel> hospitals) {
showDialog(
context: context,
child: SelectCiteisDialog(
hospitals: hospitals,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedHospital = value;
});
},
),
);
}
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) { void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
showDialog( showDialog(
context: context, context: context,
@ -429,54 +344,39 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return TranslationBase.of(context).selectBeneficiary; return TranslationBase.of(context).selectBeneficiary;
} }
String getGender(BuildContext context) { String getBlood(int index) {
switch (gender) { switch (index) {
case Gender.Male: case 0:
return TranslationBase.of(context).male;
case Gender.Female:
return TranslationBase.of(context).female;
break;
case Gender.NON:
return TranslationBase.of(context).selectGender;
}
return TranslationBase.of(context).selectGender;
}
String getBlood() {
switch (blood) {
case Blood.Oplus:
return "O+"; return "O+";
break; break;
case Blood.Ominus: case 1:
return "O-"; return "O-";
break; break;
case Blood.ABplus: case 2:
return "AB+"; return "AB+";
break; break;
case Blood.ABminus: case 3:
return "AB-"; return "AB-";
break; break;
case Blood.Aplus: case 4:
return "A+"; return "A+";
break; break;
case Blood.Aminus: case 5:
return "A-"; return "A-";
break; break;
case Blood.Bplus: case 6:
return "B-"; return "B-";
break; break;
case Blood.Bminus: case 7:
return "B-"; return "B-";
break; break;
case Blood.Bplus: case 8:
return "B+"; return "B+";
break; break;
case Blood.NON: default:
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; return "";
} }
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
} }
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {

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

@ -5,8 +5,6 @@ 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';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'ConfirmExitPageDialog.dart';
import 'EdOnlineAgreementPage.dart'; import 'EdOnlineAgreementPage.dart';
import 'EdOnlineNotesPage.dart'; import 'EdOnlineNotesPage.dart';
import 'EdOnlineQuestionsPage.dart'; import 'EdOnlineQuestionsPage.dart';
@ -104,21 +102,4 @@ class _DdServicesPageState extends State<DdServicesPage> {
), ),
); );
} }
// todo 'sikander' remove useless code
// void showConfirmMessage(
// BuildContext context,
// ) {
// showDialog(
// context: context,
// child: ConfirmExitPageDialog(
// onTapYes: () {
// Navigator.pop(context);
// },
// onTapNo: () {
// Navigator.pop(context);
// },
// ),
// );
// }
} }

@ -498,42 +498,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
); );
return; return;
// todo 'sikander' remove useless code
// showDialog(
// context: context,
// child: FeedbackTypeDialog(
// messageTypeDialog: messageType,
// onValueSelected: (MessageType value) {
// if (value == 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(value);
// },
// ));
} }
openSpeechReco() async { openSpeechReco() async {
@ -587,238 +551,3 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (!mounted) return; if (!mounted) return;
} }
} }
// todo 'sikander' remove useless code
// class FeedbackTypeDialog extends StatefulWidget {
// final Function(MessageType) onValueSelected;
// final MessageType messageTypeDialog;
//
// const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key);
//
// @override
// State createState() => new FeedbackTypeDialogState();
// }
//
// class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
// MessageType messageTypeDialog = MessageType.NON;
//
// setMessageDialogType(MessageType messageType) {
// setState(() {
// messageTypeDialog = messageType;
// });
// }
//
// @override
// void initState() {
// messageTypeDialog = widget.messageTypeDialog;
//
// super.initState();
// }
//
// Widget build(BuildContext context) {
// return BaseView<FeedbackViewModel>(
// builder: (_, model, widge) => SimpleDialog(
// title: Text(
// TranslationBase.of(context).messageType,
// textAlign: TextAlign.center,
// ),
// children: <Widget>[
// Container(
// // padding: const EdgeInsets.all(10.0),
// child: Column(
// children: <Widget>[
// Divider(
// height: 2.5,
// color: Colors.grey[500],
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.NON),
// child: ListTile(
// title: Texts(TranslationBase.of(context).notClassified),
// leading: Radio(
// value: MessageType.NON,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).complainAppo),
// leading: Radio(
// value: MessageType.ComplaintOnAnAppointment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).complainWithoutAppo),
// leading: Radio(
// value: MessageType.ComplaintWithoutAppointment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Question),
// child: ListTile(
// title: Texts(TranslationBase.of(context).question),
// leading: Radio(
// value: MessageType.Question,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Compliment),
// child: ListTile(
// title: Texts(TranslationBase.of(context).compliment),
// leading: Radio(
// value: MessageType.Compliment,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// SizedBox(
// height: 5.0,
// ),
// Row(
// children: <Widget>[
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => setMessageDialogType(MessageType.Suggestion),
// child: ListTile(
// title: Texts(TranslationBase.of(context).suggestion),
// leading: Radio(
// value: MessageType.Suggestion,
// groupValue: messageTypeDialog,
// activeColor: CustomColors.accentColor,
// onChanged: (MessageType value) => setMessageDialogType(value),
// ),
// ),
// ),
// )
// ],
// ),
// 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: EdgeInsets.all(8.0),
// child: Container(
// child: Center(
// child: Texts(
// TranslationBase.of(context).cancel,
// color: CustomColors.accentColor,
// ),
// ),
// ),
// ),
// ),
// ),
// Container(
// width: 1,
// height: 30,
// color: Colors.grey[500],
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () {
// widget.onValueSelected(messageTypeDialog);
// Navigator.pop(context);
// },
// child: Padding(
// padding: const EdgeInsets.all(8.0),
// child: Center(
// child: Texts(
// TranslationBase.of(context).ok,
// fontWeight: FontWeight.w400,
// )),
// ),
// )),
// ],
// )
// ],
// ),
// ),
// ],
// ),
// );
// }
// }

@ -388,13 +388,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
// 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<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [ var permissionResults = [
Permission.location, Permission.location,

@ -111,15 +111,6 @@ class AskDoctorPage extends StatelessWidget {
); );
} }
// todo 'sikander' remove this later
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
String getDate(String date) { String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date); DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) + return DateUtil.getWeekDay(dateObj.weekday) +

@ -216,30 +216,6 @@ class _AddWeightPageState extends State<AddWeightPage> {
), ),
); );
return; return;
// todo 'sikander' remove useless code
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}) })
], ],
), ),

@ -1,5 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
extension WithContainer on DefaultButton {
Widget get insideContainer => Container(color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this);
}
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
final String text; final String text;
final VoidCallback onPress; final VoidCallback onPress;

@ -13,8 +13,9 @@ class RadioSelectionDialog extends StatefulWidget {
final Function(int) onValueSelected; final Function(int) onValueSelected;
final List<RadioSelectionDialogModel> listData; final List<RadioSelectionDialogModel> listData;
final int selectedIndex; final int selectedIndex;
final bool isScrollable;
const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex}) : super(key: key); const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex, this.isScrollable = false}) : super(key: key);
@override @override
State createState() => new RadioSelectionDialogState(); State createState() => new RadioSelectionDialogState();
@ -68,10 +69,13 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
TranslationBase.of(context).pleaseSelectFromBelowOptions, TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
ListView.separated( SizedBox(height: widget.isScrollable ? 12 : 0),
physics: NeverScrollableScrollPhysics(), SizedBox(
shrinkWrap: true, height: widget.isScrollable ? MediaQuery.of(context).size.height * .4 : null,
padding: EdgeInsets.only(bottom: 42, top: 10), child: ListView.separated(
physics: widget.isScrollable ? BouncingScrollPhysics() : NeverScrollableScrollPhysics(),
shrinkWrap: !widget.isScrollable,
padding: EdgeInsets.only(bottom: widget.isScrollable ? 21 : 42, top: 10),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Row( return Row(
children: [ children: [
@ -98,6 +102,8 @@ class RadioSelectionDialogState extends State<RadioSelectionDialog> {
}, },
separatorBuilder: (context, index) => SizedBox(height: 10), separatorBuilder: (context, index) => SizedBox(height: 10),
itemCount: widget.listData.length), itemCount: widget.listData.length),
),
SizedBox(height: widget.isScrollable ? 12 : 0),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

@ -225,34 +225,6 @@ class SMSOTP {
}); });
} }
// todo 'sikander' remove useless code
// static void showLoadingDialog(BuildContext context, bool _loading) async {
// _context = context;
// //setSignature();
// if (_loading == false) {
// Navigator.of(context).pop();
// return;
// }
// _loading = true;
// await showDialog(
// context: _context,
// barrierDismissible: false,
// builder: (BuildContext context) {
// return SimpleDialog(
// elevation: 0.0,
// backgroundColor: Colors.transparent,
// children: <Widget>[
// Center(
// child: CircularProgressIndicator(
// valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
// ),
// )
// ],
// );
// });
// }
static void hideSMSBox(context) { static void hideSMSBox(context) {
Navigator.pop(context); Navigator.pop(context);
} }

Loading…
Cancel
Save