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(
|
return DecoratedBox(
|
||||||
decoration: BoxDecoration(color: Color(0xffffffff)),
|
decoration: BoxDecoration(color: Color(0xffffffff)),
|
||||||
child: ListView.builder(
|
child: SafeArea(
|
||||||
itemCount: appState.allVeggies.length + 2,
|
bottom: false,
|
||||||
itemBuilder: (context, index) {
|
child: ListView.builder(
|
||||||
if (index == 0) {
|
itemCount: appState.allVeggies.length + 2,
|
||||||
return Padding(
|
itemBuilder: (context, index) {
|
||||||
padding: const EdgeInsets.fromLTRB(16, 24, 16, 16),
|
if (index == 0) {
|
||||||
child: Column(
|
return Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: const EdgeInsets.fromLTRB(16, 24, 16, 16),
|
||||||
children: [
|
child: Column(
|
||||||
Text(dateString.toUpperCase(), style: Styles.minorText),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
Text('In season today', style: Styles.headlineText),
|
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],
|
} else if (index <= appState.availableVeggies.length) {
|
||||||
prefs,
|
return _generateVeggieRow(
|
||||||
);
|
appState.availableVeggies[index - 1],
|
||||||
} else if (index <= appState.availableVeggies.length + 1) {
|
prefs,
|
||||||
return Padding(
|
);
|
||||||
padding: const EdgeInsets.fromLTRB(16, 24, 16, 16),
|
} else if (index <= appState.availableVeggies.length + 1) {
|
||||||
child: Text('Not in season', style: Styles.headlineText),
|
return Padding(
|
||||||
);
|
padding: const EdgeInsets.fromLTRB(16, 24, 16, 16),
|
||||||
} else {
|
child: Text('Not in season', style: Styles.headlineText),
|
||||||
int relativeIndex =
|
);
|
||||||
index - (appState.availableVeggies.length + 2);
|
} else {
|
||||||
return _generateVeggieRow(
|
int relativeIndex =
|
||||||
appState.unavailableVeggies[relativeIndex], prefs,
|
index - (appState.availableVeggies.length + 2);
|
||||||
inSeason: false);
|
return _generateVeggieRow(
|
||||||
}
|
appState.unavailableVeggies[relativeIndex], prefs,
|
||||||
},
|
inSeason: false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user