Compare commits
1 commit
phil-exper
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 459f19c567 |
3 changed files with 15 additions and 51 deletions
|
|
@ -1,25 +1,11 @@
|
||||||
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>[
|
||||||
|
|
@ -33,7 +19,14 @@ class DataEntryPage extends StatelessWidget {
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: firstButton,
|
child: ElevatedButton(
|
||||||
|
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(
|
||||||
|
|
@ -43,10 +36,7 @@ class DataEntryPage extends StatelessWidget {
|
||||||
shape: CircleBorder(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
child: const Icon(
|
child: const Icon(Icons.notifications_paused_sharp, size: 120,),
|
||||||
Icons.notifications_paused_sharp,
|
|
||||||
size: 120,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -69,10 +59,7 @@ class DataEntryPage extends StatelessWidget {
|
||||||
shape: CircleBorder(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
child: const Icon(
|
child: const Icon(Icons.electric_bolt, size: 120,),
|
||||||
Icons.electric_bolt,
|
|
||||||
size: 120,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
SizedBox.fromSize(size: const Size.fromWidth(32)),
|
||||||
|
|
@ -84,10 +71,7 @@ class DataEntryPage extends StatelessWidget {
|
||||||
shape: CircleBorder(),
|
shape: CircleBorder(),
|
||||||
padding: EdgeInsets.all(12),
|
padding: EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
child: const Icon(
|
child: const Icon(Icons.medication_outlined, size: 120,),
|
||||||
Icons.medication_outlined,
|
|
||||||
size: 120,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -108,21 +92,6 @@ 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,8 +3,6 @@ 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();
|
||||||
|
|
||||||
|
|
@ -25,7 +23,6 @@ class DailyStatusModel extends ChangeNotifier {
|
||||||
tookPainMeds: currentDay!.tookPainMeds
|
tookPainMeds: currentDay!.tookPainMeds
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
message2 = message;
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ 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"),
|
||||||
|
|
@ -40,7 +35,10 @@ class _NavigatorPageState extends State<NavigatorPage> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
body: pages[currentPageIndex],
|
body: <Widget>[
|
||||||
|
const DataEntryPage(),
|
||||||
|
const Placeholder(),
|
||||||
|
][currentPageIndex],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue