wip layout add button

main
Julian Gegner 2023-03-05 17:33:27 +01:00
parent d674051c57
commit 40f03ec177
2 changed files with 15 additions and 5 deletions

View File

@ -15,7 +15,11 @@ class RoundAddButton extends StatelessWidget {
backgroundColor: Colors.green, // <-- Button color
foregroundColor: Colors.blue, // <-- Splash color
),
child: const Icon(Icons.add_outlined, color: Colors.white),
child: Icon(
Icons.add_outlined,
color: Colors.white,
size: MediaQuery.of(context).size.height * 0.5,
),
);
}
}

View File

@ -16,6 +16,7 @@ class ViewFormPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
PageProvider pageProvider = context.watch<PageProvider>();
TasksProvider tasksProvider = context.watch<TasksProvider>();
return Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
@ -27,10 +28,15 @@ class ViewFormPage extends StatelessWidget {
))
: Center(child: view),
if (!pageProvider.showForm)
RoundAddButton(
Container(
height: height / 8,
width: height / 8,
margin: EdgeInsets.only(bottom: height / 10),
child: RoundAddButton(
onPressed: tasksProvider.tasks[page] == true
? () => pageProvider.swap()
: () => showTaskDonePopup(context, page),
),
)
]);
}