migrainetracker/lib/data_entry/view.dart

103 lines
3.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class DataEntryPage extends StatelessWidget {
const DataEntryPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
SizedBox.fromSize(size: const Size.fromHeight(32)),
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.fromLTRB(32, 0, 32, 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
padding: EdgeInsets.all(24),
),
child: const Icon(Icons.error_outline, size: 120,),
),
),
SizedBox.fromSize(size: const Size.fromWidth(32)),
Expanded(
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
padding: EdgeInsets.all(24),
),
child: const Icon(Icons.notifications_paused_sharp, size: 120,),
),
),
],
),
),
),
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.fromLTRB(32, 16, 32, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
flex: 10,
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
padding: EdgeInsets.all(24),
),
child: const Icon(Icons.electric_bolt, size: 120,),
),
),
SizedBox.fromSize(size: const Size.fromWidth(32)),
Expanded(
flex: 10,
child: ElevatedButton(
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: CircleBorder(),
padding: EdgeInsets.all(24),
),
child: const Icon(Icons.medication_outlined, size: 120,),
),
),
],
),
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
getCurrentDate(),
style: const TextStyle(
fontSize: 54,
fontWeight: FontWeight.w200,
),
),
],
),
),
]);
}
String getCurrentDate() {
DateTime now = DateTime.now();
DateTime date = DateTime(now.year, now.month, now.day);
return DateFormat.yMd('de_CH').format(date);
}
}