I found the solution. This was caused by the ListView. I was using 3 columns, out of 3 One was ListView inside Drawer. And another 2 ware inside a SingleChildView. This was causing the issue. I added a ScrollController to the ListView and it was solved.
something like this
return Drawer(
child: ListView(
controller: ScrollController(initialScrollOffset: 0),
children: [
DrawerListTile(
title: "Dashboard",
svgSrc: "assets/icons/menu_dashbord.svg",
press: () {},
),
DrawerListTile(
title: "Transaction",
svgSrc: "assets/icons/menu_tran.svg",
press: () {},
),
DrawerListTile(
title: "Store",
svgSrc: "assets/icons/menu_store.svg",
press: () {},
),
DrawerListTile(
title: "Profile",
svgSrc: "assets/icons/menu_profile.svg",
press: () {},
),
DrawerListTile(
title: "Settings",
svgSrc: "assets/icons/menu_setting.svg",
press: () {},
),
],
),
);
The main reason for the error is have more than one ScrollView (so ListView, SingleChildScrollView, CustomScrollView, etc.) with the scrollDirection vertical and no scrollController in one route.
https://github.com/flutter/flutter/issues/93862
by making primary: false inside "SingleChildScrollView" also worked