Compare commits
1 commit
main
...
phil-exper
| Author | SHA1 | Date | |
|---|---|---|---|
| 333c89d841 |
3 changed files with 51 additions and 15 deletions
|
|
@ -1,11 +1,25 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:migrainetracker/data_storage/daily_status_repository.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class DataEntryPage extends StatelessWidget {
|
||||
const DataEntryPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var firstButton = ElevatedButton(
|
||||
onPressed: () {
|
||||
// model.logFeelingMigrainy(true);
|
||||
Provider.of<DailyStatusModel>(context, listen: false)
|
||||
.logFeelingMigrainy(true);
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: CircleBorder(),
|
||||
padding: EdgeInsets.all(12),
|
||||
),
|
||||
child: const Icon(Icons.error_outline, size: 120),
|
||||
);
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
|
|
@ -19,14 +33,7 @@ class DataEntryPage extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {},
|
||||
style: ElevatedButton.styleFrom(
|
||||
shape: CircleBorder(),
|
||||
padding: EdgeInsets.all(12),
|
||||
),
|
||||
child: const Icon(Icons.error_outline, size: 120,),
|
||||
),
|
||||
child: firstButton,
|
||||
),
|
||||
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
||||
Expanded(
|
||||
|
|
@ -36,7 +43,10 @@ class DataEntryPage extends StatelessWidget {
|
|||
shape: CircleBorder(),
|
||||
padding: EdgeInsets.all(12),
|
||||
),
|
||||
child: const Icon(Icons.notifications_paused_sharp, size: 120,),
|
||||
child: const Icon(
|
||||
Icons.notifications_paused_sharp,
|
||||
size: 120,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -59,7 +69,10 @@ class DataEntryPage extends StatelessWidget {
|
|||
shape: CircleBorder(),
|
||||
padding: EdgeInsets.all(12),
|
||||
),
|
||||
child: const Icon(Icons.electric_bolt, size: 120,),
|
||||
child: const Icon(
|
||||
Icons.electric_bolt,
|
||||
size: 120,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
||||
|
|
@ -71,7 +84,10 @@ class DataEntryPage extends StatelessWidget {
|
|||
shape: CircleBorder(),
|
||||
padding: EdgeInsets.all(12),
|
||||
),
|
||||
child: const Icon(Icons.medication_outlined, size: 120,),
|
||||
child: const Icon(
|
||||
Icons.medication_outlined,
|
||||
size: 120,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
@ -92,6 +108,21 @@ class DataEntryPage extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Consumer<DailyStatusModel>(
|
||||
builder: (context, model, child) => Text(
|
||||
"msg: ${model.message2}",
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ import 'package:flutter/foundation.dart';
|
|||
|
||||
class DailyStatusModel extends ChangeNotifier {
|
||||
DailyEntry? currentDay;
|
||||
var message = "Yay, it works!";
|
||||
var message2 = "";
|
||||
|
||||
DailyStatusModel();
|
||||
|
||||
|
|
@ -23,6 +25,7 @@ class DailyStatusModel extends ChangeNotifier {
|
|||
tookPainMeds: currentDay!.tookPainMeds
|
||||
);
|
||||
}
|
||||
message2 = message;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,11 @@ class _NavigatorPageState extends State<NavigatorPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var pages = <Widget>[
|
||||
const DataEntryPage(),
|
||||
const Placeholder(),
|
||||
];
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Migraine Tracker"),
|
||||
|
|
@ -35,10 +40,7 @@ class _NavigatorPageState extends State<NavigatorPage> {
|
|||
});
|
||||
},
|
||||
),
|
||||
body: <Widget>[
|
||||
const DataEntryPage(),
|
||||
const Placeholder(),
|
||||
][currentPageIndex],
|
||||
body: pages[currentPageIndex],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue