Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.59k stars 404 forks source link

AutoLeadingButton Shows Unwanted Back Button Instead of Drawer Icon #2065

Open ebsangam opened 2 months ago

ebsangam commented 2 months ago

I am using AutoLeadingButton() in my app and it displays drawer in the home page for the first time. But when ever material app rebuilds (it rebuild when updating theme or locale) app bar shows back button in the home page instead of drawer icon. When not using AutoLeadingButton() the problem does not appear.

Here is my router:

import 'package:auto_route/auto_route.dart';
import 'package:injectable/injectable.dart';

import 'router.gr.dart';

@singleton
@AutoRouterConfig(replaceInRouteName: 'Page,Route')
class AppRouter extends RootStackRouter {
  @override
  RouteType get defaultRouteType =>
      const RouteType.adaptive(); //.cupertino, .adaptive ..etc

  @override
  List<AutoRoute> get routes => <AutoRoute>[
        // Splash
        AutoRoute(
          page: HomeEmptyRoute.page,
          children: [
            AutoRoute(
              page: FeedEmptyRoute.page,
              initial: true,
              children: [
                AutoRoute(
                  initial: true,
                  page: FeedListingRoute.page,
                ),
                AutoRoute(
                  page: FeedDetailsRoute.page,
                ),
              ],
            ),
            AutoRoute(
              page: CommentsRoute.page,
              fullscreenDialog: true,
              // transitionsBuilder: TransitionsBuilders.slideBottom,
            ),
          ],
        ),
      ];
}

Drawer is in FeedListingRoute. auto_route version: 9.2.0