fix issues related to wight and sugar blood

merge-requests/354/head
Elham Rababh 3 years ago
parent 5c8e9f4e19
commit 1568698b98

@ -13,8 +13,8 @@ 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/';

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@ -29,22 +30,7 @@ class WeightMonthlyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
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(
body: ListView(
children: [
Container(
width: double.maxFinite,
@ -52,7 +38,7 @@ class WeightMonthlyPage extends StatelessWidget {
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
timeSeries: model.weighMonthTimeSeriesData.isEmpty?[TimeSeriesSales3(0, 0.0)]:model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
@ -68,7 +54,11 @@ class WeightMonthlyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weighMonthTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -25,22 +26,7 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold(
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(
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -48,7 +34,9 @@ class WeightWeeklyPage extends StatelessWidget {
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
timeSeries: model.weightWeekTimeSeriesData.isEmpty
? [TimeSeriesSales2(DateTime.now(), 0.0)]
: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
@ -65,9 +53,14 @@ class WeightWeeklyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weightWeekTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
@ -79,7 +72,8 @@ class WeightWeeklyPage extends StatelessWidget {
);
}
List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> fullData(BuildContext context,
ProjectViewModel projectViewModel, WeightPressureViewModel model) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -88,8 +82,12 @@ 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(
@ -129,8 +127,12 @@ 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(

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
@ -28,22 +29,8 @@ class WeightYearPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
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(
body:
ListView(
children: [
Container(
width: double.maxFinite,
@ -51,7 +38,7 @@ class WeightYearPage extends StatelessWidget {
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
timeSeries: model.weightYearTimeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)),
SizedBox(
@ -67,7 +54,11 @@ class WeightYearPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
model.weightYearTimeSeriesData.isEmpty? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
):Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),

@ -30,7 +30,7 @@ class BloodMonthlyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

@ -25,7 +25,7 @@ class BloodYearPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

@ -31,7 +31,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: bloodSugarViewMode,
// baseViewModel: bloodSugarViewMode,
body: ListView(
children: [
Container(

Loading…
Cancel
Save