Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the 'Share Omi for Mac' settings item to 'Get Omi for Mac' and changes the associated URL to a general download page. While the label and URL change are improvements, the action performed on tap is inconsistent with the new label. It uses Share.share which opens a share sheet, instead of directly opening the download URL. My review suggests correcting this by using url_launcher to provide a more intuitive user experience, and also notes that a try-catch block can be omitted for launching a hardcoded and valid URL.
| onTap: () async { | ||
| Navigator.pop(context); | ||
| await Share.share('https://apps.apple.com/us/app/omi-ai-scale-yourself/id6502156163'); | ||
| await Share.share('https://www.omi.me/pages/download'); | ||
| }, |
There was a problem hiding this comment.
The title of this settings item has been changed to 'Get Omi for Mac', which implies that tapping it will take the user to a place where they can download the Mac application. However, the onTap action uses Share.share, which opens a share sheet. This is inconsistent with the button's label and creates a confusing user experience.
To align the action with the user's expectation, you should use url_launcher to open the download page directly in the user's default browser. A try-catch block can be omitted for operations with a negligible chance of failure, such as launching a hardcoded and valid URL, to avoid unnecessary code complexity 1.
| onTap: () async { | |
| Navigator.pop(context); | |
| await Share.share('https://apps.apple.com/us/app/omi-ai-scale-yourself/id6502156163'); | |
| await Share.share('https://www.omi.me/pages/download'); | |
| }, | |
| onTap: () async { | |
| Navigator.pop(context); | |
| final Uri url = Uri.parse('https://www.omi.me/pages/download'); | |
| await launchUrl(url, mode: LaunchMode.externalApplication); | |
| }, |
Rules References
Footnotes
-
A try-catch block can be omitted for operations with a negligible chance of failure, such as launching a hardcoded and valid URL, to avoid unnecessary code complexity. ↩
There was a problem hiding this comment.
@krushnarout this is correct, it shd open link not share it
|
right now its only mac so link shd be still mac all u hv to do is instead of sharing it opens the link |
No description provided.