Skip to content

Instantly share code, notes, and snippets.

@loic-sharma
Last active March 12, 2025 00:11
Show Gist options
  • Save loic-sharma/fe73782b591a7739dcd37242b316ae76 to your computer and use it in GitHub Desktop.
Save loic-sharma/fe73782b591a7739dcd37242b316ae76 to your computer and use it in GitHub Desktop.
Scrollable in Scrollable error
import 'package:flutter/cupertino.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
const title = 'Scrollable in Scrollable';
return CupertinoApp(
title: title,
home: CupertinoPageScaffold(
child: ListView(
children: [
ListView(
children: [
Text('Hello world'),
],
),
],
),
),
);
}
}
Vertical viewport was given unbounded height.
Viewports expand in the scrolling direction to fill their container. In this case, a vertical viewport was given an unlimited amount of vertical space in which to expand. This situation typically happens when a scrollable widget is nested inside another scrollable widget.
If this widget is always nested in a scrollable widget there is no need to use a viewport because there will always be enough vertical space for the children. In this case, consider using a Column or Wrap instead. Otherwise, consider using a CustomScrollView to concatenate arbitrary slivers into a single scrollable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment