merge changes-1

merge-update-with-lab-changes
Sikander Saleem 5 years ago
commit 14561d0ac6

@ -49,6 +49,7 @@ class UserDetailModel {
this.isNotificationON}); this.isNotificationON});
UserDetailModel.fromJson(Map<String, dynamic> json) { UserDetailModel.fromJson(Map<String, dynamic> json) {
if(json==null) return;
userID = json['UserID']; userID = json['UserID'];
patientID = json['PatientID']; patientID = json['PatientID'];
patientType = json['PatientType']; patientType = json['PatientType'];

@ -7,12 +7,9 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
class WeightService extends BaseService { class WeightService extends BaseService {
///Average ///Average
List<MonthWeightMeasurementResultAverage> List<MonthWeightMeasurementResultAverage> monthWeightMeasurementResultAverage = List();
monthWeightMeasurementResultAverage = List(); List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage = List();
List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage = List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage = List();
List();
List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage =
List();
///Result ///Result
List<WeightMeasurementResult> monthWeightMeasurementResult = List(); List<WeightMeasurementResult> monthWeightMeasurementResult = List();
@ -23,24 +20,20 @@ class WeightService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResultAverage.clear(); monthWeightMeasurementResultAverage.clear();
weekWeightMeasurementResultAverage.clear(); weekWeightMeasurementResultAverage.clear();
yearWeightMeasurementResultAverage.clear(); yearWeightMeasurementResultAverage.clear();
response['List_MonthWeightMeasurementResultAverage'].forEach((item) { response['List_MonthWeightMeasurementResultAverage'].forEach((item) {
monthWeightMeasurementResultAverage monthWeightMeasurementResultAverage.add(MonthWeightMeasurementResultAverage.fromJson(item));
.add(MonthWeightMeasurementResultAverage.fromJson(item));
}); });
response['List_WeekWeightMeasurementResultAverage'].forEach((item) { response['List_WeekWeightMeasurementResultAverage'].forEach((item) {
weekWeightMeasurementResultAverage weekWeightMeasurementResultAverage.add(WeekWeightMeasurementResultAverage.fromJson(item));
.add(WeekWeightMeasurementResultAverage.fromJson(item));
}); });
response['List_YearWeightMeasurementResultAverage'].forEach((item) { response['List_YearWeightMeasurementResultAverage'].forEach((item) {
yearWeightMeasurementResultAverage yearWeightMeasurementResultAverage.add(YearWeightMeasurementResultAverage.fromJson(item));
.add(YearWeightMeasurementResultAverage.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -50,8 +43,7 @@ class WeightService extends BaseService {
Future getWeightMeasurementResult() async { Future getWeightMeasurementResult() async {
hasError = false; hasError = false;
await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, await baseAppClient.post(GET_WEIGHT_PRESSURE_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
monthWeightMeasurementResult.clear(); monthWeightMeasurementResult.clear();
weekWeightMeasurementResult.clear(); weekWeightMeasurementResult.clear();
yearWeightMeasurementResult.clear(); yearWeightMeasurementResult.clear();
@ -61,8 +53,7 @@ class WeightService extends BaseService {
}); });
response['List_MonthWeightMeasurementResult'].forEach((item) { response['List_MonthWeightMeasurementResult'].forEach((item) {
monthWeightMeasurementResult monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item));
.add(WeightMeasurementResult.fromJson(item));
}); });
response['List_YearWeightMeasurementResult'].forEach((item) { response['List_YearWeightMeasurementResult'].forEach((item) {
@ -74,8 +65,7 @@ class WeightService extends BaseService {
}, body: Map()); }, body: Map());
} }
addWeightResult( addWeightResult({String weightDate, String weightMeasured, int weightUnit}) async {
{String weightDate, String weightMeasured, int weightUnit}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -85,15 +75,14 @@ class WeightService extends BaseService {
body['weightUnit'] = weightUnit; body['weightUnit'] = weightUnit;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {},
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
updateWeightResult({int lineItemNo, int weightUnit,String weightMeasured,String weightDate}) async { updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured, String weightDate}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -103,36 +92,36 @@ class WeightService extends BaseService {
body['WeightDate'] = weightDate; body['WeightDate'] = weightDate;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT, await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {},
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future sendReportByEmail() async { Future sendReportByEmail() async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress; body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT, await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT, onSuccess: (response, statusCode) async {},
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
deleteWeightResult({int lineItemNo, }) async { deleteWeightResult({
int lineItemNo,
}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo; body['LineItemNo'] = lineItemNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT, await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT, onSuccess: (response, statusCode) async {},
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -16,14 +16,11 @@ import '../../../core/viewModels/base_view_model.dart';
class WeightPressureViewModel extends BaseViewModel { class WeightPressureViewModel extends BaseViewModel {
WeightService weightService = locator<WeightService>(); WeightService weightService = locator<WeightService>();
List<WeightMeasurementResult> get monthWeightMeasurementResult => List<WeightMeasurementResult> get monthWeightMeasurementResult => weightService.monthWeightMeasurementResult;
weightService.monthWeightMeasurementResult;
List<WeightMeasurementResult> get weekWeightMeasurementResult => List<WeightMeasurementResult> get weekWeightMeasurementResult => weightService.weekWeightMeasurementResult;
weightService.weekWeightMeasurementResult;
List<WeightMeasurementResult> get yearWeightMeasurementResult => List<WeightMeasurementResult> get yearWeightMeasurementResult => weightService.yearWeightMeasurementResult;
weightService.yearWeightMeasurementResult;
List<TimeSeriesSales2> weightWeekTimeSeriesData = []; List<TimeSeriesSales2> weightWeekTimeSeriesData = [];
List<TimeSeriesSales3> weighMonthTimeSeriesData = []; List<TimeSeriesSales3> weighMonthTimeSeriesData = [];
@ -35,7 +32,7 @@ class WeightPressureViewModel extends BaseViewModel {
await weightService.getWeightMeasurementResult(); await weightService.getWeightMeasurementResult();
if (weightService.hasError) { if (weightService.hasError) {
error = weightService.error; error = weightService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else { } else {
weightService.weekWeightMeasurementResultAverage.forEach((element) { weightService.weekWeightMeasurementResultAverage.forEach((element) {
weightWeekTimeSeriesData.add(TimeSeriesSales2( weightWeekTimeSeriesData.add(TimeSeriesSales2(
@ -44,14 +41,10 @@ class WeightPressureViewModel extends BaseViewModel {
)); ));
}); });
for (int index = 0; for (int index = 0; index < weightService.monthWeightMeasurementResultAverage.length; index++) {
index < weightService.monthWeightMeasurementResultAverage.length;
index++) {
weighMonthTimeSeriesData.add(TimeSeriesSales3( weighMonthTimeSeriesData.add(TimeSeriesSales3(
index, index,
weightService weightService.monthWeightMeasurementResultAverage[index].weekAverageResult.toDouble(),
.monthWeightMeasurementResultAverage[index].weekAverageResult
.toDouble(),
)); ));
} }
@ -66,8 +59,7 @@ class WeightPressureViewModel extends BaseViewModel {
} }
} }
addWeightResult( addWeightResult({String weightDate, String weightMeasured, int weightUnit}) async {
{String weightDate, String weightMeasured, int weightUnit}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await weightService.addWeightResult( await weightService.addWeightResult(
weightDate: weightDate, weightDate: weightDate,
@ -82,6 +74,7 @@ class WeightPressureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future sendReportByEmail() async { Future sendReportByEmail() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -94,14 +87,10 @@ class WeightPressureViewModel extends BaseViewModel {
} }
} }
updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async { updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured, String weightDate}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await weightService.updateWeightResult( await weightService.updateWeightResult(
lineItemNo: lineItemNo, lineItemNo: lineItemNo, weightMeasured: weightMeasured, weightUnit: weightUnit, weightDate: weightDate);
weightMeasured: weightMeasured,
weightUnit: weightUnit,
weightDate: weightDate
);
if (weightService.hasError) { if (weightService.hasError) {
error = weightService.error; error = weightService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -111,7 +100,9 @@ class WeightPressureViewModel extends BaseViewModel {
} }
} }
deleteWeightResult({int lineItemNo, }) async { deleteWeightResult({
int lineItemNo,
}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await weightService.deleteWeightResult( await weightService.deleteWeightResult(
lineItemNo: lineItemNo, lineItemNo: lineItemNo,

@ -22,7 +22,7 @@ class VaccineViewModel extends BaseViewModel {
await _vaccineService.getMyVaccine(); await _vaccineService.getMyVaccine();
if (_vaccineService.hasError) { if (_vaccineService.hasError) {
error = _vaccineService.error; error = _vaccineService.error;
setState(ViewState.ErrorLocal); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -7,8 +8,14 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:shared_preferences/shared_preferences.dart';
class TodayPage extends StatelessWidget { class TodayPage extends StatelessWidget {
Future<bool> readPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<H2OViewModel>( return BaseView<H2OViewModel>(
@ -34,9 +41,30 @@ class TodayPage extends StatelessWidget {
: (model.userProgressData.percentageConsumed / 100) >= 1 : (model.userProgressData.percentageConsumed / 100) >= 1
? 1 ? 1
: (model.userProgressData.percentageConsumed / 100), : (model.userProgressData.percentageConsumed / 100),
//,
center: Center( center: Center(
child: Column( child: FutureBuilder<bool>(
future: readPrefs(),
builder: (context, data) {
var isUnitML = true;
String unit;
if (data.connectionState == ConnectionState.done) {
isUnitML = data.data;
}
if (isUnitML) {
unit = TranslationBase.of(context).ml;
} else {
unit = TranslationBase.of(context).l;
}
unit = unit.toLowerCase();
var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0;
var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0;
if (!isUnitML) {
totalH2O = totalH2O / 1000;
consumedH2O = consumedH2O / 1000;
}
var remainingH2O = totalH2O - consumedH2O;
return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
// SizedBox( // SizedBox(
@ -50,9 +78,7 @@ class TodayPage extends StatelessWidget {
height: 4, height: 4,
), ),
Text( Text(
model.userProgressData == null model.userProgressData == null ? "0.0" : "$consumedH2O $unit",
? "0.0"
: model.userProgressData.quantityConsumed.toString() + TranslationBase.of(context).ml,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
), ),
SizedBox( SizedBox(
@ -76,13 +102,14 @@ class TodayPage extends StatelessWidget {
Text( Text(
model.userProgressData == null model.userProgressData == null
? "0.0" ? "0.0"
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0 : (remainingH2O) < 0
? "0 ${TranslationBase.of(context).ml}" ? "0 $unit"
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() + : '$remainingH2O $unit',
' ${TranslationBase.of(context).ml}',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
), ),
], ],
);
},
), ),
), ),
circularStrokeCap: CircularStrokeCap.butt, circularStrokeCap: CircularStrokeCap.butt,

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
@ -8,10 +9,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.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';
class WeekPage extends StatelessWidget { class WeekPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<H2OViewModel>( return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserProgressForWeekData(), onModelReady: (model) => model.getUserProgressForWeekData(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -46,7 +49,7 @@ class WeekPage extends StatelessWidget {
], ],
), ),
// SizedBox(height: 8), // SizedBox(height: 8),
AppBarChart(seriesList: model.userProgressForWeekDataSeries), AppBarChart(seriesList: model.userProgressForWeekDataSeries,isArabic: projectViewModel.isArabic),
], ],
), ),
), ),

@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmi_calculator/bmi_calculator.dart';
import 'health_calculator/bmr_calculator/bmr_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart';
import 'health_calculator/calorie_calculator/calorie_calculator.dart'; import 'health_calculator/calorie_calculator/calorie_calculator.dart';
@ -21,8 +20,7 @@ class HealthCalculators extends StatefulWidget {
_HealthCalculatorsState createState() => _HealthCalculatorsState(); _HealthCalculatorsState createState() => _HealthCalculatorsState();
} }
class _HealthCalculatorsState extends State<HealthCalculators> class _HealthCalculatorsState extends State<HealthCalculators> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
void initState() { void initState() {
super.initState(); super.initState();
@ -67,22 +65,19 @@ class _HealthCalculatorsState extends State<HealthCalculators>
indicatorWeight: 4.0, indicatorWeight: 4.0,
indicatorColor: Colors.red, indicatorColor: Colors.red,
labelColor: Theme.of(context).buttonColor, labelColor: Theme.of(context).buttonColor,
labelPadding: labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey, unselectedLabelColor: Colors.grey,
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: Texts( child: Texts(TranslationBase.of(context).generalHealth),
TranslationBase.of(context).generalHealth),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: child: Texts(TranslationBase.of(context).womanHealth),
Texts(TranslationBase.of(context).womanHealth),
), ),
), ),
], ],
@ -121,8 +116,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmi, title: TranslationBase.of(context).bmi,
imagePath: 'bmi_health_calculator.png', imagePath: 'bmi_health_calculator.png',
subTitle: subTitle: TranslationBase.of(context).calcHealth,
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -140,8 +134,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).calories, title: TranslationBase.of(context).calories,
imagePath: 'calories-calculator.png', imagePath: 'calories-calculator.png',
subTitle: subTitle: TranslationBase.of(context).calcHealth,
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -163,8 +156,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).bmr, title: TranslationBase.of(context).bmr,
imagePath: 'BMR_calculator.png', imagePath: 'BMR_calculator.png',
subTitle: subTitle: TranslationBase.of(context).calcHealth,
TranslationBase.of(context).calcHealth,
), ),
), ),
), ),
@ -220,11 +212,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: title: TranslationBase.of(context).carbohydrate,
TranslationBase.of(context).carbohydrate,
imagePath: 'carb_protein.png', imagePath: 'carb_protein.png',
subTitle: subTitle: TranslationBase.of(context).proteinFat,
TranslationBase.of(context).proteinFat,
), ),
), ),
), ),

@ -93,9 +93,16 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: widget.appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
print("ttt "+getNextActionImage(widget
.appoList[index]
.nextAction));
print("ttt "+widget
.appoList[index]
.nextAction.toString());
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Card( child: Card(
@ -367,44 +374,32 @@ class _ToDoState extends State<ToDo> {
color: Color(0xff20bc44), color: Color(0xff20bc44),
), ),
height: 30.0, height: 30.0,
margin: projectViewModel.isArabic padding: EdgeInsets.only(right:15),
? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) margin: EdgeInsets.symmetric(horizontal:20),
: EdgeInsets.fromLTRB(20.0, 0.0, 160.0, 0.0),
transform: Matrix4.translationValues(0.0, -8.0, 0.0), transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? Container( ? Image.asset(
margin: EdgeInsets.fromLTRB( "assets/images/new-design/video.png")
5.0, 0.0, 5.0, 0.0), : Image.asset(
child: Image.asset(
"assets/images/new-design/video.png"),
)
: Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/walkin.png"), "assets/images/new-design/walkin.png"),
),
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? Container( ? Text(
child: Text(
TranslationBase.of(context).videoAppo, TranslationBase.of(context).videoAppo,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 11.0)), fontSize: 11.0))
) : Text(
: Container(
child: Text(
TranslationBase.of(context) TranslationBase.of(context)
.walkinAppo, .walkinAppo,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 11.0)), fontSize: 11.0))
)
], ],
), ),
), ),
@ -460,6 +455,10 @@ class _ToDoState extends State<ToDo> {
return "assets/images/new-design/waiting_for_doctor.png"; return "assets/images/new-design/waiting_for_doctor.png";
break; break;
case 90:
return "assets/images/new-design/check-in.png";
break;
default: default:
return ""; return "";
} }
@ -481,6 +480,9 @@ class _ToDoState extends State<ToDo> {
break; break;
case 60: case 60:
break; break;
case 90:
getAppoQR(context, appo);
break;
} }
} }
@ -517,6 +519,10 @@ class _ToDoState extends State<ToDo> {
return TranslationBase.of(context).waitingForDoctor; return TranslationBase.of(context).waitingForDoctor;
break; break;
case 90:
return TranslationBase.of(context).checkinOptions;
break;
default: default:
return ""; return "";
} }

