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

fix: hot reload didn't work property #61

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

tomcheung
Copy link
Contributor

@tomcheung tomcheung commented Feb 21, 2024

Description

Fixed hot reload didn't work proprety when running in macOS desktop mode

This is due to behaviour change in go_router start from 13.0, go_router pageBuilder no longer called after hot reload, that mean slide.widget.build(context) will only call once on init state, and cause FlutterDeckSlideWidget.build will not call again to reflect the change (like change the title in FlutterDeckSlide.title(title: 'xxx'))

pageBuilder: (context, state) => CustomTransitionPage(
key: state.pageKey,
restorationId: state.pageKey.value,
transitionsBuilder: slide.configuration.transition.build,
child: slide.widget.build(context),

Do fix this issue, this PR will move slide.widget.build(context) to a wrapper widget so it will trigger when hot reload is performed

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@tomcheung tomcheung force-pushed the fix/hot-reload-issue branch from 40b7de9 to 0b93ff6 Compare February 22, 2024 17:36
Copy link
Owner

@mkobuolys mkobuolys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you! Also, please, add release notes at the top of the CHANGELOG.md file, like:

# NEXT

fix: hot reload doesn't work on MacOS

@tomcheung
Copy link
Contributor Author

Thanks for suggestion, updated in 66ebc7e

Copy link
Owner

@mkobuolys mkobuolys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@mkobuolys mkobuolys merged commit 3990345 into mkobuolys:main Feb 23, 2024
3 checks passed
@tomcheung tomcheung deleted the fix/hot-reload-issue branch February 23, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants