Skip to content

Conversation

meylis1998
Copy link

Summary

This PR addresses issue #15 by adding version detection warnings for hot reload in all commands that use the hot_reload tool.

Changes

  • /debug-app command: Added early Flutter version check in the "Dependency and Environment Checks" section that warns users if they're on Flutter stable ≤ 3.37.0 and provides clear workarounds
  • /create-app and /modify commands: Added inline warnings when using hot_reload to inform users about the limitation
  • CHANGELOG.md: Documented the new feature in the "Unreleased" section

Problem

Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0. This leaves users confused when hot reload fails without explanation.

Solution

Instead of waiting for the upstream Dart SDK fix, this PR improves the user experience by:

  1. Proactively checking Flutter version and warning users about the limitation
  2. Providing clear workarounds (switch to Flutter main channel or manually restart the app)
  3. Adding inline reminders when hot_reload is used

Testing

The warnings are embedded in command prompts and will be displayed by the AI assistant when users run the affected commands on Flutter stable ≤ 3.37.0.

Related Issues

Closes #15

Test Plan

  • Run /debug-app on Flutter stable ≤ 3.37.0 and verify version warning appears
  • Verify workarounds are clearly communicated
  • Confirm inline warnings appear when hot_reload is attempted

Add warnings in all commands that use hot_reload to inform users about
the known limitation on Flutter stable <= 3.37.0. This helps users
understand why hot reload may fail and provides clear guidance on
workarounds (switching to Flutter main channel or manually restarting
the app).

Changes:
- Updated /debug-app command to check Flutter version early and warn
  users about hot reload limitations
- Added inline warnings in /create-app and /modify commands when
  hot_reload is used
- Updated CHANGELOG.md to document this improvement

Related to gemini-cli-extensions#15
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the issue of hot reload failures on older Flutter versions by adding proactive warnings. The changes are clear and well-documented in the CHANGELOG. My review focuses on ensuring the accuracy and consistency of the information provided in the new warnings.

- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session
- Suggest they either:
1. Switch to Flutter main/master channel for full hot reload support, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The term main/master channel could be confusing. Flutter's main development branch is master. To provide clear and accurate guidance, it's better to refer specifically to the master channel.

    1. Switch to Flutter master channel for full hot reload support, OR

Copy link
Contributor

Choose a reason for hiding this comment

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

We should use "main".

@meylis1998
Copy link
Author

@sethladd @gspencergoog @johnpryan - Would appreciate your review on this improvement for issue #15.

This PR adds proactive warnings to help users understand the hot reload limitation on Flutter stable ≤ 3.37.0, providing clear workarounds until the upstream Dart SDK fix is available.

- [ ] Run `flutter doctor` to get the Flutter and Dart SDK versions and check for any issues reported.
- [ ] Check the Flutter version output and determine if hot reload is supported:
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session
Copy link
Contributor

@gspencergoog gspencergoog Oct 9, 2025

Choose a reason for hiding this comment

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

I'd just delete this item in favor of the suggestion I had for line 38.

- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session
- Suggest they either:
1. Switch to Flutter main/master channel for full hot reload support, OR
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use "main".

- [ ] Run `flutter doctor` to get the Flutter and Dart SDK versions and check for any issues reported.
- [ ] Check the Flutter version output and determine if hot reload is supported:
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app.

No need to reference the bug.

- [ ] Check the Flutter version output and determine if hot reload is supported:
- **IMPORTANT**: Hot reload through the Dart MCP server does not work reliably on Flutter stable ≤ 3.37.0 (see [issue #15](https://github.com/gemini-cli-extensions/flutter/issues/15))
- If the user is on Flutter stable ≤ 3.37.0, warn them that hot reload may fail during this debugging session
- Suggest they either:
Copy link
Contributor

@gspencergoog gspencergoog Oct 9, 2025

Choose a reason for hiding this comment

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

You can remove this entire item if you use the suggestion from line 38 above.

- Add strategic logging statements to the code to trace execution flow. Prefer `debugPrint()` over `print()` for cleaner, non-interfering output.
- Use `hot_reload` to apply logging changes quickly while preserving the app's state. If the state needs to be reset, explain that a Hot Restart is needed, and you will need to stop and restart the app.
- Use `hot_reload` to apply logging changes quickly while preserving the app's state.
- **Note**: If the user is on Flutter stable ≤ 3.37.0 and hot_reload fails, suggest they manually restart the app or switch to Flutter main channel
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Note**: If the user is on Flutter stable ≤ 3.37.0 and hot_reload fails, suggest they manually restart the app or switch to Flutter main channel
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app.

- [ ] Use `git diff` to verify the changes that have been made, and create a suitable commit message for any changes, following any guidelines you have about commit messages. Be sure to properly escape dollar signs and backticks, and present the change message to the user for approval.
- [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit.
- [ ] After commiting the change, if an app is running, use the hot_reload tool to reload it.
- **Note**: Hot reload does not work reliably on Flutter stable ≤ 3.37.0. If hot_reload fails, inform the user and suggest either switching to Flutter main channel or manually restarting the app.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Note**: Hot reload does not work reliably on Flutter stable ≤ 3.37.0. If hot_reload fails, inform the user and suggest either switching to Flutter main channel or manually restarting the app.
- Hot reload only works reliably on Flutter at versions at or above 3.37.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app.

@sethladd
Copy link
Collaborator

Hi @meylis1998 , any thoughts on the review?

@sethladd
Copy link
Collaborator

Might also address #8

@meylis1998
Copy link
Author

Hi @gspencergoog! Thanks for the thorough review. Your suggestions make the messaging much clearer and more user-friendly.

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.

Hot reload failed. App was running

3 participants