stacked icon indicating copy to clipboard operation
stacked copied to clipboard

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

Open Chappie74 opened this issue 9 months ago • 3 comments

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

Chappie74 avatar Oct 01 '23 01:10 Chappie74

Just to check.

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

FilledStacks avatar Oct 19 '23 08:10 FilledStacks

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

Chappie74 avatar Oct 19 '23 12:10 Chappie74

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.

FilledStacks avatar Oct 23 '23 14:10 FilledStacks