Open AliAltiyev opened 9 months ago
@Milad-Akarie @AliAltiyev I have the same issue. Did you solve this issue?
anyone solve this issue?
@RoutePage() class DashboardPage extends AutoRouter { const DashboardPage({ super.key, });
Please extends AutoRouter. Now its will work Proper
The editor could not be opened because the file was not found. The following assertion was thrown building AutoTabsScaffold: 'package:auto_route/src/router/controller/root_stack_router.dart': Failed assertion: line 168 pos 12: 'builder != null': is not true.
The relevant error-causing widget was: AutoTabsScaffold AutoTabsScaffold:file:///C:/Users/alidr/Desktop/flutter_projects/medix/medix/features/dashboard/lib/ui/page/dashboard.dart:11:12
Here is code:
_import 'package:dashboard/dashboard.dart';
@RoutePage() class DashboardPage extends StatelessWidget { const DashboardPage({ super.key, });
@override Widget build(BuildContext context) { return AutoTabsScaffold( routes: const[
MainRouteRoute(),
MediatationRoute(),
SoundRoute(),
],
bottomNavigationBuilder: (, TabsRouter tabsRouter) {
return BottomNavigationBar(
currentIndex: tabsRouter.activeIndex,
onTap: tabsRouter.setActiveIndex,
items: const [
BottomNavigationBarItem(label: 'Users', icon: Icon(Icons.abc)),
BottomNavigationBarItem(label: 'Posts', icon: Icon(Icons.abc)),
BottomNavigationBarItem(label: 'Settings', icon: Icon(Icons.abc)),
],
);
},
);
}
}
My app_router.dart file:
_### _import 'package:navigation/navigation.dart';
export 'package:dashboard/module.dart'; export 'package:main/module.dart';
part 'app_router.gr.dart';
@AutoRouterConfig( replaceInRouteName: 'Screen,Route', modules:[
DashboardPackageModule,
MainPackageModule,
MeditationPackageModule,
SoundPackageModule,
],
)
/// The get routes => [
AutoRoute(
initial: true,
path: '/',
page: DashboardRoute.page,
children: [
AutoRoute(
page: MainRouteRoute.page,
path: 'main',
),
AutoRoute(
page: MediatationRoute.page,
path: 'meditation',
),
AutoRoute(
page: SoundRoute.page,
path: 'sound',
),
],
),
];
}__
AppRouter
class is a router configuration class that defines the routes for the application. /// It extends the_$AppRouter
class, which is generated by theauto_route
package. class AppRouter extends _$AppRouter { /// Returns a list ofAutoRoute
objects representing the defined routes in the application. @override List