-
Notifications
You must be signed in to change notification settings - Fork 816
fix: Robotic arm UI #2776
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
base: flutter
Are you sure you want to change the base?
fix: Robotic arm UI #2776
Conversation
Reviewer's GuideThis PR overhauls the Robotic Arm UI to use dynamic, screen-relative sizing for improved responsiveness, refines widget styling (borders, radii, paddings, button themes), refactors the angle input dialog for auto-focus and modular helpers, and cleans up unused imports and constants. Class diagram for updated Robotic Arm UI widgetsclassDiagram
class RoboticArmControls {
+build(context)
-screenHeight
-responsive paddings, heights, and widget styling
}
class AngleInputTopDialog {
+build(context)
-_focusNode
-controller
+_angleButton(angle)
+dispose()
+initState()
}
class PlaybackSummaryDialog {
+build(context)
-responsive constraints and paddings
}
class TimelineScrollView {
+build(context)
-boxWidth
-boxHeight
-timeLineHeight
}
class ServoCard {
+build(context)
-sliderSize (responsive)
}
RoboticArmControls --> AngleInputTopDialog : opens
RoboticArmControls --> PlaybackSummaryDialog : opens
RoboticArmControls --> TimelineScrollView : uses
RoboticArmControls --> ServoCard : uses
ServoCard --> RoboticArmStateProvider : uses
TimelineScrollView --> RoboticArmStateProvider : uses
PlaybackSummaryDialog --> RoboticArmStateProvider : uses
AngleInputTopDialog --> RoboticArmStateProvider : uses
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rahul31124 - I've reviewed your changes - here's some feedback:
- In TimelineScrollView you reference
screenHeight
without defining it — addfinal screenHeight = MediaQuery.of(context).size.height;
at the top of build to avoid errors. - Extract recurring fractional sizing values (like
screenHeight * 0.026
or0.083
) into named constants or a helper to reduce magic numbers and improve readability. - You repeat the same border radius, padding, and side styles across multiple widgets — consider centralizing these into shared style constants or theme extensions to enforce consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In TimelineScrollView you reference `screenHeight` without defining it — add `final screenHeight = MediaQuery.of(context).size.height;` at the top of build to avoid errors.
- Extract recurring fractional sizing values (like `screenHeight * 0.026` or `0.083`) into named constants or a helper to reduce magic numbers and improve readability.
- You repeat the same border radius, padding, and side styles across multiple widgets — consider centralizing these into shared style constants or theme extensions to enforce consistency.
## Individual Comments
### Comment 1
<location> `lib/view/widgets/robotic_arm_summary.dart:374` </location>
<code_context>
return Container(
- width: 70,
- padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
+ width: MediaQuery.of(context).size.width * 0.09,
+ padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 2),
decoration: BoxDecoration(
</code_context>
<issue_to_address>
Stat card width now depends on screen width, which may cause layout issues on very small or large screens.
Consider adding min and max width constraints to prevent the cards from becoming unusably small or large on different devices.
Suggested implementation:
```
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 2),
decoration: BoxDecoration(
```
```
decoration: BoxDecoration(
```
```
),
);
```
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@AsCress @marcnause, could you please test and confirm if the UI has improved? |
Build successful. APKs to test: https://github.com/fossasia/pslab-android/actions/runs/16238200268/artifacts/3518773557 |
@rahul31124 Merging #2779 introduced conflicts with this PR. Could you please have a look and resolve them? |
Hello @marcnause, I have resolved the conflicts |
Changes
Improved the responsiveness of the Robotic Arm UI
robotic_arm_.webm
Checklist:
strings.xml
,dimens.xml
andcolors.xml
without hard coding any value.strings.xml
,dimens.xml
orcolors.xml
.Summary by Sourcery
Revamp the Robotic Arm UI for better responsiveness and unified styling across all widgets, replacing hardcoded dimensions and styles with relative sizing, streamlined layouts, and dynamic elements.
Enhancements: