|
|
|
@ -1,6 +1,6 @@
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/config/config.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/theme/colors.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
@ -8,31 +8,31 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.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';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.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';
|
|
|
|
|
|
|
|
|
|
|
|
import 'AddWeightPage.dart';
|
|
|
|
import 'AddWeightPage.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
final WeightPressureViewModel model;
|
|
|
|
final WeightPressureViewModel model;
|
|
|
|
|
|
|
|
|
|
|
|
const WeightWeeklyPage({Key key, this.model}) : super(key: key);
|
|
|
|
WeightWeeklyPage({Key key, this.model}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AppScaffold(
|
|
|
|
if (projectViewModel == null) projectViewModel = Provider.of(context);
|
|
|
|
isShowDecPage: false,
|
|
|
|
return ListView(
|
|
|
|
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
|
|
|
|
|
|
|
body: ListView(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Card(
|
|
|
|
Card(
|
|
|
|
shape: cardRadius(12),
|
|
|
|
shape: cardRadius(12),
|
|
|
|
elevation: 1,
|
|
|
|
elevation: 1,
|
|
|
|
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
|
|
|
|
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
|
|
|
|
child: ShowChart(
|
|
|
|
child: ShowChart(
|
|
|
|
title: TranslationBase.of(AppGlobal.context).weight,
|
|
|
|
title: TranslationBase.of(context).weight,
|
|
|
|
timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
|
|
|
|
timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
|
|
|
|
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
|
|
|
|
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
|
|
|
|
horizontalInterval: 2,
|
|
|
|
horizontalInterval: 2,
|
|
|
|
@ -47,7 +47,7 @@ class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Texts(TranslationBase.of(AppGlobal.context).details),
|
|
|
|
child: Texts(TranslationBase.of(context).details),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
@ -58,14 +58,14 @@ class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
model.weightWeekTimeSeriesData.isEmpty
|
|
|
|
model.weightWeekTimeSeriesData.isEmpty
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Texts(TranslationBase.of(AppGlobal.context).noDataAvailable),
|
|
|
|
child: Texts(TranslationBase.of(context).noDataAvailable),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Table(
|
|
|
|
: Table(
|
|
|
|
columnWidths: {
|
|
|
|
columnWidths: {
|
|
|
|
0: FlexColumnWidth(2.5),
|
|
|
|
0: FlexColumnWidth(2.5),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
children: fullData(AppGlobal.context, model),
|
|
|
|
children: fullData(context, model),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -75,7 +75,6 @@ class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
mHeight(80),
|
|
|
|
mHeight(80),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -96,9 +95,9 @@ class WeightWeeklyPage extends StatelessWidget {
|
|
|
|
tableRow.add(
|
|
|
|
tableRow.add(
|
|
|
|
TableRow(
|
|
|
|
TableRow(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false),
|
|
|
|
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false),
|
|
|
|
Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false),
|
|
|
|
Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false, mProjectViewModel: projectViewModel),
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
|
|
|
|
SizedBox(height: 12),
|
|
|
|
SizedBox(height: 12),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
|