Use Beamer package with Get package

218 Views Asked by At

In general everything works for me, nevertheless I get an error in my console regarding Getx & Beamer types

Expected a value of type 'GetNavConfig', but got one of type 'RouteInformation'

I think that I know where the RouteInformation comes from:

  List<BeamPage> buildPages(
  BuildContext context, RouteInformationSerializable state) {
return [HomePage.beamLocation];

}

it is an argument of the buildPages() method, that has to be implemented due to the abstract Beamer class.

On the other hand I think that the

GetMaterialApp

expects a GetNavConfig, but gets a RouteInformation. I'm not really sure whether the things that I interpreted are correct. So I have no idea how to do something against the error. How could I fix the problem?

1

There are 1 best solutions below

2
Gwhyyy On

Well, since you're trying to rely on the beamer package instead of the Getx routing management feature, then you do not need the GetMaterialApp, you need to just use the MaterialApp, and for the beamer you need to use the MaterialApp.router.

Getx is a package that offers separate features, you could get state management and dependency injection... working fine without GetMaterialApp.

However, this means that you will not be allowed to use navigation methods such as Get.to() and Get.toNamed(), you cannot use the Get.context, and you cannot use the Getx's bottom sheet and dialogs.