stacked
stacked copied to clipboard
[bug]: Typing a dialog request does not reflect properly in the generated files
Describe the bug
When creating a dialog, you have the ability to type the DialogRequest
and DialogResponse
.
However, with a custom type, the generated file for the dialog setup does not reflect this. It defaults to a dynamic type.
I do believe this is the case with the other overlays as well (snackbars, bottomsheets).
To reproduce
- Create a dialog using
stacked create dialog test
- In the dialog file, add a type to the DialogRequest parameter
- rebuild using
stacked generate
- You will see an error in your
app.dialogs.dart
file.
Expected behavior
Instead of using dynamic type, it should cast it to the expected type upon generation.
Screenshots
No response
Additional Context
No response
Just to check.
A solution for this would be to add a the cast request as DialogRequest<PAOfferInfo>
to the generated code?
Yes thats how I'm getting around it. But of course, on regeneration it gets removed and have to be added again.
I see.
We'll have to add that to the generator. Our time is currently fully on SessionMate but when we open up a slot we'll tackle this issue.
Thanks for filing the request.