Skip to content

refactor: minor UI enhancements #2791

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

Merged
merged 8 commits into from
Aug 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
"sharingMessage": "Sharing PSLab Data",
"delete": "Delete",
"deleteHint": "Are you sure you want to delete this file?",
"documentationLink" : "https://docs.pslab.io/",
"documentationError" : "Could not open the documentation link",
"deleteFile": "Delete File",
"deleteAllData": "Delete All Data",
"deleteCautionMessage": "Are you sure you want to delete all logged data for this instrument?",
Expand Down
13 changes: 13 additions & 0 deletions lib/l10n/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,18 @@ abstract class AppLocalizations {
/// **'Please provide the maximum limit of lux value to be recorded'**
String get accelerometerHighLimitHint;

/// No description provided for @documentationLink.
///
/// In en, this message translates to:
/// **'https://docs.pslab.io/'**
String get documentationLink;

/// No description provided for @documentationError.
///
/// In en, this message translates to:
/// **'Could not open the documentation link'**
String get documentationError;

/// No description provided for @roboticArmIntro.
///
/// In en, this message translates to:
Expand All @@ -2259,6 +2271,7 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'• In the above figure, SQ1 is connected to the signal pin of the first servo motor. The servo\'s GND pin is connected to both the PSLab’s GND and the external power supply GND, while the VCC pin is connected to the external power supply VCC.\n• Similarly, connect the remaining servos to SQ2, SQ3, and SQ4 along with their respective GND and power supply connections.\n• Once connected, each servo can be controlled using either circular sliders for manual control or a timeline-based sequence for automated movement.'**
String get roboticArmConnection;

}

class _AppLocalizationsDelegate
Expand Down
6 changes: 6 additions & 0 deletions lib/l10n/app_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,12 @@ class AppLocalizationsEn extends AppLocalizations {
String get accelerometerHighLimitHint =>
'Please provide the maximum limit of lux value to be recorded';

@override
String get documentationLink => 'https://docs.pslab.io/';

@override
String get documentationError => 'Could not open the documentation link';

@override
String get roboticArmIntro =>
'• A robotic arm is a programmable mechanical device that mimics the movement of a human arm.\n• It uses servo motors to control its motion, and these motors are operated using PWM signals.\n• The PSLab provides four PWM square wave generators (SQ1, SQ2, SQ3, SQ4), allowing control of up to four servo motors and enabling a robotic arm with up to four degrees of freedom.';
Expand Down
2 changes: 1 addition & 1 deletion lib/providers/robotic_arm_state_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class RoboticArmStateProvider extends ChangeNotifier {
VoidCallback? onPlaybackEnd;

RoboticArmStateProvider() {
_initTimelineDegrees();
_selectedFrequency = appLocalizations.frequency50Hz;
_selectedMaxAngle = appLocalizations.angle180;
_selectedDuration = appLocalizations.duration1Min;
_initTimelineDegrees();
}

void _initTimelineDegrees() {
Expand Down
2 changes: 1 addition & 1 deletion lib/view/faq_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class FAQScreen extends StatelessWidget {
child: Row(
children: [
const SizedBox(
width: 25,
width: 15,
),
Text(
faq.linkText!,
Expand Down
11 changes: 9 additions & 2 deletions lib/view/widgets/navigation_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,15 @@ class _NavDrawerState extends State<NavDrawer> {
fontSize: 14,
),
),
onTap: () {
/**/
onTap: () async {
final launched = await launchUrl(
Uri.parse(appLocalizations.documentationLink));
if (!launched && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(appLocalizations.documentationError)),
);
}
},
),
ListTile(
Expand Down
4 changes: 2 additions & 2 deletions lib/view/widgets/servo_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ServoCard extends StatelessWidget {
Widget build(BuildContext context) {
final provider = Provider.of<RoboticArmStateProvider>(context);
final sliderSize =
provider.maxAngle == 180 ? cardHeight * 0.95 : cardHeight * 0.72;
provider.maxAngle == 180 ? cardHeight * 0.95 : cardHeight * 0.75;

return Container(
decoration: BoxDecoration(
Expand Down Expand Up @@ -108,7 +108,7 @@ class ServoCard extends StatelessWidget {
),
infoProperties: InfoProperties(
mainLabelStyle: TextStyle(
fontSize: 22,
fontSize: 25,
color: Colors.black,
fontWeight: FontWeight.normal,
shadows: [
Expand Down
Loading