when i use PagedListView in body of Scaffold widget it works fine , but when i used it as an element in cloumn or parnet listview i get many errors like :
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
BoxConstraints forces an infinite height.
The relevant error-causing widget was:
PagedListView<int, Food> file:///Users/hesham/StudioProjects/foodlobby_client/lib/src/pages/menu_list.dart:115:9
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was:
PagedListView<int, Food> file:///Users/hesham/StudioProjects/foodlobby_client/lib/src/pages/menu_list.dart:115:9
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was:
PagedListView<int, Food> file:///Users/hesham/StudioProjects/foodlobby_client/lib/src/pages/menu_list.dart:115:9
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was:
PagedListView<int, Food> file:///Users/hesham/StudioProjects/foodlobby_client/lib/src/pages/menu_list.dart:115:9
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderShrinkWrappingViewport#f8e22 relayoutBoundary=up18 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1785 pos 12: 'hasSize'
The relevant error-causing widget was:
PagedListView<int, Food> file:///Users/hesham/StudioProjects/foodlobby_client/lib/src/pages/menu_list.dart:115:9
@override
Widget build(BuildContext context) {
return Scaffold(
key: _con.scaffoldKey,
drawer: DrawerWidget(),
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
centerTitle: true,
title: Text(
_con.foods.isNotEmpty && _con.foods[0].restaurantName != null
? _con.foods[0].restaurantName
: '',
overflow: TextOverflow.fade,
softWrap: false,
style: Theme.of(context)
.textTheme
.title
.merge(TextStyle(letterSpacing: 0)),
),
actions: <Widget>[
ShoppingCartButtonWidget(
iconColor: Theme.of(context).hintColor,
labelColor: Theme.of(context).accentColor)
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
body: ListView(
shrinkWrap: true,
padding: EdgeInsets.symmetric(vertical: 10),
children: <Widget>[
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: SearchBarWidget(),
),
ListTile(
dense: true,
contentPadding:
EdgeInsets.symmetric(horizontal: 20, vertical: 10),
leading: Icon(
Icons.trending_up,
color: Theme.of(context).hintColor,
),
title: Text(
S.of(context).trending_this_week,
style: Theme.of(context).textTheme.display1,
),
subtitle: Text(
S.of(context).double_click_on_the_food_to_add_it_to_the,
style: Theme.of(context)
.textTheme
.caption
.merge(TextStyle(fontSize: 11)),
),
),
FoodsCarouselWidget(
heroTag: 'menu_trending_food', restaurantController: _con),
ListTile(
dense: true,
contentPadding:
EdgeInsets.symmetric(horizontal: 20, vertical: 10),
leading: Icon(
Icons.list,
color: Theme.of(context).hintColor,
),
title: Text(
S.of(context).all_menu,
style: Theme.of(context).textTheme.display1,
),
subtitle: Text(
S.of(context).longpress_on_the_food_to_add_suplements,
style: Theme.of(context)
.textTheme
.caption
.merge(TextStyle(fontSize: 11)),
),
),
PagedListView<int, Food>.separated(
scrollDirection: Axis.vertical,
primary: false,
shrinkWrap: true,
pagingController: _con.pagingFoodsController,
builderDelegate: PagedChildBuilderDelegate<Food>(
itemBuilder: (context, item, index) {
return FoodItemWidget(
heroTag: "menu_list",
food: item);
},
noMoreItemsIndicatorBuilder: (_) =>
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(80),
child: RaisedButton(
disabledColor: Colors.white,
onPressed: null,
child: Text("لا يوجد وجبات اخرى"),
),
),
),
),
separatorBuilder: (context, index) => SizedBox(height: 10),
)
],
));