-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.dart
62 lines (59 loc) · 2.26 KB
/
history.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import "package:flutter/material.dart";
import 'package:flutter_redux/flutter_redux.dart';
//my code
import "package:waterledger/buymecoffee.dart";
import "package:waterledger/historyChartManager.dart";
import 'package:waterledger/models/appState.dart';
import 'package:waterledger/viewModels/historyViewModel.dart';
//Class is done for now.
class HistoryWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView(
children: <Widget>[
HistoryChartWidget(),
Card(
child: Container(
padding: EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ListTile(
title: StoreConnector<AppState, HistoryViewModel>(
converter: (store) => HistoryViewModel.fromStore(store),
builder: (context, viewModel) => Text(
viewModel.dailyAverageForever.toStringAsFixed(1) +
" " +
viewModel.unitsString),
),
subtitle: Text("Daily Average Intake(All Time)"),
),
ListTile(
title: StoreConnector<AppState, HistoryViewModel>(
converter: (store) => HistoryViewModel.fromStore(store),
builder: (context, viewModel) => Text(
viewModel.dailyAverageWeekly.toStringAsFixed(1) +
" " +
viewModel.unitsString),
),
subtitle: Text("Daily Average Intake(Week)"),
),
ListTile(
title: StoreConnector<AppState, HistoryViewModel>(
converter: (store) => HistoryViewModel.fromStore(store),
builder: (context, viewModel) => Text(
viewModel.beverageAmountAverage.toStringAsFixed(1) +
" " +
viewModel.unitsString),
),
subtitle: Text("Average Beverage Size"),
),
],
),
),
),
BMCWidget()
],
);
}
}