-
Notifications
You must be signed in to change notification settings - Fork 132
Description
@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,)
],
);
}