@ -93,16 +93,24 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height*0.4,), SizedBox(
Image.asset('assets/images/comments.png',width: 80,height: 80,), height: MediaQuery.of(context).size.height * 0.4,
SizedBox(height: 15,), ),
Image.asset(
'assets/images/comments.png',
width: 80,
height: 80,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).noSearchResult), Texts(TranslationBase.of(context).noSearchResult),
], ],
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: 80,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: Center( child: Center(
@ -112,8 +120,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
label: TranslationBase.of(context).search, label: TranslationBase.of(context).search,
textColor: Colors.white, textColor: Colors.white,
disabled: true, disabled: true,
onTap: () { onTap: () {},
},
), ),
), ),
), ),

@ -20,8 +20,7 @@ class WeightHomePage extends StatefulWidget {
_WeightHomePageState createState() => _WeightHomePageState(); _WeightHomePageState createState() => _WeightHomePageState();
} }
class _WeightHomePageState extends State<WeightHomePage> class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -42,8 +41,10 @@ class _WeightHomePageState extends State<WeightHomePage>
onModelReady: (model) => model.getWeight(), onModelReady: (model) => model.getWeight(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).weight, appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [IconButton( appBarIcons: [
IconButton(
icon: Icon(Icons.email), icon: Icon(Icons.email),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
@ -51,16 +52,18 @@ class _WeightHomePageState extends State<WeightHomePage>
context: context, context: context,
child: ConfirmSendEmailDialog( child: ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user.emailAddress,
onTapSendEmail: () async{ onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) { model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal){ if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
}else{ } else {
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
} }
}).catchError((e){ }).catchError((e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
}); });
@ -68,7 +71,8 @@ class _WeightHomePageState extends State<WeightHomePage>
), ),
); );
}, },
),], ),
],
baseViewModel: model, baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -98,7 +102,12 @@ class _WeightHomePageState extends State<WeightHomePage>
), ),
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AddWeightPage(model: model,))); Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
)));
}, },
child: Container( child: Container(
width: 55, width: 55,

@ -28,7 +28,23 @@ class WeightMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( isShowDecPage: false,
body: model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
@ -66,8 +82,7 @@ class WeightMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -76,12 +91,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -109,12 +120,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -1,5 +1,3 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
@ -26,7 +24,23 @@ class WeightWeeklyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( isShowDecPage: false,
body: model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -35,7 +49,7 @@ class WeightWeeklyPage extends StatelessWidget {
horizontalInterval: 1.0, horizontalInterval: 1.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData, timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5, indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
), ),
), ),
SizedBox( SizedBox(
@ -65,8 +79,7 @@ class WeightWeeklyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -75,12 +88,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -120,12 +129,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -18,15 +18,32 @@ import 'package:provider/provider.dart';
class WeightYearPage extends StatelessWidget { class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model; final WeightPressureViewModel model;
const WeightYearPage({
const WeightYearPage({Key key, this.model, }) Key key,
: super(key: key); this.model,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView( isShowDecPage: false,
body: model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
),
)
: ListView(
children: [ children: [
Container( Container(
width: double.maxFinite, width: double.maxFinite,
@ -35,9 +52,8 @@ class WeightYearPage extends StatelessWidget {
horizontalInterval: 2.0, horizontalInterval: 2.0,
title: TranslationBase.of(context).weight, title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData, timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5, indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
) )),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -65,8 +81,7 @@ class WeightYearPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -75,12 +90,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -108,12 +119,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -3,10 +3,12 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter/services.dart';
import 'analytics/google-analytics.dart';
import 'config/shared_pref_kay.dart'; import 'config/shared_pref_kay.dart';
import 'config/size_config.dart'; import 'config/size_config.dart';
import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/AuthenticatedUserObject.dart';

@ -478,11 +478,12 @@ class TranslationBase {
String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode];
String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode];
String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; String get checkinOptions => localizedValues['checkinOption'][locale.languageCode];
String get alhabiServices =>
String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode]; localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle =>
localizedValues['parkingTitle'][locale.languageCode];
String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; String get readBarcode => localizedValues['readBarcode'][locale.languageCode];
String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; String get showMyPark => localizedValues['showMyPark'][locale.languageCode];
@ -817,8 +818,10 @@ class TranslationBase {
String get reviewComment => localizedValues['reviewComment'][locale.languageCode]; String get reviewComment => localizedValues['reviewComment'][locale.languageCode];
String get shippedMethod => localizedValues['shippedMethod'][locale.languageCode]; String get shippedMethod => localizedValues['shippedMethod'][locale.languageCode];
String get orderDetail => localizedValues['orderDetail'][locale.languageCode]; String get orderDetail => localizedValues['orderDetail'][locale.languageCode];
String get deliveryDriverTrack => localizedValues['DeliveryDriverTrack'][locale.languageCode]; String get deliveryDriverTrack =>
String get deliveryLocation => localizedValues['DeliveryLocation'][locale.languageCode]; localizedValues['DeliveryDriverTrack'][locale.languageCode];
String get deliveryLocation =>
localizedValues['DeliveryLocation'][locale.languageCode];
String get driver => localizedValues['Driver'][locale.languageCode]; String get driver => localizedValues['Driver'][locale.languageCode];
String get subtotal => localizedValues['subtotal'][locale.languageCode]; String get subtotal => localizedValues['subtotal'][locale.languageCode];
String get shipping => localizedValues['shipping'][locale.languageCode]; String get shipping => localizedValues['shipping'][locale.languageCode];
@ -1143,22 +1146,25 @@ class TranslationBase {
String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; String get searchItemError => localizedValues['searchItemError'][locale.languageCode];
String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode];
String get itemInSearch =>
String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; localizedValues['ItemInSearch'][locale.languageCode];
String get bloodDonation =>
String get bloodDonation => localizedValues['blood-donation'][locale.languageCode]; localizedValues['blood-donation'][locale.languageCode];
String get bloodDonationInfo =>
String get bloodInstruction => localizedValues['blood-instruction'][locale.languageCode]; localizedValues['blood-donation-info'][locale.languageCode];
String get bloodTermsNcondition => localizedValues['view-terms'][locale.languageCode]; String get bloodInstruction =>
localizedValues['blood-instruction'][locale.languageCode];
String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; String get bloodTermsNcondition =>
localizedValues['view-terms'][locale.languageCode];
String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; String get wantToConnectWithHmgNetwork =>
localizedValues['wantConnectHmgNetwork'][locale.languageCode];
String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; String get failedToAccessHmgServices =>
localizedValues['failedToAccessHmgServices'][locale.languageCode];
String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; String get enablingWifi =>
localizedValues['enablingWifi'][locale.languageCode];
String get offerAndPackages =>
localizedValues['offerAndPackages'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
@ -1249,15 +1255,16 @@ class TranslationBase {
String get erContant => localizedValues['er-contant'][locale.languageCode]; String get erContant => localizedValues['er-contant'][locale.languageCode];
String get er => localizedValues['er'][locale.languageCode]; String get er => localizedValues['er'][locale.languageCode];
String get transportationService =>
String get transportationService => localizedValues['transportation-Service'][locale.languageCode]; localizedValues['transportation-Service'][locale.languageCode];
String get infoAmbulance =>
String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode]; localizedValues['info-ambulance'][locale.languageCode];
String get transportHeading =>
String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode]; localizedValues['RRT-transport-heading'][locale.languageCode];
String get directionHeading =>
String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; localizedValues['RRT-direction-heading'][locale.languageCode];
String get wayHeading =>
localizedValues['RRT-way-heading'][locale.languageCode];
String get toHospital => localizedValues['to-hospital'][locale.languageCode]; String get toHospital => localizedValues['to-hospital'][locale.languageCode];
String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; String get fromHospital => localizedValues['from-hospital'][locale.languageCode];
@ -1299,7 +1306,15 @@ class TranslationBase {
String get none => localizedValues['none'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode];
String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode];
String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode];
String get RRTDDetails => localizedValues['RRTDDetails'][locale.languageCode];
String get ApproximateServiceFee => localizedValues['ApproximateServiceFee'][locale.languageCode];
String get AmountBeforeTax => localizedValues['AmountBeforeTax'][locale.languageCode];
String get TaxAmount => localizedValues['TaxAmount'][locale.languageCode];
String get TotalAmountPayable => localizedValues['TotalAmountPayable'][locale.languageCode];
String get iAcceptTermsConditions => localizedValues['iAcceptTermsConditions'][locale.languageCode];
String get YouCanPayByTheFollowingOptions => localizedValues['YouCanPayByTheFollowingOptions'][locale.languageCode];
String get rrtService => localizedValues['rrtService'][locale.languageCode];
String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode];
String get transportMethod => localizedValues['transport-method'][locale.languageCode]; String get transportMethod => localizedValues['transport-method'][locale.languageCode];
@ -1828,31 +1843,34 @@ class TranslationBase {
String get areyousure => localizedValues["areyousure"][locale.languageCode]; String get areyousure => localizedValues["areyousure"][locale.languageCode];
// Offer And Packahes // Offer And Packahes
String get subT => localizedValues['OffersAndPackages'][locale.languageCode]; String get subT => localizedValues['OffersAndPackages'][locale.languageCode];
String get totalWithColonRight =>
String get totalWithColonRight => localizedValues['totalWithColonRight'][locale.languageCode]; localizedValues['totalWithColonRight'][locale.languageCode];
String get preferredunit => localizedValues["preferredunit"][locale.languageCode]; String get preferredunit => localizedValues["preferredunit"][locale.languageCode];
String get trySaying => localizedValues["try-saying"][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode];
String get somethingWentWrong =>
String get enterIdentificationNumber => localizedValues["enterIdentificationNumber"][locale.languageCode]; localizedValues["somethingWentWrong"][locale.languageCode];
String get accountActivationDesc => localizedValues["accountActivationDesc"][locale.languageCode]; String get enterIdentificationNumber =>
localizedValues["enterIdentificationNumber"][locale.languageCode];
String get pointsToTransfer => localizedValues["pointsToTransfer"][locale.languageCode]; String get accountActivationDesc =>
localizedValues["accountActivationDesc"][locale.languageCode];
String get enterBeneficiaryAccountNo => localizedValues["enterBeneficiaryAccountNo"][locale.languageCode]; String get pointsToTransfer =>
localizedValues["pointsToTransfer"][locale.languageCode];
String get confirmPrescription => localizedValues["confirm-prescription"][locale.languageCode]; String get enterBeneficiaryAccountNo =>
localizedValues["enterBeneficiaryAccountNo"][locale.languageCode];
String get youAlreadyHaveOrder => localizedValues["you-already-have-order"][locale.languageCode]; String get confirmPrescription =>
localizedValues["confirm-prescription"][locale.languageCode];
String get orderOverview => localizedValues["order-overview"][locale.languageCode]; String get youAlreadyHaveOrder =>
localizedValues["you-already-have-order"][locale.languageCode];
String get shippingAddresss => localizedValues["shipping-address"][locale.languageCode]; String get orderOverview =>
localizedValues["order-overview"][locale.languageCode];
String get shippingAddresss =>
localizedValues["shipping-address"][locale.languageCode];
String get covidAlert => localizedValues["covid-alert"][locale.languageCode]; String get covidAlert => localizedValues["covid-alert"][locale.languageCode];
String get pharmacyRelogin => localizedValues["pharmacy-relogin"][locale.languageCode]; String get pharmacyRelogin => localizedValues["pharmacy-relogin"][locale.languageCode];
@ -1878,16 +1896,36 @@ class TranslationBase {
String get insuranceID => localizedValues["insurance-id"][locale.languageCode]; String get insuranceID => localizedValues["insurance-id"][locale.languageCode];
String get enterFile => localizedValues["enter-file"][locale.languageCode]; String get enterFile => localizedValues["enter-file"][locale.languageCode];
String get feedbackType => localizedValues["feedback-type"][locale.languageCode];
String get enterReferralRequesterName => localizedValues["enterReferralRequesterName"][locale.languageCode];
String get allow => localizedValues["allow"][locale.languageCode];
String get selectRelationship => localizedValues["selectRelationship"][locale.languageCode]; String get reject => localizedValues["reject"][locale.languageCode];
String get enterReferralRequesterName =>
String get requesterRelationship => localizedValues["requesterRelationship"][locale.languageCode]; localizedValues["enterReferralRequesterName"][locale.languageCode];
String get selectRelationship =>
localizedValues["selectRelationship"][locale.languageCode];
String get requesterRelationship =>
localizedValues["requesterRelationship"][locale.languageCode];
String get newReferral => localizedValues["newReferral"][locale.languageCode]; String get newReferral => localizedValues["newReferral"][locale.languageCode];
String get searchForReferrals =>
localizedValues["searchForReferrals"][locale.languageCode];
String get covidSelectProcedure =>
localizedValues["covid-select-procedure"][locale.languageCode];
String get onlineConsultation =>
localizedValues["online-consultation"][locale.languageCode];
String get expectedWaiting =>
localizedValues["expected-weiting"][locale.languageCode];
String get erConsultFee =>
localizedValues["er-consult-fee"][locale.languageCode];
String get insuredPatient =>
localizedValues["insured-patient"][locale.languageCode];
String get iAcceptTerms =>
localizedValues["i-accept-terms"][locale.languageCode];
String get upComingPayOption =>
localizedValues["upcoming-pay-options"][locale.languageCode];
String get pleaseAcceptTerms =>
localizedValues["please-accept-terms"][locale.languageCode];
String get searchForReferrals => localizedValues["searchForReferrals"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -141,7 +141,7 @@ class Utils {
} }
String loginIDPattern(loginType) { String loginIDPattern(loginType) {
var length = loginType == 1 ? 10 : 7; var length = loginType == 1 ? 10 : 6;
return "([0-9]{" + length.toString() + "})"; return "([0-9]{" + length.toString() + "})";
} }
@ -592,7 +592,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null, onTap: () =>
projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png', imagePath: 'active_medications.png',
@ -602,7 +603,24 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, onTap: () => projectViewModel.havePrivilege(6)
? Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
));
medical.add(InkWell(
onTap: () =>
projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png', imagePath: 'eye_measurement_icon.png',
@ -633,7 +651,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null, onTap: () =>
projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -663,7 +682,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, onTap: () =>
projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
@ -673,7 +693,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, onTap: () =>
projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png', imagePath: 'monthly_reports_icon.png',
@ -683,7 +704,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, onTap: () =>
projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png', imagePath: 'sick_leaves_icons.png',
@ -702,6 +724,7 @@ class Utils {
), ),
)); ));
// TODO mosa check it
medical.add(MedicalProfileItem( medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall, title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png', imagePath: 'medical_history_icon.png',
@ -807,6 +830,7 @@ Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, doubl
); );
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER)); var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
@ -830,6 +854,25 @@ openAppStore({String androidPackageName, String iOSAppID}) async {
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
} }
} }
String labelFrom({@required String className}){
RegExp exp = RegExp(r'(?<=[a-z])[A-Z]');
String result = className.replaceAllMapped(exp, (m) {
var str = m.group(0);
if(str != null){
return ('_' + str);
}
return "";
});
if(result.isEmpty)
return className;
result = result.replaceAll("_", " ");
return result;
}
/* /*
userBoard.asMap().map((i, element) => MapEntry(i, Stack( userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () { GestureDetector(onTap: () {

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,6 +16,7 @@ class _TyperState extends State<TyperAnimatedTextKit>
Animation<int> _characterCount; Animation<int> _characterCount;
AnimationController _controller; AnimationController _controller;
int _stringIndex; int _stringIndex;
var event = RobotProvider();
@override @override
void initState() { void initState() {
_controller = new AnimationController( _controller = new AnimationController(

@ -0,0 +1,27 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../lib/main.dart';
void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that platform version is retrieved.
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text && widget.data.startsWith('Running on:'),
),
findsOneWidget,
);
});
}

@ -0,0 +1,134 @@
import 'package:flutter/services.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
/// Holds a set of responses and acts as a mock for the platform specific
/// implementations allowing test cases to determine what the result of
/// a call should be.
class TestSpeechChannelHandler {
final SpeechToText _speech;
bool listenException = false;
static const String listenExceptionCode = "listenFailedError";
static const String listenExceptionMessage = "Failed";
static const String listenExceptionDetails = "Device Listen Failure";
TestSpeechChannelHandler(this._speech);
bool initResult = true;
bool initInvoked = false;
bool listenInvoked = false;
bool cancelInvoked = false;
bool stopInvoked = false;
bool localesInvoked = false;
bool hasPermissionResult = true;
String listeningStatusResponse = SpeechToText.listeningStatus;
String listenLocale;
List<String> locales = [];
static const String localeId1 = "en_US";
static const String localeId2 = "fr_CA";
static const String name1 = "English US";
static const String name2 = "French Canada";
static const String locale1 = "$localeId1:$name1";
static const String locale2 = "$localeId2:$name2";
static const String firstRecognizedWords = 'hello';
static const String secondRecognizedWords = 'hello there';
static const double firstConfidence = 0.85;
static const double secondConfidence = 0.62;
static const String firstRecognizedJson =
'{"alternates":[{"recognizedWords":"$firstRecognizedWords","confidence":$firstConfidence}],"finalResult":false}';
static const String secondRecognizedJson =
'{"alternates":[{"recognizedWords":"$secondRecognizedWords","confidence":$secondConfidence}],"finalResult":false}';
static const String finalRecognizedJson =
'{"alternates":[{"recognizedWords":"$secondRecognizedWords","confidence":$secondConfidence}],"finalResult":true}';
static const SpeechRecognitionWords firstWords =
SpeechRecognitionWords(firstRecognizedWords, firstConfidence);
static const SpeechRecognitionWords secondWords =
SpeechRecognitionWords(secondRecognizedWords, secondConfidence);
static final SpeechRecognitionResult firstRecognizedResult =
SpeechRecognitionResult([firstWords], false);
static final SpeechRecognitionResult secondRecognizedResult =
SpeechRecognitionResult([secondWords], false);
static final SpeechRecognitionResult finalRecognizedResult =
SpeechRecognitionResult([secondWords], true);
static const String transientErrorJson =
'{"errorMsg":"network","permanent":false}';
static const String permanentErrorJson =
'{"errorMsg":"network","permanent":true}';
static final SpeechRecognitionError firstError =
SpeechRecognitionError("network", true);
static const double level1 = 0.5;
static const double level2 = 10;
Future<dynamic> methodCallHandler(MethodCall methodCall) async {
switch (methodCall.method) {
case "has_permission":
return hasPermissionResult;
break;
case "initialize":
initInvoked = true;
return initResult;
break;
case "cancel":
cancelInvoked = true;
return true;
break;
case "stop":
stopInvoked = true;
return true;
break;
case SpeechToText.listenMethod:
listenInvoked = true;
if (listenException) {
throw PlatformException(
code: listenExceptionCode,
message: listenExceptionMessage,
details: listenExceptionDetails);
}
listenLocale = methodCall.arguments["localeId"];
await _speech.processMethodCall(MethodCall(
SpeechToText.notifyStatusMethod, listeningStatusResponse));
return initResult;
break;
case "locales":
localesInvoked = true;
return locales;
break;
default:
}
return initResult;
}
void notifyFinalWords() {
_speech.processMethodCall(
MethodCall(SpeechToText.textRecognitionMethod, finalRecognizedJson));
}
void notifyPartialWords() {
_speech.processMethodCall(
MethodCall(SpeechToText.textRecognitionMethod, firstRecognizedJson));
}
void notifyPermanentError() {
_speech.processMethodCall(
MethodCall(SpeechToText.notifyErrorMethod, permanentErrorJson));
}
void notifyTransientError() {
_speech.processMethodCall(
MethodCall(SpeechToText.notifyErrorMethod, transientErrorJson));
}
void notifySoundLevel() {
_speech.processMethodCall(
MethodCall(SpeechToText.soundLevelChangeMethod, level2));
}
void setupLocales() {
locales.clear();
locales.add(locale1);
locales.add(locale2);
}
}

@ -0,0 +1,36 @@
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text_provider.dart';
/// Holds the results of notification by the [SpeechToTextProvider]
class TestSpeechListener {
final SpeechToTextProvider _speechProvider;
bool isListening = false;
bool isFinal = false;
bool isAvailable = false;
bool notified = false;
bool hasError = false;
SpeechRecognitionResult recognitionResult;
SpeechRecognitionError lastError;
double soundLevel;
TestSpeechListener(this._speechProvider);
void reset() {
isListening = false;
isFinal = false;
isAvailable = false;
notified = false;
}
void onNotify() {
notified = true;
isAvailable = _speechProvider.isAvailable;
isListening = _speechProvider.isListening;
recognitionResult = _speechProvider.lastResult;
hasError = _speechProvider.hasError;
lastError = _speechProvider.lastError;
soundLevel = _speechProvider.lastLevel;
}
}
Loading…
Cancel
Save