Switch PageableList over to using RenderList
This patch moves PageableList off HomogeneousViewport and onto RenderList and friends, making it match the new ScrollableList.
This commit is contained in:
@@ -29,7 +29,7 @@ class _TabsDemoState extends State<TabsDemo> {
|
||||
Widget build(_) {
|
||||
return new TabBarView<String>(
|
||||
items: _iconNames,
|
||||
itemBuilder: (BuildContext context, String iconName, int index) {
|
||||
itemBuilder: (String iconName) {
|
||||
return new Container(
|
||||
key: new ValueKey<String>(iconName),
|
||||
padding: const EdgeDims.all(12.0),
|
||||
|
||||
@@ -273,7 +273,7 @@ class StockHomeState extends State<StockHome> {
|
||||
drawer: _buildDrawer(context),
|
||||
body: new TabBarView<StockHomeTab>(
|
||||
items: <StockHomeTab>[StockHomeTab.market, StockHomeTab.portfolio],
|
||||
itemBuilder: (BuildContext context, StockHomeTab tab, _) {
|
||||
itemBuilder: (StockHomeTab tab) {
|
||||
switch (tab) {
|
||||
case StockHomeTab.market:
|
||||
return _buildStockTab(context, tab, config.symbols);
|
||||
|
||||
@@ -41,7 +41,7 @@ class PageableListAppState extends State<PageableListApp> {
|
||||
ScrollDirection scrollDirection = ScrollDirection.horizontal;
|
||||
bool itemsWrap = false;
|
||||
|
||||
Widget buildCard(BuildContext context, CardModel cardModel, int index) {
|
||||
Widget buildCard(CardModel cardModel) {
|
||||
Widget card = new Card(
|
||||
color: cardModel.color,
|
||||
child: new Container(
|
||||
@@ -114,10 +114,9 @@ class PageableListAppState extends State<PageableListApp> {
|
||||
}
|
||||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
return new PageableList<CardModel>(
|
||||
items: cardModels,
|
||||
return new PageableList(
|
||||
children: cardModels.map(buildCard),
|
||||
itemsWrap: itemsWrap,
|
||||
itemBuilder: buildCard,
|
||||
scrollDirection: scrollDirection
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user