smartnsoft / flappy_search_bar

SearchBar widget to handle most of search cases
MIT License
173 stars 93 forks source link

Bug: Scrolling of List in `SizedBox` #21

Open hinterlandcreative opened 4 years ago

hinterlandcreative commented 4 years ago

My widget tree looks like this:

Stack(
  children: <Widget> [
   // ...
    Positioned.fill(
      // draws a box with padding at the top and bottom of the screen (see screenshot)
      child: LayoutBuilder(
        builder(context, constraints) => Column(
          children: <Widget> [
            // ... other stuff
            SizedBox(
              height: constraints.maxHeight - sizeOfOtherStuffAbove
              child: SearchBar<ContactModel>(
                onSearch: (query) => model.search(query),
                onItemFound: (contact, _) => ContactListItem(contact: contact,),
                buildSuggestion: (contact, _) => ContactListItem(contact: contact,),),)

When the suggestions load they looks like this and scroll correctly at first:

Simulator Screen Shot - iPhone 11 Pro Max - 2020-03-26 at 13 45 43

But then when scrolling it looks like this:

Simulator Screen Shot - iPhone 11 Pro Max - 2020-03-26 at 13 45 49