diff --git a/ios/Flutter/Flutter.podspec b/ios/Flutter/Flutter.podspec deleted file mode 100644 index 5ca30416..00000000 --- a/ios/Flutter/Flutter.podspec +++ /dev/null @@ -1,18 +0,0 @@ -# -# NOTE: This podspec is NOT to be published. It is only used as a local source! -# - -Pod::Spec.new do |s| - s.name = 'Flutter' - s.version = '1.0.0' - s.summary = 'High-performance, high-fidelity mobile apps.' - s.description = <<-DESC -Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. - DESC - s.homepage = 'https://flutter.io' - s.license = { :type => 'MIT' } - s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } - s.ios.deployment_target = '8.0' - s.vendored_frameworks = 'Flutter.framework' -end diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 73040c46..fe534e6d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,5 +1,7 @@ PODS: - Flutter (1.0.0) + - in_app_review (0.2.0): + - Flutter - launch_review (0.0.1): - Flutter - package_info (0.0.1): @@ -17,6 +19,7 @@ PODS: DEPENDENCIES: - Flutter (from `Flutter`) + - in_app_review (from `.symlinks/plugins/in_app_review/ios`) - launch_review (from `.symlinks/plugins/launch_review/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) - share (from `.symlinks/plugins/share/ios`) @@ -28,6 +31,8 @@ DEPENDENCIES: EXTERNAL SOURCES: Flutter: :path: Flutter + in_app_review: + :path: ".symlinks/plugins/in_app_review/ios" launch_review: :path: ".symlinks/plugins/launch_review/ios" package_info: @@ -44,7 +49,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/webview_flutter/ios" SPEC CHECKSUMS: - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + in_app_review: 4a97249f7a2f539a0f294c2d9196b7fe35e49541 launch_review: 75d5a956ba8eaa493e9c9d4bf4c05e505e8d5ed0 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 share: 0b2c3e82132f5888bccca3351c504d0003b3b410 diff --git a/lib/models/auth.dart b/lib/models/auth.dart index 4023a43c..2fe010fc 100644 --- a/lib/models/auth.dart +++ b/lib/models/auth.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:async'; +import 'package:in_app_review/in_app_review.dart'; import 'package:universal_io/io.dart'; import 'package:git_touch/models/bitbucket.dart'; import 'package:git_touch/models/gitea.dart'; @@ -59,6 +60,9 @@ class BbPagePayload { class AuthModel with ChangeNotifier { static const _apiPrefix = 'https://api.github.com'; + static final inAppReview = InAppReview.instance; + var hasRequestedReview = false; + List _accounts; int activeAccountIndex; StreamSubscription _sub; @@ -430,6 +434,16 @@ class AuthModel with ChangeNotifier { _ghClient = null; _gqlClient = null; notifyListeners(); + + // waiting for 1min to request review + if (!hasRequestedReview) { + hasRequestedReview = true; + Timer(Duration(minutes: 1), () async { + if (await inAppReview.isAvailable()) { + inAppReview.requestReview(); + } + }); + } } // http timeout diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index f7cd3fcd..328042ca 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,11 +5,13 @@ import FlutterMacOS import Foundation +import in_app_review import package_info import shared_preferences_macos import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) FLTPackageInfoPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index 0812f1ff..69eaf1ef 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,36 +16,34 @@ environment: dependencies: flutter: sdk: flutter - flutter_vector_icons: ^0.2.1 - flutter_highlight: ^0.6.0 - primer: ^0.0.2 - nanoid: ^0.1.0 + artemis: ^3.2.1 + cupertino_icons: ^1.0.0 file_icon: ^0.3.0 - http: ^0.12.0 - intl: ^0.16.0 - url_launcher: ^5.4.1 - uni_links: ^0.4.0 + filesize: ^1.0.4 + fimber: ^0.4.4 + fluro: ^1.7.8 + flutter_highlight: ^0.6.0 flutter_markdown: ^0.4.4 - shared_preferences: ^0.5.6 - share: ^0.6.0 flutter_svg: ^0.19.0 + flutter_vector_icons: ^0.2.1 + github: ^7.0.3 + github_trending: ^1.0.0 + http: ^0.12.0 + in_app_review: ^1.0.4 + intl: ^0.16.0 launch_review: ^2.0.0 - timeago: ^2.0.18 + nanoid: ^0.1.0 + package_info: ^0.4.0 + primer: ^0.0.2 provider: ^4.3.2 - filesize: ^1.0.4 + share: ^0.6.0 + shared_preferences: ^0.5.6 + timeago: ^2.0.18 tuple: ^1.0.2 - uri: ^0.11.3 - fimber: ^0.4.4 - artemis: ^3.2.1 - fluro: ^1.7.7 - package_info: ^0.4.0 - github: ^7.0.3 - # path: ../../github/github.dart - github_trending: ^1.0.0 - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.0 + uni_links: ^0.4.0 universal_io: ^1.0.1 + uri: ^0.11.3 + url_launcher: ^5.4.1 webview_flutter: ^1.0.5 dev_dependencies: @@ -57,10 +55,8 @@ dev_dependencies: # dependencies_overrides: # flutter_highlight: # path: ../highlight/flutter_highlight - # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec - # The following section is specific to Flutter. flutter: uses-material-design: true