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:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
import 'package:migrainetracker/data_storage/daily_status_repository.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class DataEntryPage extends StatelessWidget {
|
class DataEntryPage extends StatelessWidget {
|
||||||
const DataEntryPage({Key? key}) : super(key: key);
|
const DataEntryPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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(
|
return Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|
@ -19,14 +33,7 @@ class DataEntryPage extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ElevatedButton(
|
child: firstButton,
|
||||||
onPressed: () {},
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
shape: CircleBorder(),
|
|
||||||
padding: EdgeInsets.all(12),
|
|
||||||
),
|
|
||||||
child: const Icon(Icons.error_outline, size: 120,),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
@ -36,7 +43,10 @@ class DataEntryPage extends StatelessWidget {
|
||||||
shape: CircleBorder(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
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(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
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)),
|
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
||||||
|
|
@ -71,7 +84,10 @@ class DataEntryPage extends StatelessWidget {
|
||||||
shape: CircleBorder(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
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 {
|
class DailyStatusModel extends ChangeNotifier {
|
||||||
DailyEntry? currentDay;
|
DailyEntry? currentDay;
|
||||||
|
var message = "Yay, it works!";
|
||||||
|
var message2 = "";
|
||||||
|
|
||||||
DailyStatusModel();
|
DailyStatusModel();
|
||||||
|
|
||||||
|
|
@ -23,6 +25,7 @@ class DailyStatusModel extends ChangeNotifier {
|
||||||
tookPainMeds: currentDay!.tookPainMeds
|
tookPainMeds: currentDay!.tookPainMeds
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
message2 = message;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ class _NavigatorPageState extends State<NavigatorPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var pages = <Widget>[
|
||||||
|
const DataEntryPage(),
|
||||||
|
const Placeholder(),
|
||||||
|
];
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("Migraine Tracker"),
|
title: const Text("Migraine Tracker"),
|
||||||
|
|
@ -35,10 +40,7 @@ class _NavigatorPageState extends State<NavigatorPage> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: <Widget>[
|
body: pages[currentPageIndex],
|
||||||
const DataEntryPage(),
|
|
||||||
const Placeholder(),
|
|
||||||
][currentPageIndex],
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue