Support weighted items in FortuneWheel#138
Conversation
This change allows `FortuneItem`s to have a `weight` property, which determines the angular size of the slice in the `FortuneWheel`. - Added `double weight` to `FortuneItem`. - Updated `FortuneWheel` to calculate slice angles and rotation based on weights. - Updated `_borderCross` to handle weighted sectors for haptic feedback and focus events.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
remove the pubspec.lock change. |
I have removed the |
- Added `double weight` property to `FortuneItem`. - Updated `FortuneWheel` to calculate slice angles based on item weights. - Updated `FortuneBar` to calculate item widths based on item weights. - Refactored `_InfiniteBar` to handle variable item widths. - Added tests for weighted items. - Reverted unintentional `pubspec.lock` changes.
|
|
||
| void main() { | ||
| group('FortuneBar Weighted Items', () { | ||
| testWidgets('renders items with different weights', (tester) async { |
There was a problem hiding this comment.
I have updated test/weighted_test.dart to verify the actual widths (for FortuneBar) and angles (for FortuneWheel) of the rendered items, ensuring the weights are correctly applied.
- Added `double weight` property to `FortuneItem`. - Updated `FortuneWheel` to calculate slice angles based on item weights. - Updated `FortuneBar` to calculate item widths based on item weights. - Refactored `_InfiniteBar` to handle variable item widths. - Added comprehensive tests for weighted items verifying rendering sizes and angles. - Reverted unintentional `pubspec.lock` changes.
Implemented weighted items for FortuneWheel. Each item can now have a weight, and the slice size is proportional to the weight. Fixed haptic feedback and selection logic to work with non-uniform slices.
PR created automatically by Jules for task 5010871680406073538 started by @kevlatus