Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot Reload #178

Open
dickermoshe opened this issue Apr 8, 2024 · 14 comments
Open

Hot Reload #178

dickermoshe opened this issue Apr 8, 2024 · 14 comments
Labels
bug Something isn't working in triage

Comments

@dickermoshe
Copy link
Contributor

Bug report

Describe the bug
When making changes to an open bottom sheet, it isn't rebuilt

Steps to reproduce

Steps to reproduce the behavior:

  1. Open Bottom Sheet
  2. Edit Widget
  3. Hot Restart

Expected behavior

See changes instantly


Additional context

This seems to be a general issue, but being that with dialogs and bottom sheets, but those can be wrapped in a custom widget workaround it.
Having to open and close it during development isn't great.
Is there something I'm missing?


@dickermoshe dickermoshe added bug Something isn't working in triage labels Apr 8, 2024
@felipecastrosales
Copy link

hey! this appears here also. @dickermoshe any expectations?

@dickermoshe
Copy link
Contributor Author

dickermoshe commented May 27, 2024

hey! this appears here also. @dickermoshe any expectations?

Say What? I don't understand the question.

@dickermoshe
Copy link
Contributor Author

The workaround for this issue is to wrap the base widget in a StatefulBuilder

@felipecastrosales
Copy link

@dickermoshe I've been trying this - because in common bottomsheets I do this, but it didn't work with this package for me. Can you send me how you implemented it?

@dickermoshe
Copy link
Contributor Author

mainContentSlivers: [
      SliverToBoxAdapter(
        child: StatefulBuilder(builder: (ctx, _) {
          return Container(color:Colors.red, height:50,width: 50); // Any widget in here will rebuild on a hot reload
        }),
      ),
    ],

@felipecastrosales
Copy link

and how make with WoltModalSheetPage? in child doesn't works as expected. I think this plugin can put this internally, or in documents explain about the use of StatefulBuilder and where it can be added; with this we can close this issue - IMHO.

mainContentSlivers: [
      SliverToBoxAdapter(
        child: StatefulBuilder(builder: (ctx, _) {
          return Container(color:Colors.red, height:50,width: 50); // Any widget in here will rebuild on a hot reload
        }),
      ),
    ],

@dickermoshe
Copy link
Contributor Author

I agree, @ulusoyca
What do you think about wrapping every widget in a StatefulBuilder under the hood?

(Sorry if I shouldn't be pinging people)

@ulusoyca
Copy link
Collaborator

@dickermoshe How about this one? This still won't solve the hot reload issue, but I think this is easier way to update the current page without decorator, builders and value listenable builders

#213

@felipecastrosales
Copy link

I keep thinking that it's a problem not to have a hot-reload when using this package, cc @ulusoyca. Yesterday I took a quick look at the package and couldn't identify what it could be.

@ulusoyca
Copy link
Collaborator

@felipecastrosales Indeed identifying the problem is a bit difficult. I thought I fixed it with #213 but nope. Hot reload partly works.

We will work on a larger refactor in H2. Fingers crossed 🤞🏻

@dickermoshe
Copy link
Contributor Author

@ulusoyca
I'm just wondering, what's wrong with wrapping each widget with a stateful builder under the hood?
Seems like a good temporary fix

@ulusoyca
Copy link
Collaborator

@ulusoyca I'm just wondering, what's wrong with wrapping each widget with a stateful builder under the hood? Seems like a good temporary fix

No problem at all, but how does it work? I am not sure how hot reload would work when it is done but very interested in learning. Do you mind showing with a PR?

BTW; what do you think about #213?

@dickermoshe
Copy link
Contributor Author

dickermoshe commented May 28, 2024 via email

@venbrinoDev
Copy link

Still having issue with hot reload using the WoltModalSheetPage

anyone got any fix to this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in triage
Projects
None yet
Development

No branches or pull requests

4 participants