Stacked-Org / stacked

A Flutter application architecture created from real world scenarios
MIT License
977 stars 255 forks source link

[bug]: Typing a dialog request does not reflect properly in the generated files #1032

Open Chappie74 opened 1 year ago

Chappie74 commented 1 year ago

Describe the bug

When creating a dialog, you have the ability to type the DialogRequest and DialogResponse. image

However, with a custom type, the generated file for the dialog setup does not reflect this. It defaults to a dynamic type.

image

I do believe this is the case with the other overlays as well (snackbars, bottomsheets).

To reproduce

  1. Create a dialog using stacked create dialog test
  2. In the dialog file, add a type to the DialogRequest parameter
  3. rebuild using stacked generate
  4. 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.

image

image

Screenshots

No response

Additional Context

No response

FilledStacks commented 1 year ago

Just to check.

A solution for this would be to add a the cast request as DialogRequest<PAOfferInfo> to the generated code?

Chappie74 commented 1 year ago

Yes thats how I'm getting around it. But of course, on regeneration it gets removed and have to be added again.

FilledStacks commented 1 year ago

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.