Smartwatch updates

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

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

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

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

@ -99,7 +99,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
} else if (value == 1) {
getMonthlyHeartRateData();
} else {
// getYearlyHeartRateData();
getYearlyHeartRateData();
}
},
),
@ -109,11 +109,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [
isWeeklyDataLoaded ? getWeeklyHeartRateDetails() : Container(),
isMonthlyDataLoaded ? getMonthlyHeartRateDetails() : Container(),
// isYearlyDataLoaded ? getYearlyDistanceDetails() : Container()
// Container(),
// Container(),
Container()
isYearlyDataLoaded ? getYearlyHeartRateDetails() : Container()
],
controller: _tabController,
),
@ -183,13 +179,13 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
yearlyDataLength = 0;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(7, 3, context).then((res) {
service.getPatientHealthDataStats(3, 3, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
yearlyHearRateList.clear();
res['Med_GetYearTransactionsStsList'].forEach((element) {
yearlyHearRateList.add(new YearlyHeartRateResModel.fromJson(element));
if (element['ValueSum'] != null) {
num value = element['ValueSum'];
if (element['ValueAvg'] != null) {
num value = element['ValueAvg'];
avgYearlyHearRateValue += value;
yearlyDataLength++;
}
@ -264,6 +260,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
timeSeries: weeklyTimeSeriesData,
indexes: weeklyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8,
isWeeklyOrMonthly: true,
),
),
Container(
@ -339,6 +336,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
timeSeries: monthlyTimeSeriesData,
indexes: monthlyTimeSeriesData.length ~/ 5.5,
horizontalInterval: 8,
isWeeklyOrMonthly: true,
),
),
Container(
@ -424,11 +422,11 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [
Container(
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(
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(
// enableInfiniteScroll: true,
viewportFraction: 0.99,
height: MediaQuery.of(context).size.height*1.02 ),
height: MediaQuery.of(context).size.height*1.1 ),
items: [1, 2].map((i) {
return Builder(
builder: (BuildContext context) {

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

@ -395,6 +395,15 @@ class DateUtil {
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
/// [dateTime] convert DateTime to data formatted according to language
static String getDayMonthYearDateFormattedLang(DateTime dateTime, bool isArabic) {

@ -10,8 +10,9 @@ class ShowChart extends StatelessWidget {
final List<TimeSeriesSales2> timeSeries;
final int indexes;
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<double> yAxixs = List();
@ -115,19 +116,23 @@ class ShowChart extends StatelessWidget {
rotateAngle: -65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
if(isWeeklyOrMonthly) {
return '${timeSeries[value.toInt()].time.day}/ ${timeSeries[value.toInt()].time.month}';
} else {
if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
}
return '';
}
return '';
},
),
leftTitles: SideTitles(

Loading…
Cancel
Save