diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 80a7fce..c998e9e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ { @override void initState() { super.initState(); - // appReview(); + appReview(); // checkDatabaseUpdates(); } diff --git a/lib/screens/search.dart b/lib/screens/search.dart index 4d7f86d..e382287 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -99,6 +99,8 @@ class _SearchState extends State { void buildDefinitionOnSubmission(BuildContext context, String searchWord, DefinitionProvider definitionListConsumer) async { + definitionListConsumer.searchWord = searchWord; + definitionListConsumer.searchType = 'FullTextSearch'; DefinitionProvider value = await databaseObject.definition(searchWord, 'FullTextSearch'); definitionListConsumer.updateDefinition( @@ -141,7 +143,7 @@ class _SearchState extends State { } Widget buildItem(BuildContext context, String searchWord, - DefinitionProvider definitionList) { + DefinitionProvider definitionListConsumer) { final model = Provider.of(context, listen: false); return Column( @@ -149,11 +151,11 @@ class _SearchState extends State { children: [ InkWell( onTap: () async { - definitionList.searchType = + definitionListConsumer.searchType = allAlphabets.contains(searchWord.substring(0, 1)) ? 'RootSearch' : 'FullTextSearch'; - definitionList.searchWord = searchWord; + definitionListConsumer.searchWord = searchWord; model.addHistory(searchWord); Future.delayed( const Duration(milliseconds: 50000), @@ -161,8 +163,8 @@ class _SearchState extends State { ); FloatingSearchBar.of(context)!.close(); DefinitionProvider value = await databaseObject.definition( - searchWord, definitionList.searchType); - definitionList.updateDefinition( + searchWord, definitionListConsumer.searchType); + definitionListConsumer.updateDefinition( value.id, value.word, value.definition, diff --git a/lib/services/app_review.dart b/lib/services/app_review.dart index fb27aa4..48bc759 100644 --- a/lib/services/app_review.dart +++ b/lib/services/app_review.dart @@ -1,14 +1,14 @@ -// import '../service_locator.dart'; -// import 'local_storage_service.dart'; -// import 'package:in_app_review/in_app_review.dart'; +import '../service_locator.dart'; +import 'local_storage_service.dart'; +import 'package:in_app_review/in_app_review.dart'; -// void appReview() async { -// if (locator().appUsage > 15) { -// final InAppReview inAppReview = InAppReview.instance; -// if (await inAppReview.isAvailable()) { -// inAppReview.requestReview(); -// } -// } else { -// locator().appUsage++; -// } -// } +void appReview() async { + if (locator().appUsage > 15) { + final InAppReview inAppReview = InAppReview.instance; + if (await inAppReview.isAvailable()) { + inAppReview.requestReview(); + } + } else { + locator().appUsage++; + } +} diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index d41a8a6..c53aa8a 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,7 @@ import FlutterMacOS import Foundation import audio_session +import in_app_review import just_audio import package_info_plus import path_provider_foundation @@ -18,6 +19,7 @@ import wakelock_plus func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) + InAppReviewPlugin.register(with: registry.registrar(forPlugin: "InAppReviewPlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 63c9ace..255f10d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -488,6 +488,22 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + in_app_review: + dependency: "direct main" + description: + name: in_app_review + sha256: "41ec6f30427ab09eb6ae1c85c4a2a624a145fc5d726f023de4d97170ec9e5466" + url: "https://pub.dev" + source: hosted + version: "2.0.8" + in_app_review_platform_interface: + dependency: transitive + description: + name: in_app_review_platform_interface + sha256: fed2c755f2125caa9ae10495a3c163aa7fab5af3585a9c62ef4a6920c5b45f10 + url: "https://pub.dev" + source: hosted + version: "2.0.5" io: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 2220d9b..d94a81e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 1.15.5+64 +version: 1.15.6+65 environment: sdk: ">=2.16.0 <4.0.0" @@ -22,7 +22,7 @@ dependencies: shared_preferences: ^2.2.2 share_plus: ^7.2.1 get_it: ^7.6.4 - # in_app_review: ^2.0.8 + in_app_review: ^2.0.8 flutter_colorpicker: ^1.0.3 sqflite_common_ffi: ^2.3.0+2 html: ^0.15.4