Skip to content
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

PAINTROID-704: Remove launch_review package #44

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -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!'),
Expand Down Expand Up @@ -40,12 +42,27 @@ class _MainOverFlowMenuState extends ConsumerState<MainOverflowMenu> {
);
}

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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the variable and change its value.
iOSAppId would be obsolete right now.

);
launchUrl(
url,
mode: LaunchMode.externalApplication,
);
}
}

Future<void> _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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/features/landing_page_screen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading