-
Notifications
You must be signed in to change notification settings - Fork 16
Added condition to display Range Order badge #256
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
Conversation
Changes Made: 1. Updated Badge Display Logic: Modified _getTopRightWidget() to check both conditions: - _isRangeMode (user has focused the second input) - _maxAmountController.text.isNotEmpty (second input has actual content) 2. Added Real-time Updates: - Added listener to _maxAmountController in initState() - Created _onMaxAmountChanged() method to trigger rebuilds when max amount content changes - Removed redundant onChanged callback from max amount TextFormField User Experience Flow: 1. User types in first input → second input appears 2. User taps/focuses second input → range mode activates but badge doesn't show yet 3. User types in second input → "Range Order" badge appears 4. User deletes content from second input → badge disappears (indicates regular order) 5. User types again in second input → badge reappears Technical Implementation: - Badge only shows when _isRangeMode && _maxAmountController.text.isNotEmpty - Real-time updates through controller listener ensure immediate visual feedback - Clean separation between focus detection (range mode) and content validation (badge display) The Range Order badge now provides accurate visual feedback that reflects the actual order type being created.
WalkthroughThe update modifies the behavior of the amount input section in the order feature. It introduces a listener to the max amount text controller, ensuring UI updates and notifications occur when the max amount changes. The logic for displaying the "range order" badge is also refined to depend on both range mode and non-empty max amount input. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AmountSectionWidget
participant MaxAmountController
User->>MaxAmountController: Edit max amount input
MaxAmountController-->>AmountSectionWidget: Triggers _onMaxAmountChanged listener
AmountSectionWidget->>AmountSectionWidget: setState() (rebuild UI)
AmountSectionWidget->>AmountSectionWidget: _notifyAmountChanged()
AmountSectionWidget->>AmountSectionWidget: Evaluate badge display condition
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
lib/**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
**/*.dart📄 CodeRabbit Inference Engine (CLAUDE.md)
Files:
🔇 Additional comments (3)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Changes Made:
User Experience Flow:
Technical Implementation:
The Range Order badge now provides accurate visual feedback that reflects the actual order type being created.
Summary by CodeRabbit