Skip to content

Commit 681ca7c

Browse files
fix: shop link & ui tweak (#2762)
Co-authored-by: Padmal <[email protected]>
1 parent aa602a1 commit 681ca7c

File tree

3 files changed

+28
-21
lines changed

3 files changed

+28
-21
lines changed

lib/constants.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,3 +336,5 @@ String buyPsLabMenu = 'Buy PSLab';
336336
String faqMenu = 'FAQ';
337337
String shareAppMenu = 'Share App';
338338
String privacyPolicyMenu = 'Privacy Policy';
339+
String shopLink = 'https://pslab.io/shop/';
340+
String shopError = 'Could not open the shop link';

lib/view/widgets/data_analysis_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
304304
),
305305
),
306306
SizedBox(
307-
width: 50,
307+
width: 55,
308308
child: TextField(
309309
controller: TextEditingController(
310310
text:

lib/view/widgets/navigation_drawer.dart

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:provider/provider.dart';
33
import 'package:pslab/constants.dart';
44
import 'package:pslab/providers/board_state_provider.dart';
5+
import 'package:url_launcher/url_launcher.dart';
56

67
import '../../theme/colors.dart';
78

@@ -277,27 +278,31 @@ class _NavDrawerState extends State<NavDrawer> {
277278
},
278279
),
279280
ListTile(
280-
focusColor: listTileFocusColor,
281-
dense: true,
282-
leading: Icon(
283-
Icons.shopping_cart,
284-
color:
285-
widget.selectedIndex == 8 ? selectedMenuColor : menuColor,
286-
),
287-
title: Text(
288-
buyPsLabMenu,
289-
style: TextStyle(
290-
color: widget.selectedIndex == 8
291-
? selectedMenuColor
292-
: Theme.of(context).colorScheme.onSurface,
293-
fontWeight: FontWeight.bold,
294-
fontSize: 14,
281+
focusColor: listTileFocusColor,
282+
dense: true,
283+
leading: Icon(
284+
Icons.shopping_cart,
285+
color:
286+
widget.selectedIndex == 8 ? selectedMenuColor : menuColor,
295287
),
296-
),
297-
onTap: () {
298-
/**/
299-
},
300-
),
288+
title: Text(
289+
buyPsLabMenu,
290+
style: TextStyle(
291+
color: widget.selectedIndex == 8
292+
? selectedMenuColor
293+
: Theme.of(context).colorScheme.onSurface,
294+
fontWeight: FontWeight.bold,
295+
fontSize: 14,
296+
),
297+
),
298+
onTap: () async {
299+
final launched = await launchUrl(Uri.parse(shopLink));
300+
if (!launched && context.mounted) {
301+
ScaffoldMessenger.of(context).showSnackBar(
302+
SnackBar(content: Text(shopError)),
303+
);
304+
}
305+
}),
301306
ListTile(
302307
focusColor: listTileFocusColor,
303308
dense: true,

0 commit comments

Comments
 (0)