Last active
March 12, 2025 00:11
-
-
Save loic-sharma/fe73782b591a7739dcd37242b316ae76 to your computer and use it in GitHub Desktop.
Scrollable in Scrollable error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | |
], | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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