Smartwatch updates

merge-requests/456/head
haroon amjad 5 years ago
parent b52c719351
commit d409875741

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

@ -115,7 +115,7 @@ class BaseAppClient {
} }
// body['PatientID'] = 1018977; // body['PatientID'] = 1018977;
// body['TokenID'] = "@dm!n"; body['TokenID'] = "@dm!n";
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);

@ -262,6 +262,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
timeSeries: weeklyTimeSeriesData, timeSeries: weeklyTimeSeriesData,
indexes: weeklyTimeSeriesData.length ~/ 5.5, indexes: weeklyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(
@ -337,6 +338,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
timeSeries: monthlyTimeSeriesData, timeSeries: monthlyTimeSeriesData,
indexes: monthlyTimeSeriesData.length ~/ 5.5, indexes: monthlyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(

@ -99,7 +99,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
} else if (value == 1) { } else if (value == 1) {
getMonthlyHeartRateData(); getMonthlyHeartRateData();
} else { } else {
// getYearlyHeartRateData(); getYearlyHeartRateData();
} }
}, },
), ),
@ -109,11 +109,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [ children: [
isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(), isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(),
isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(), isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(),
// isYearlyDataLoaded ? getYearlyDistanceDetails() : Container() isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container()
// Container(),
// Container(),
Container()
], ],
controller: _tabController, controller: _tabController,
), ),
@ -183,13 +179,13 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
yearlyDataLength = 0; yearlyDataLength = 0;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(7, 3, context).then((res) { service.getPatientHealthDataStats(3, 3, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
yearlyHearRateList.clear(); yearlyHearRateList.clear();
res['Med_GetYearTransactionsStsList'].forEach((element) { res['Med_GetYearTransactionsStsList'].forEach((element) {
yearlyHearRateList.add(new YearlyHeartRateResModel.fromJson(element)); yearlyHearRateList.add(new YearlyHeartRateResModel.fromJson(element));
if (element['ValueSum'] != null) { if (element['ValueAvg'] != null) {
num value = element['ValueSum']; num value = element['ValueAvg'];
avgYearlyHearRateValue += value; avgYearlyHearRateValue += value;
yearlyDataLength++; yearlyDataLength++;
} }
@ -264,6 +260,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
timeSeries: weeklyTimeSeriesData, timeSeries: weeklyTimeSeriesData,
indexes: weeklyTimeSeriesData.length ~/ 5.5, indexes: weeklyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(
@ -339,6 +336,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
timeSeries: monthlyTimeSeriesData, timeSeries: monthlyTimeSeriesData,
indexes: monthlyTimeSeriesData.length ~/ 5.5, indexes: monthlyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(
@ -424,11 +422,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [ children: [
Container( Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0), padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 5.0),
child: Text(TranslationBase.of(context).avgDistance, style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).avgHeartRate, style: TextStyle(fontSize: 18.0)),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).km_, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), child: Text(yearlyStatsAvgValue.toString() + " " + TranslationBase.of(context).bpm, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
], ],
), ),

@ -447,7 +447,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
options: CarouselOptions( options: CarouselOptions(
// enableInfiniteScroll: true, // enableInfiniteScroll: true,
viewportFraction: 0.99, viewportFraction: 0.99,
height: MediaQuery.of(context).size.height*1.02 ), height: MediaQuery.of(context).size.height*1.1 ),
items: [1, 2].map((i) { items: [1, 2].map((i) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -258,6 +258,7 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
timeSeries: weeklyTimeSeriesData, timeSeries: weeklyTimeSeriesData,
indexes: weeklyTimeSeriesData.length ~/ 5.5, indexes: weeklyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(
@ -333,6 +334,7 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
timeSeries: monthlyTimeSeriesData, timeSeries: monthlyTimeSeriesData,
indexes: monthlyTimeSeriesData.length ~/ 5.5, indexes: monthlyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8, horizontalInterval: 8,
isWeeklyOrMonthly: true,
), ),
), ),
Container( Container(

@ -395,6 +395,15 @@ class DateUtil {
return ""; return "";
} }
/// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted
static String getDayMonthDateFormatted(DateTime dateTime) {
if (dateTime != null)
return DateFormat('dd/MM').format(dateTime);
else
return "";
}
/// get data formatted like 26/4/2020 /// get data formatted like 26/4/2020
/// [dateTime] convert DateTime to data formatted according to language /// [dateTime] convert DateTime to data formatted according to language
static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) { static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) {

@ -10,8 +10,9 @@ class ShowChart extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries; final List<TimeSeriesSales2> timeSeries;
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
final bool isWeeklyOrMonthly;
ShowChart({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 8.0}); ShowChart({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 8.0, this.isWeeklyOrMonthly = false});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -115,6 +116,9 @@ class ShowChart extends StatelessWidget {
rotateAngle: -65, rotateAngle: -65,
margin: 22, margin: 22,
getTitles: (value) { getTitles: (value) {
if(isWeeklyOrMonthly) {
return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.month}';
} else {
if (timeSeries.length < 15) { if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) { if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
@ -128,6 +132,7 @@ class ShowChart extends StatelessWidget {
} }
} }
return ''; return '';
}
}, },
), ),
leftTitles: SideTitles( leftTitles: SideTitles(

Loading…
Cancel
Save