From 738b0d99588617dc0c6eead4eb3f83079bbfa97a Mon Sep 17 00:00:00 2001 From: Manasvi Patidar Date: Mon, 2 Mar 2020 23:38:50 +0530 Subject: [PATCH] Veggieseasons - Fix feed scroll behind status bar (#337) --- veggieseasons/lib/screens/list.dart | 67 +++++++++++++++-------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/veggieseasons/lib/screens/list.dart b/veggieseasons/lib/screens/list.dart index 6ff8f5ee5..23094b1bc 100644 --- a/veggieseasons/lib/screens/list.dart +++ b/veggieseasons/lib/screens/list.dart @@ -39,38 +39,41 @@ class ListScreen extends StatelessWidget { return DecoratedBox( decoration: BoxDecoration(color: Color(0xffffffff)), - child: ListView.builder( - itemCount: appState.allVeggies.length + 2, - itemBuilder: (context, index) { - if (index == 0) { - return Padding( - padding: const EdgeInsets.fromLTRB(16, 24, 16, 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(dateString.toUpperCase(), style: Styles.minorText), - Text('In season today', style: Styles.headlineText), - ], - ), - ); - } else if (index <= appState.availableVeggies.length) { - return _generateVeggieRow( - appState.availableVeggies[index - 1], - prefs, - ); - } else if (index <= appState.availableVeggies.length + 1) { - return Padding( - padding: const EdgeInsets.fromLTRB(16, 24, 16, 16), - child: Text('Not in season', style: Styles.headlineText), - ); - } else { - int relativeIndex = - index - (appState.availableVeggies.length + 2); - return _generateVeggieRow( - appState.unavailableVeggies[relativeIndex], prefs, - inSeason: false); - } - }, + child: SafeArea( + bottom: false, + child: ListView.builder( + itemCount: appState.allVeggies.length + 2, + itemBuilder: (context, index) { + if (index == 0) { + return Padding( + padding: const EdgeInsets.fromLTRB(16, 24, 16, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(dateString.toUpperCase(), style: Styles.minorText), + Text('In season today', style: Styles.headlineText), + ], + ), + ); + } else if (index <= appState.availableVeggies.length) { + return _generateVeggieRow( + appState.availableVeggies[index - 1], + prefs, + ); + } else if (index <= appState.availableVeggies.length + 1) { + return Padding( + padding: const EdgeInsets.fromLTRB(16, 24, 16, 16), + child: Text('Not in season', style: Styles.headlineText), + ); + } else { + int relativeIndex = + index - (appState.availableVeggies.length + 2); + return _generateVeggieRow( + appState.unavailableVeggies[relativeIndex], prefs, + inSeason: false); + } + }, + ), ), ); },