'why I get this error in flutter when I change my listview direction for vertical to horizontal

Assertion failed: file:///D:/flutterfiles/flutter/packages/flutter/lib/src/rendering/box.dart:1982:12 hasSize "RenderBox was not laid out: RenderPadding#3c329 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE"



Solution 1:[1]

its because Listview needs a horizontal size. You can wrap it in a Container() with specified width (use width: MediaQuery.of(context).size.width for full width of screen).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Delwinn