Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

table calendar stops scrolling of listview in flutter

Tags:

flutter

I have a listview builder that contains ExpansionTile as itembuilder, I have used Table Calendar as ExpansionTile 's childern... I cant scroll listview while have tap on table calendar...to scroll i have to use expansionTile's title...

Expanded(
              child: ListView.builder(
                  itemCount: map.keys.toList().length,
                  itemBuilder: (context, index) {
                    return ExpansionTile(
                      title: Text(map.keys.toList()[index]),
                      children: [
                        Container(
                          height: 400,
                          child: TableCalendar(focusedDay: DateTime.now(),
                            firstDay: DateTime(DateTime.now().year,DateTime.now().month,1),
                            lastDay: DateTime(DateTime.now().year,DateTime.now().month+1,2),

                          ),
                        )
                      ],
                    );
                  }),
            )

1 Answers

a single line code will solve ur issue....

TableCalendar(
   availableGestures: AvailableGestures.none,//this single code will solve
   
  //availableGestures: AvailableGestures.horizontalSwipe,
                            focusedDay: DateTime.now(),
                            firstDay: DateTime(DateTime.now().year,DateTime.now().month,1),
                            lastDay: DateTime(DateTime.now().year,DateTime.now().month+1,2),

                          )

like image 171
Irfan Ganatra Avatar answered Oct 30 '25 22:10

Irfan Ganatra