fluttercommunity / flutter_sticky_headers

Flutter Sticky Headers - Lets you place "sticky headers" into any scrollable content in your Flutter app. No special wrappers or magic required. Maintainer: @slightfoot
https://pub.dev/packages/sticky_headers
MIT License
1.1k stars 129 forks source link

There have sharking gaps when jump to list end and scrolling down. #84

Open Onperson opened 1 month ago

Onperson commented 1 month ago

@override void initState() { super.initState(); _jumpIndex = monthList.indexOf(DateFormat("yyyy-MM").format(DateTime.now()).toString()); if(widget.dateType == DateModel.DATE_TYPE_DAY && widget.selectStartDate.isNotEmpty){ _jumpIndex = monthList.indexOf(DateFormat("yyyy-MM").format(DateTime.parse(widget.selectStartDate)).toString()); } Future.delayed(Duration(milliseconds: 50), () { itemScrollController.jumpTo(index: _jumpIndex); }); } @override Widget build(BuildContext context) { return Column( children: [ CommonWidgetsProvider.getCommonDataWeeklyTitle(), Expanded(child: Container( color: Colors.white, child: ScrollablePositionedList.builder( itemCount: monthList.length, semanticChildCount: monthList.length, shrinkWrap: true, padding: EdgeInsets.all(0), initialScrollIndex: (_jumpIndex + 1), itemBuilder: (context, index){ return StickyHeader( header: _itemMonth(index), content:_itemDay(index), ); }, itemScrollController: itemScrollController,) ), flex: 1,), SizedBox(height: 20,) ], ); }

Onperson commented 1 month ago

It not always showing, just the last there mouths have the sharking gaps when scrolling, and i don't know why.