slovnicki / beamer

A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation, guards and more.
MIT License
582 stars 128 forks source link

Nested beamer route stops keyboard to open in landscape view #625

Open F7085 opened 1 year ago

F7085 commented 1 year ago

The issue is present in a tablet device in landscape mode. in my home screen I'm using a nested route to show different screens, at the moment that i tried to open the keyboard for some reason the nested route is stopping it to open.

This is the body of my home screen

 body: Beamer(
        key: beamerKey,
        routerDelegate: BeamerDelegate(
            transitionDelegate: const NoAnimationTransitionDelegate(),
            locationBuilder: (routeInformation, _) {
              if (routeInformation.location!.contains('tickets')) {
                return TicketsLocation(routeInformation);
              } else if (routeInformation.location!.contains('movements')) {
                return MovementsLocation(routeInformation);
              } else if (routeInformation.location!.contains('orders')) {
                return OrdersLocation(routeInformation);
              }
              return ManagementLocation(routeInformation);
            }),
      ),

this is the way that i show the dialog that I'm currently working, is located in the app bar of my home screen

PopupMenuItem<String>(
                  onTap: () {
                    Future.delayed(const Duration(seconds: 0), () {
                      showAnimatedDialog(
                        context: context,
                        builder: (dialogContext) => BlocProvider(
                          create: (dialogContext) => WebUpdateStoresCubit(
                              context.read<StoresApiService>()),
                          child: AddStoresModal(context: dialogContext),
                        ),
                        animationType: DialogTransitionType.scale,
                        curve: Curves.ease,
                        duration: const Duration(milliseconds: 500),
                      );
                    });
                  },
                  value: 'stores',
                  child: const Row(
                    children: [
                      Icon(Icons.store, color: Colors.black),
                      SizedBox(width: 8),
                      Text('Stores'),
                    ],
                  ),
                ),

I tried removing all the widgets that i have in my screen and the issue is still present but at the moment to remove the nested route the keyboard opens normally, I also tried with another dialog that works fine in another screen that dosent have a nested route , i put it in the first screen of the nested route and in the home appBar and it didn't work

https://github.com/slovnicki/beamer/assets/92191472/08727746-1b25-4786-947d-fd4194197aca

emmanuellmota commented 12 months ago

I have same issue. Anyone managed to solve this? Thanks

F7085 commented 11 months ago

I have same issue. Anyone managed to solve this? Thanks did you find a way to solve it? o you try another approach

talski commented 5 months ago

I've got it working wrapping the nested Beamer widget with a FocusScope.

FocusScope(
  child: Beamer(
    routerDelegate: beamerDelegate,
  ),
)