skip to Main Content

What is the reason

Is this the reason _items.isNotEmpty ?

part of the code


return Column(children: [
      
      _items.isNotEmpty
          ? Expanded(
              child: ListView.builder(
                  
                  physics: ClampingScrollPhysics(),
                  shrinkWrap: true,
                  itemCount: _items.length,
                  
                  itemBuilder: (context, index) {

2

Answers


  1. Wherever you are using the ScrollController properties before using it, adding this condition will fix this problem

    if (_scrollController.hasClients) 
    
    Login or Signup to reply.
  2. Add controller property to your ListView.

    ListView.builder(
    controller: _scrollController,
    )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search