diff --git a/packages/features/landing_page_screen/lib/src/components/main_overflow_menu.dart b/packages/features/landing_page_screen/lib/src/components/main_overflow_menu.dart index ab968f0c..af121654 100644 --- a/packages/features/landing_page_screen/lib/src/components/main_overflow_menu.dart +++ b/packages/features/landing_page_screen/lib/src/components/main_overflow_menu.dart @@ -1,9 +1,11 @@ +import 'dart:io'; + import 'package:component_library/component_library.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:io_library/io_library.dart'; -import 'package:launch_review/launch_review.dart'; import 'package:package_info_plus/package_info_plus.dart'; +import 'package:url_launcher/url_launcher.dart'; enum MainOverflowMenuOption { rate('Rate us!'), @@ -40,12 +42,27 @@ class _MainOverFlowMenuState extends ConsumerState { ); } + void _openStore() { + if (Platform.isAndroid || Platform.isIOS) { + final appId = Platform.isAndroid ? androidAppId : iOSAppId; + final url = Uri.parse( + Platform.isAndroid + ? 'market://details?id=$appId' + : 'https://apps.apple.com/at/app/pocket-code/id1117935892', + ); + launchUrl( + url, + mode: LaunchMode.externalApplication, + ); + } + } + Future _handleSelectedOption(MainOverflowMenuOption option) async { PackageInfo packageInfo = await PackageInfo.fromPlatform(); String version = packageInfo.version; switch (option) { case MainOverflowMenuOption.rate: - LaunchReview.launch(androidAppId: androidAppId, iOSAppId: iOSAppId); + _openStore(); break; case MainOverflowMenuOption.help: if (mounted) { diff --git a/packages/features/landing_page_screen/pubspec.yaml b/packages/features/landing_page_screen/pubspec.yaml index 09e115ea..f78cd309 100644 --- a/packages/features/landing_page_screen/pubspec.yaml +++ b/packages/features/landing_page_screen/pubspec.yaml @@ -19,9 +19,9 @@ dependencies: toast: ^0.3.0 oxidized: ^5.2.0 flutter_svg: ^1.1.0 - launch_review: ^3.0.1 package_info_plus: ^4.0.1 filesize: ^2.0.1 + url_launcher: ^6.1.5 # Internal packages component_library: diff --git a/pubspec.lock b/pubspec.lock index 23ee001e..be464b6f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -694,14 +694,6 @@ packages: relative: true source: path version: "0.0.1" - launch_review: - dependency: transitive - description: - name: launch_review - sha256: "04cdaf752033cefd53bc0fa9c22105801ef53791a93d8b6cdd00fcb3c1c1604b" - url: "https://pub.dev" - source: hosted - version: "3.0.1" lints: dependency: transitive description: