mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Veggieseasons - Fix feed scroll behind status bar (#337)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user