From a01e8602e521291bd5a1eb6c3978ed6771d9eb8d Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sun, 16 Jul 2023 17:43:16 +0200 Subject: [PATCH] fix: The modal should overlay the Scaffold as well --- lib/src/ui/pages/calendar.dart | 136 +++++++++++++++++---------------- 1 file changed, 70 insertions(+), 66 deletions(-) diff --git a/lib/src/ui/pages/calendar.dart b/lib/src/ui/pages/calendar.dart index 10c3f6d..b512198 100644 --- a/lib/src/ui/pages/calendar.dart +++ b/lib/src/ui/pages/calendar.dart @@ -82,7 +82,6 @@ class CalendarPageState extends State { SliverToBoxAdapter( child: Padding( padding: const EdgeInsets.only( - left: 0, right: 16, top: 20, bottom: 4, @@ -168,78 +167,83 @@ class CalendarPageState extends State { setState(() {}); } }, - child: Scaffold( - appBar: AppBar( - title: Text(t.calendar.calendar), - actions: [ - IconButton( - onPressed: () { - context.read().add(RefreshPerformedEvent()); - }, - icon: const Icon(Icons.refresh), - ), - ], - ), - drawer: getDrawer(context), - body: Stack( + child: WillPopScope( + onWillPop: () async => !context.read().state.refreshing, + child: Stack( children: [ Positioned( left: 8, right: 8, top: 0, bottom: 0, - child: CustomScrollView( - slivers: [ - // Render all available weekdays - ..._renderWeekdayList( - context, - Weekday.unknown, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.monday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.tuesday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.wednesday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.thursday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.friday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.saturday, - airingAnimeMap, - ), - ..._renderWeekdayList( - context, - Weekday.sunday, - airingAnimeMap, - ), - - // Provide a nice bottom padding, while keeping the elastic effect attached - // to the bottom-most edge. - const SliverToBoxAdapter( - child: SizedBox( - height: 16, + child: Scaffold( + appBar: AppBar( + title: Text(t.calendar.calendar), + actions: [ + IconButton( + onPressed: () { + context + .read() + .add(RefreshPerformedEvent()); + }, + icon: const Icon(Icons.refresh), ), - ), - ], + ], + ), + drawer: getDrawer(context), + body: CustomScrollView( + slivers: [ + // Render all available weekdays + ..._renderWeekdayList( + context, + Weekday.unknown, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.monday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.tuesday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.wednesday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.thursday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.friday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.saturday, + airingAnimeMap, + ), + ..._renderWeekdayList( + context, + Weekday.sunday, + airingAnimeMap, + ), + + // Provide a nice bottom padding, while keeping the elastic effect attached + // to the bottom-most edge. + const SliverToBoxAdapter( + child: SizedBox( + height: 16, + ), + ), + ], + ), ), ), Positioned(