merge changes-1

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

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

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

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

@ -22,7 +22,7 @@ class VaccineViewModel extends BaseViewModel {
await _vaccineService.getMyVaccine();
if (_vaccineService.hasError) {
error = _vaccineService.error;
setState(ViewState.ErrorLocal);
setState(ViewState.Error);
} else
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/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.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:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:shared_preferences/shared_preferences.dart';
class TodayPage extends StatelessWidget {
Future<bool> readPrefs() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false;
}
@override
Widget build(BuildContext context) {
return BaseView<H2OViewModel>(
@ -34,55 +41,75 @@ class TodayPage extends StatelessWidget {
: (model.userProgressData.percentageConsumed / 100) >= 1
? 1
: (model.userProgressData.percentageConsumed / 100),
//,
center: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// SizedBox(
// height: 40,
// ),
Text(
TranslationBase.of(context).consumed,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: model.userProgressData.quantityConsumed.toString() + TranslationBase.of(context).ml,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
),
SizedBox(
height: 5,
width: 50,
child: Container(),
),
SizedBox(
height: 4,
),
Text(
TranslationBase.of(context).remaining,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed) < 0
? "0 ${TranslationBase.of(context).ml}"
: (model.userProgressData.quantityLimit - model.userProgressData.quantityConsumed).toString() +
' ${TranslationBase.of(context).ml}',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
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,
children: [
// SizedBox(
// height: 40,
// ),
Text(
TranslationBase.of(context).consumed,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null ? "0.0" : "$consumedH2O $unit",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
),
SizedBox(
height: 5,
width: 50,
child: Container(),
),
SizedBox(
height: 4,
),
Text(
TranslationBase.of(context).remaining,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: (remainingH2O) < 0
? "0 $unit"
: '$remainingH2O $unit',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
);
},
),
),
circularStrokeCap: CircularStrokeCap.butt,

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.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/uitl/translations_delegate_base.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class WeekPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserProgressForWeekData(),
builder: (_, model, widget) => AppScaffold(
@ -46,7 +49,7 @@ class WeekPage extends StatelessWidget {
],
),
// 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:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'health_calculator/bmi_calculator/bmi_calculator.dart';
import 'health_calculator/bmr_calculator/bmr_calculator.dart';
import 'health_calculator/calorie_calculator/calorie_calculator.dart';
@ -21,8 +20,7 @@ class HealthCalculators extends StatefulWidget {
_HealthCalculatorsState createState() => _HealthCalculatorsState();
}
class _HealthCalculatorsState extends State<HealthCalculators>
with SingleTickerProviderStateMixin {
class _HealthCalculatorsState extends State<HealthCalculators> with SingleTickerProviderStateMixin {
TabController _tabController;
void initState() {
super.initState();
@ -67,22 +65,19 @@ class _HealthCalculatorsState extends State<HealthCalculators>
indicatorWeight: 4.0,
indicatorColor: Colors.red,
labelColor: Theme.of(context).buttonColor,
labelPadding:
EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey,
tabs: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts(
TranslationBase.of(context).generalHealth),
child: Texts(TranslationBase.of(context).generalHealth),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child:
Texts(TranslationBase.of(context).womanHealth),
child: Texts(TranslationBase.of(context).womanHealth),
),
),
],
@ -121,8 +116,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem(
title: TranslationBase.of(context).bmi,
imagePath: 'bmi_health_calculator.png',
subTitle:
TranslationBase.of(context).calcHealth,
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -140,8 +134,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem(
title: TranslationBase.of(context).calories,
imagePath: 'calories-calculator.png',
subTitle:
TranslationBase.of(context).calcHealth,
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -163,8 +156,7 @@ class _HealthCalculatorsState extends State<HealthCalculators>
child: MedicalProfileItem(
title: TranslationBase.of(context).bmr,
imagePath: 'BMR_calculator.png',
subTitle:
TranslationBase.of(context).calcHealth,
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -220,11 +212,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title:
TranslationBase.of(context).carbohydrate,
title: TranslationBase.of(context).carbohydrate,
imagePath: 'carb_protein.png',
subTitle:
TranslationBase.of(context).proteinFat,
subTitle: TranslationBase.of(context).proteinFat,
),
),
),

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

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

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

@ -28,46 +28,61 @@ class WeightMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weighMonthTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
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,
),
),
children: fullData(context, projectViewModel, model),
),
),
)
: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -76,12 +91,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -109,12 +120,8 @@ class WeightMonthlyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
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/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
@ -26,47 +24,62 @@ class WeightWeeklyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weightWeekTimeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
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,
),
),
children: fullData(context, projectViewModel, model),
),
),
)
: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -75,12 +88,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -120,12 +129,8 @@ class WeightWeeklyPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(

@ -18,55 +18,70 @@ import 'package:provider/provider.dart';
class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model;
const WeightYearPage({Key key, this.model, })
: super(key: key);
const WeightYearPage({
Key key,
this.model,
}) : super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: model.weightYearTimeSeriesData.isEmpty ? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),) : ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
)
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
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,
),
),
children: fullData(context, projectViewModel, model),
),
),
)
: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
],
),
);
}
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -75,12 +90,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
),
),
child: Center(
@ -108,12 +119,8 @@ class WeightYearPage extends StatelessWidget {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
),
),
child: Center(
@ -128,7 +135,7 @@ class WeightYearPage extends StatelessWidget {
),
);
model.yearWeightMeasurementResult.forEach(
(diabtec) {
(diabtec) {
tableRow.add(
TableRow(
children: [

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

@ -478,11 +478,12 @@ class TranslationBase {
String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode];
String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode];
String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode];
String get checkinOptions => localizedValues['checkinOption'][locale.languageCode];
String get alhabiServices =>
localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle =>
localizedValues['parkingTitle'][locale.languageCode];
String get readBarcode => localizedValues['readBarcode'][locale.languageCode];
String get showMyPark => localizedValues['showMyPark'][locale.languageCode];
@ -817,8 +818,10 @@ class TranslationBase {
String get reviewComment => localizedValues['reviewComment'][locale.languageCode];
String get shippedMethod => localizedValues['shippedMethod'][locale.languageCode];
String get orderDetail => localizedValues['orderDetail'][locale.languageCode];
String get deliveryDriverTrack => localizedValues['DeliveryDriverTrack'][locale.languageCode];
String get deliveryLocation => localizedValues['DeliveryLocation'][locale.languageCode];
String get deliveryDriverTrack =>
localizedValues['DeliveryDriverTrack'][locale.languageCode];
String get deliveryLocation =>
localizedValues['DeliveryLocation'][locale.languageCode];
String get driver => localizedValues['Driver'][locale.languageCode];
String get subtotal => localizedValues['subtotal'][locale.languageCode];
String get shipping => localizedValues['shipping'][locale.languageCode];
@ -1143,22 +1146,25 @@ class TranslationBase {
String get searchItemError => localizedValues['searchItemError'][locale.languageCode];
String get youCanFind => localizedValues['YouCanFind'][locale.languageCode];
String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode];
String get bloodDonation => localizedValues['blood-donation'][locale.languageCode];
String get bloodInstruction => localizedValues['blood-instruction'][locale.languageCode];
String get bloodTermsNcondition => localizedValues['view-terms'][locale.languageCode];
String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode];
String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode];
String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode];
String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode];
String get itemInSearch =>
localizedValues['ItemInSearch'][locale.languageCode];
String get bloodDonation =>
localizedValues['blood-donation'][locale.languageCode];
String get bloodDonationInfo =>
localizedValues['blood-donation-info'][locale.languageCode];
String get bloodInstruction =>
localizedValues['blood-instruction'][locale.languageCode];
String get bloodTermsNcondition =>
localizedValues['view-terms'][locale.languageCode];
String get wantToConnectWithHmgNetwork =>
localizedValues['wantConnectHmgNetwork'][locale.languageCode];
String get failedToAccessHmgServices =>
localizedValues['failedToAccessHmgServices'][locale.languageCode];
String get enablingWifi =>
localizedValues['enablingWifi'][locale.languageCode];
String get offerAndPackages =>
localizedValues['offerAndPackages'][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 er => localizedValues['er'][locale.languageCode];
String get transportationService => localizedValues['transportation-Service'][locale.languageCode];
String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode];
String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode];
String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode];
String get transportationService =>
localizedValues['transportation-Service'][locale.languageCode];
String get infoAmbulance =>
localizedValues['info-ambulance'][locale.languageCode];
String get transportHeading =>
localizedValues['RRT-transport-heading'][locale.languageCode];
String get directionHeading =>
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 fromHospital => localizedValues['from-hospital'][locale.languageCode];
@ -1299,7 +1306,15 @@ class TranslationBase {
String get none => localizedValues['none'][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 transportMethod => localizedValues['transport-method'][locale.languageCode];
@ -1828,31 +1843,34 @@ class TranslationBase {
String get areyousure => localizedValues["areyousure"][locale.languageCode];
// Offer And Packahes
String get subT => localizedValues['OffersAndPackages'][locale.languageCode];
String get totalWithColonRight => localizedValues['totalWithColonRight'][locale.languageCode];
String get totalWithColonRight =>
localizedValues['totalWithColonRight'][locale.languageCode];
String get preferredunit => localizedValues["preferredunit"][locale.languageCode];
String get trySaying => localizedValues["try-saying"][locale.languageCode];
String get enterIdentificationNumber => localizedValues["enterIdentificationNumber"][locale.languageCode];
String get accountActivationDesc => localizedValues["accountActivationDesc"][locale.languageCode];
String get pointsToTransfer => localizedValues["pointsToTransfer"][locale.languageCode];
String get enterBeneficiaryAccountNo => localizedValues["enterBeneficiaryAccountNo"][locale.languageCode];
String get confirmPrescription => localizedValues["confirm-prescription"][locale.languageCode];
String get youAlreadyHaveOrder => localizedValues["you-already-have-order"][locale.languageCode];
String get orderOverview => localizedValues["order-overview"][locale.languageCode];
String get shippingAddresss => localizedValues["shipping-address"][locale.languageCode];
String get somethingWentWrong =>
localizedValues["somethingWentWrong"][locale.languageCode];
String get enterIdentificationNumber =>
localizedValues["enterIdentificationNumber"][locale.languageCode];
String get accountActivationDesc =>
localizedValues["accountActivationDesc"][locale.languageCode];
String get pointsToTransfer =>
localizedValues["pointsToTransfer"][locale.languageCode];
String get enterBeneficiaryAccountNo =>
localizedValues["enterBeneficiaryAccountNo"][locale.languageCode];
String get confirmPrescription =>
localizedValues["confirm-prescription"][locale.languageCode];
String get youAlreadyHaveOrder =>
localizedValues["you-already-have-order"][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 pharmacyRelogin => localizedValues["pharmacy-relogin"][locale.languageCode];
@ -1878,16 +1896,36 @@ class TranslationBase {
String get insuranceID => localizedValues["insurance-id"][locale.languageCode];
String get enterFile => localizedValues["enter-file"][locale.languageCode];
String get enterReferralRequesterName => localizedValues["enterReferralRequesterName"][locale.languageCode];
String get selectRelationship => localizedValues["selectRelationship"][locale.languageCode];
String get requesterRelationship => localizedValues["requesterRelationship"][locale.languageCode];
String get feedbackType => localizedValues["feedback-type"][locale.languageCode];
String get allow => localizedValues["allow"][locale.languageCode];
String get reject => localizedValues["reject"][locale.languageCode];
String get enterReferralRequesterName =>
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 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> {

@ -141,7 +141,7 @@ class Utils {
}
String loginIDPattern(loginType) {
var length = loginType == 1 ? 10 : 7;
var length = loginType == 1 ? 10 : 6;
return "([0-9]{" + length.toString() + "})";
}
@ -592,7 +592,8 @@ class Utils {
));
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(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
@ -602,7 +603,24 @@ class Utils {
));
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(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
@ -633,7 +651,8 @@ class Utils {
));
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(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
@ -663,7 +682,8 @@ class Utils {
));
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(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
@ -673,7 +693,8 @@ class Utils {
));
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(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
@ -683,7 +704,8 @@ class Utils {
));
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(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
@ -702,6 +724,7 @@ class Utils {
),
));
// TODO mosa check it
medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
@ -807,6 +830,7 @@ Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, doubl
);
}
Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
return userData;
@ -830,6 +854,25 @@ openAppStore({String androidPackageName, String iOSAppID}) async {
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(
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:flutter/material.dart';
@ -14,6 +16,7 @@ class _TyperState extends State<TyperAnimatedTextKit>
Animation<int> _characterCount;
AnimationController _controller;
int _stringIndex;
var event = RobotProvider();
@override
void initState() {
_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