lukepighetti / fluro

Fluro is a Flutter routing library that adds flexible routing options like wildcards, named parameters and clear route definitions.
https://pub.dev/packages/fluro
MIT License
3.66k stars 416 forks source link

BuildContext null for HandlerType.function #281

Open github-fuer-spam opened 9 months ago

github-fuer-spam commented 9 months ago

Hallo, I want to come back this issue: https://github.com/lukepighetti/fluro/issues/125

Perhaps there is a misunderstanding, but if I try in flutter web to use the function handler type with setting a link in the addressbar of the browser, I have a null-context. Is this intentionally so? If so why? Trying to comment out type, I have a context.

Addressbar: http://myWebServerURL/#/user/13

` static Handler userHandler = Handler(

type: HandlerType.function,

handlerFunc: (

    BuildContext? context,

    Map<String, List<String>> params,

    ) {

    // context is null here

    print(context.toString());

`

thank you for further explanation

pkondratev commented 8 months ago

The same problem. I wanted to use HandlerType.function for showing bottomSheets, but context is null