Skip to content

Commit d832e43

Browse files
authored
refactor: minor UI enhancements (#2791)
1 parent 198a5ec commit d832e43

File tree

7 files changed

+34
-6
lines changed

7 files changed

+34
-6
lines changed

lib/l10n/app_en.arb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@
326326
"sharingMessage": "Sharing PSLab Data",
327327
"delete": "Delete",
328328
"deleteHint": "Are you sure you want to delete this file?",
329+
"documentationLink" : "https://docs.pslab.io/",
330+
"documentationError" : "Could not open the documentation link",
329331
"deleteFile": "Delete File",
330332
"deleteAllData": "Delete All Data",
331333
"deleteCautionMessage": "Are you sure you want to delete all logged data for this instrument?",

lib/l10n/app_localizations.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,6 +2248,18 @@ abstract class AppLocalizations {
22482248
/// **'Please provide the maximum limit of lux value to be recorded'**
22492249
String get accelerometerHighLimitHint;
22502250

2251+
/// No description provided for @documentationLink.
2252+
///
2253+
/// In en, this message translates to:
2254+
/// **'https://docs.pslab.io/'**
2255+
String get documentationLink;
2256+
2257+
/// No description provided for @documentationError.
2258+
///
2259+
/// In en, this message translates to:
2260+
/// **'Could not open the documentation link'**
2261+
String get documentationError;
2262+
22512263
/// No description provided for @roboticArmIntro.
22522264
///
22532265
/// In en, this message translates to:
@@ -2259,6 +2271,7 @@ abstract class AppLocalizations {
22592271
/// In en, this message translates to:
22602272
/// **'• 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.'**
22612273
String get roboticArmConnection;
2274+
22622275
}
22632276

22642277
class _AppLocalizationsDelegate

lib/l10n/app_localizations_en.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,12 @@ class AppLocalizationsEn extends AppLocalizations {
11521152
String get accelerometerHighLimitHint =>
11531153
'Please provide the maximum limit of lux value to be recorded';
11541154

1155+
@override
1156+
String get documentationLink => 'https://docs.pslab.io/';
1157+
1158+
@override
1159+
String get documentationError => 'Could not open the documentation link';
1160+
11551161
@override
11561162
String get roboticArmIntro =>
11571163
'• 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.';

lib/providers/robotic_arm_state_provider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class RoboticArmStateProvider extends ChangeNotifier {
4545
VoidCallback? onPlaybackEnd;
4646

4747
RoboticArmStateProvider() {
48-
_initTimelineDegrees();
4948
_selectedFrequency = appLocalizations.frequency50Hz;
5049
_selectedMaxAngle = appLocalizations.angle180;
5150
_selectedDuration = appLocalizations.duration1Min;
51+
_initTimelineDegrees();
5252
}
5353

5454
void _initTimelineDegrees() {

lib/view/faq_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class FAQScreen extends StatelessWidget {
124124
child: Row(
125125
children: [
126126
const SizedBox(
127-
width: 25,
127+
width: 15,
128128
),
129129
Text(
130130
faq.linkText!,

lib/view/widgets/navigation_drawer.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,15 @@ class _NavDrawerState extends State<NavDrawer> {
253253
fontSize: 14,
254254
),
255255
),
256-
onTap: () {
257-
/**/
256+
onTap: () async {
257+
final launched = await launchUrl(
258+
Uri.parse(appLocalizations.documentationLink));
259+
if (!launched && context.mounted) {
260+
ScaffoldMessenger.of(context).showSnackBar(
261+
SnackBar(
262+
content: Text(appLocalizations.documentationError)),
263+
);
264+
}
258265
},
259266
),
260267
ListTile(

lib/view/widgets/servo_card.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ServoCard extends StatelessWidget {
2727
Widget build(BuildContext context) {
2828
final provider = Provider.of<RoboticArmStateProvider>(context);
2929
final sliderSize =
30-
provider.maxAngle == 180 ? cardHeight * 0.95 : cardHeight * 0.72;
30+
provider.maxAngle == 180 ? cardHeight * 0.95 : cardHeight * 0.75;
3131

3232
return Container(
3333
decoration: BoxDecoration(
@@ -108,7 +108,7 @@ class ServoCard extends StatelessWidget {
108108
),
109109
infoProperties: InfoProperties(
110110
mainLabelStyle: TextStyle(
111-
fontSize: 22,
111+
fontSize: 25,
112112
color: Colors.black,
113113
fontWeight: FontWeight.normal,
114114
shadows: [

0 commit comments

Comments
 (0)