Search code examples
flutterscrollviewlazy-evaluation

Flutter: Lazy build in scrollview


I'm trying to build scrollview that has different kind of widgets like images ,text and rows. The problem is I want widgets start build (rendering) when it comes on screen not at startup.


Solution

  • Use the ListView.builder().

    List<Widget> someItems;
    
    ...
    
    ListView.builder(
      itemCount: someItems.length,
      itemBuilder: (context, index) {
        return someItems[index];
      },
    )