Padding to ListView

main
Kai Mannweiler 2023-03-06 15:59:06 +01:00
parent 56acb1e84c
commit 5cce527518
4 changed files with 20 additions and 19 deletions

View File

@ -38,14 +38,15 @@ class HistoryList<T> extends StatelessWidget {
Widget build(BuildContext context) {
return Expanded(
child: ListView(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
children: history.map((T entry) {
return Padding(
padding: const EdgeInsets.only(bottom: 5),
child: EntryDetail(
date: dateSelector(entry),
entryData: entryDataSelector(entry),
entryComment: _getComment(entry),
iconData: _getIcon(entry)));
}).toList()));
return Padding(
padding: const EdgeInsets.only(bottom: 5),
child: EntryDetail(
date: dateSelector(entry),
entryData: entryDataSelector(entry),
entryComment: _getComment(entry),
iconData: _getIcon(entry)));
}).toList()));
}
}

View File

@ -18,6 +18,7 @@ class RelapseForm extends StatelessWidget {
var settingsModel = context.watch<SettingsProvider>();
var tasksModel = context.watch<TasksProvider>();
return ListView(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
children: [
ElevatedCard(
title: 'Rückfallkategorie',

View File

@ -19,6 +19,7 @@ class SleepForm extends StatelessWidget {
TasksProvider tasksModel = context.watch<TasksProvider>();
return ListView(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
children: [
const ElevatedCard(
title: 'Einschlafzeit',

View File

@ -21,22 +21,20 @@ class ViewFormPage extends StatelessWidget {
TasksProvider tasksProvider = context.watch<TasksProvider>();
return Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Center(
child: pageProvider.showForm
? ChangeNotifierProvider(
create: (context) => InputProvider(),
child: form,
)
: view,
))),
child: Center(
child: pageProvider.showForm
? ChangeNotifierProvider(
create: (context) => InputProvider(),
child: form,
)
: view,
)),
if (!pageProvider.showForm)
Container(
margin: EdgeInsets.symmetric(vertical: height * 0.02),
child: RoundIconButton(
iconData: Icons.add_outlined,
onPressed: tasksProvider.tasks[page] ?? true
onPressed: true
? () => pageProvider.swap()
: () => showTaskDonePopup(context, page),
),