flet-review 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andreas Legner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: flet-review
3
+ Version: 0.1.1
4
+ Summary: In-app review prompt for Flet apps — wraps the Google Play / App Store review dialog
5
+ Author-email: Andreas Legner <hi@legner.beer>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/legnerbeer/flet-review
8
+ Project-URL: Documentation, https://legnerbeer.github.io/flet-review/
9
+ Project-URL: Repository, https://github.com/legnerbeer/flet-review
10
+ Project-URL: Issues, https://github.com/legnerbeer/flet-review/issues
11
+ Keywords: flet,flutter,in-app-review,rating,android,ios
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: Android
14
+ Classifier: Operating System :: iOS
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: flet>=1.0.0
19
+ Dynamic: license-file
20
+
21
+ # flet-review
22
+
23
+ In-app review prompt for [Flet](https://flet.dev) apps.
24
+
25
+ It wraps the [`in_app_review`](https://pub.dev/packages/in_app_review) Flutter
26
+ package, which in turn wraps Google Play's In-App Review API on Android and
27
+ `SKStoreReviewController` on iOS.
28
+
29
+ ## Platform Support
30
+
31
+ | Platform | iOS | Android | Web | Windows | macOS | Linux |
32
+ |-----------|-----|---------|-----|---------|-------|-------|
33
+ | Supported | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
34
+
35
+ On any other platform, `InAppReview` raises `FletUnsupportedPlatformException`.
36
+
37
+ ## Installation
38
+
39
+ Add `flet-review` to the `pyproject.toml` of your Flet project:
40
+
41
+ ```toml
42
+ dependencies = [
43
+ "flet-review",
44
+ "flet>=1.0.0",
45
+ ]
46
+ ```
47
+
48
+ Or straight from GitHub:
49
+
50
+ ```toml
51
+ dependencies = [
52
+ "flet-review @ git+https://github.com/legnerbeer/flet-review",
53
+ "flet>=1.0.0",
54
+ ]
55
+ ```
56
+
57
+ ## Running your app
58
+
59
+ Like any Flet extension with native code, the prebuilt client that a plain
60
+ `flet run` uses does **not** include it. Run on a device instead:
61
+
62
+ ```bash
63
+ flet debug android -d <device-id>
64
+ flet debug ios -d <device-id>
65
+ ```
66
+
67
+ (`flet debug --show-devices` lists connected devices.) Or build the app with
68
+ `flet build apk` / `flet build ipa`.
69
+
70
+ ## Usage
71
+
72
+ ```python
73
+ import flet as ft
74
+ from flet_review import InAppReview
75
+
76
+
77
+ async def main(page: ft.Page):
78
+ review = InAppReview()
79
+
80
+ async def rate_clicked(e):
81
+ await review.open_store_listing(app_store_id="1234567890")
82
+
83
+ async def after_positive_moment():
84
+ if await review.is_available():
85
+ await review.request_review()
86
+
87
+ page.add(ft.Button("Rate this app", on_click=rate_clicked))
88
+
89
+
90
+ ft.run(main)
91
+ ```
92
+
93
+ ### API
94
+
95
+ | Method | Description |
96
+ |--------|-------------|
97
+ | `await is_available() -> bool` | Whether the platform review API is reachable on this device. `True` doesn't guarantee a dialog will show. |
98
+ | `await request_review()` | Asks the platform to show its review dialog. Google and Apple apply their own quotas, so this may silently do nothing, and you can't tell whether the user rated. |
99
+ | `await open_store_listing(app_store_id=None)` | Always opens the app's Play Store / App Store page. `app_store_id` is the numeric iOS App Store id (ignored on Android). |
100
+
101
+ Call `request_review()` only after a clear positive moment (never right after
102
+ launch, onboarding or an error), and keep `open_store_listing()` as an explicit
103
+ "Rate us" button, since that always works.
104
+
105
+ ## License
106
+
107
+ [MIT](LICENSE)
@@ -0,0 +1,87 @@
1
+ # flet-review
2
+
3
+ In-app review prompt for [Flet](https://flet.dev) apps.
4
+
5
+ It wraps the [`in_app_review`](https://pub.dev/packages/in_app_review) Flutter
6
+ package, which in turn wraps Google Play's In-App Review API on Android and
7
+ `SKStoreReviewController` on iOS.
8
+
9
+ ## Platform Support
10
+
11
+ | Platform | iOS | Android | Web | Windows | macOS | Linux |
12
+ |-----------|-----|---------|-----|---------|-------|-------|
13
+ | Supported | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
14
+
15
+ On any other platform, `InAppReview` raises `FletUnsupportedPlatformException`.
16
+
17
+ ## Installation
18
+
19
+ Add `flet-review` to the `pyproject.toml` of your Flet project:
20
+
21
+ ```toml
22
+ dependencies = [
23
+ "flet-review",
24
+ "flet>=1.0.0",
25
+ ]
26
+ ```
27
+
28
+ Or straight from GitHub:
29
+
30
+ ```toml
31
+ dependencies = [
32
+ "flet-review @ git+https://github.com/legnerbeer/flet-review",
33
+ "flet>=1.0.0",
34
+ ]
35
+ ```
36
+
37
+ ## Running your app
38
+
39
+ Like any Flet extension with native code, the prebuilt client that a plain
40
+ `flet run` uses does **not** include it. Run on a device instead:
41
+
42
+ ```bash
43
+ flet debug android -d <device-id>
44
+ flet debug ios -d <device-id>
45
+ ```
46
+
47
+ (`flet debug --show-devices` lists connected devices.) Or build the app with
48
+ `flet build apk` / `flet build ipa`.
49
+
50
+ ## Usage
51
+
52
+ ```python
53
+ import flet as ft
54
+ from flet_review import InAppReview
55
+
56
+
57
+ async def main(page: ft.Page):
58
+ review = InAppReview()
59
+
60
+ async def rate_clicked(e):
61
+ await review.open_store_listing(app_store_id="1234567890")
62
+
63
+ async def after_positive_moment():
64
+ if await review.is_available():
65
+ await review.request_review()
66
+
67
+ page.add(ft.Button("Rate this app", on_click=rate_clicked))
68
+
69
+
70
+ ft.run(main)
71
+ ```
72
+
73
+ ### API
74
+
75
+ | Method | Description |
76
+ |--------|-------------|
77
+ | `await is_available() -> bool` | Whether the platform review API is reachable on this device. `True` doesn't guarantee a dialog will show. |
78
+ | `await request_review()` | Asks the platform to show its review dialog. Google and Apple apply their own quotas, so this may silently do nothing, and you can't tell whether the user rated. |
79
+ | `await open_store_listing(app_store_id=None)` | Always opens the app's Play Store / App Store page. `app_store_id` is the numeric iOS App Store id (ignored on Android). |
80
+
81
+ Call `request_review()` only after a clear positive moment (never right after
82
+ launch, onboarding or an error), and keep `open_store_listing()` as an explicit
83
+ "Rate us" button, since that always works.
84
+
85
+ ## License
86
+
87
+ [MIT](LICENSE)
@@ -0,0 +1,39 @@
1
+ [project]
2
+ name = "flet-review"
3
+ version = "0.1.1"
4
+ description = "In-app review prompt for Flet apps — wraps the Google Play / App Store review dialog"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [
10
+ { name = "Andreas Legner", email = "hi@legner.beer" }
11
+ ]
12
+ keywords = ["flet", "flutter", "in-app-review", "rating", "android", "ios"]
13
+ classifiers = [
14
+ "Programming Language :: Python :: 3",
15
+ "Operating System :: Android",
16
+ "Operating System :: iOS",
17
+ ]
18
+ dependencies = [
19
+ "flet>=1.0.0",
20
+ ]
21
+
22
+ [dependency-groups]
23
+ dev = [
24
+ "zensical",
25
+ "mkdocstrings-python",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/legnerbeer/flet-review"
30
+ Documentation = "https://legnerbeer.github.io/flet-review/"
31
+ Repository = "https://github.com/legnerbeer/flet-review"
32
+ Issues = "https://github.com/legnerbeer/flet-review/issues"
33
+
34
+ [tool.setuptools.package-data]
35
+ "flutter.flet_review" = ["**/*"]
36
+
37
+ [build-system]
38
+ requires = ["setuptools>=77"]
39
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from flet_review.flet_review import InAppReview
2
+
3
+ __all__ = ["InAppReview"]
@@ -0,0 +1,50 @@
1
+ from typing import Optional
2
+
3
+ import flet as ft
4
+
5
+ __all__ = ["InAppReview"]
6
+
7
+
8
+ @ft.control("InAppReview")
9
+ class InAppReview(ft.Service):
10
+ """Wraps the `in_app_review` Flutter plugin — Google Play's in-app
11
+ review dialog on Android, `SKStoreReviewController` on iOS.
12
+
13
+ `request_review()` is quota-gated by the platform itself (Google
14
+ Play allows it roughly once per app per account per ~30 days, and
15
+ only if its own eligibility checks pass) — it never tells you
16
+ whether anything was actually shown, let alone whether the user
17
+ rated. Per Google's review guidelines, call it only after a clear
18
+ positive moment (never right after launch, onboarding, or a bad
19
+ experience), and keep `open_store_listing()` as an explicit
20
+ "Rate us" fallback since it always works.
21
+ """
22
+
23
+ def before_update(self):
24
+ super().before_update()
25
+ if self.page.platform not in (ft.PagePlatform.ANDROID, ft.PagePlatform.IOS):
26
+ raise ft.FletUnsupportedPlatformException(
27
+ "InAppReview is only wired up for Android and iOS."
28
+ )
29
+
30
+ async def is_available(self) -> bool:
31
+ """Whether the platform's review API is reachable at all on this
32
+ device (e.g. Play Services present) — `True` here does not mean
33
+ `request_review()` will actually show a dialog."""
34
+ return bool(await self._invoke_method(method_name="is_available"))
35
+
36
+ async def request_review(self) -> None:
37
+ """Asks the platform to show its in-app review dialog. May be a
38
+ silent no-op if the platform's own quota/eligibility checks
39
+ don't pass — do not follow this with any "thanks for rating"
40
+ UI, since you can't tell if anything happened."""
41
+ await self._invoke_method(method_name="request_review")
42
+
43
+ async def open_store_listing(self, app_store_id: Optional[str] = None) -> None:
44
+ """Opens this app's Play Store / App Store listing directly, for
45
+ a manual "Rate us" button. `app_store_id` is the numeric iOS App
46
+ Store id (ignored on Android, which uses the package name)."""
47
+ await self._invoke_method(
48
+ method_name="open_store_listing",
49
+ arguments={"app_store_id": app_store_id},
50
+ )
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: flet-review
3
+ Version: 0.1.1
4
+ Summary: In-app review prompt for Flet apps — wraps the Google Play / App Store review dialog
5
+ Author-email: Andreas Legner <hi@legner.beer>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/legnerbeer/flet-review
8
+ Project-URL: Documentation, https://legnerbeer.github.io/flet-review/
9
+ Project-URL: Repository, https://github.com/legnerbeer/flet-review
10
+ Project-URL: Issues, https://github.com/legnerbeer/flet-review/issues
11
+ Keywords: flet,flutter,in-app-review,rating,android,ios
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Operating System :: Android
14
+ Classifier: Operating System :: iOS
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: flet>=1.0.0
19
+ Dynamic: license-file
20
+
21
+ # flet-review
22
+
23
+ In-app review prompt for [Flet](https://flet.dev) apps.
24
+
25
+ It wraps the [`in_app_review`](https://pub.dev/packages/in_app_review) Flutter
26
+ package, which in turn wraps Google Play's In-App Review API on Android and
27
+ `SKStoreReviewController` on iOS.
28
+
29
+ ## Platform Support
30
+
31
+ | Platform | iOS | Android | Web | Windows | macOS | Linux |
32
+ |-----------|-----|---------|-----|---------|-------|-------|
33
+ | Supported | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
34
+
35
+ On any other platform, `InAppReview` raises `FletUnsupportedPlatformException`.
36
+
37
+ ## Installation
38
+
39
+ Add `flet-review` to the `pyproject.toml` of your Flet project:
40
+
41
+ ```toml
42
+ dependencies = [
43
+ "flet-review",
44
+ "flet>=1.0.0",
45
+ ]
46
+ ```
47
+
48
+ Or straight from GitHub:
49
+
50
+ ```toml
51
+ dependencies = [
52
+ "flet-review @ git+https://github.com/legnerbeer/flet-review",
53
+ "flet>=1.0.0",
54
+ ]
55
+ ```
56
+
57
+ ## Running your app
58
+
59
+ Like any Flet extension with native code, the prebuilt client that a plain
60
+ `flet run` uses does **not** include it. Run on a device instead:
61
+
62
+ ```bash
63
+ flet debug android -d <device-id>
64
+ flet debug ios -d <device-id>
65
+ ```
66
+
67
+ (`flet debug --show-devices` lists connected devices.) Or build the app with
68
+ `flet build apk` / `flet build ipa`.
69
+
70
+ ## Usage
71
+
72
+ ```python
73
+ import flet as ft
74
+ from flet_review import InAppReview
75
+
76
+
77
+ async def main(page: ft.Page):
78
+ review = InAppReview()
79
+
80
+ async def rate_clicked(e):
81
+ await review.open_store_listing(app_store_id="1234567890")
82
+
83
+ async def after_positive_moment():
84
+ if await review.is_available():
85
+ await review.request_review()
86
+
87
+ page.add(ft.Button("Rate this app", on_click=rate_clicked))
88
+
89
+
90
+ ft.run(main)
91
+ ```
92
+
93
+ ### API
94
+
95
+ | Method | Description |
96
+ |--------|-------------|
97
+ | `await is_available() -> bool` | Whether the platform review API is reachable on this device. `True` doesn't guarantee a dialog will show. |
98
+ | `await request_review()` | Asks the platform to show its review dialog. Google and Apple apply their own quotas, so this may silently do nothing, and you can't tell whether the user rated. |
99
+ | `await open_store_listing(app_store_id=None)` | Always opens the app's Play Store / App Store page. `app_store_id` is the numeric iOS App Store id (ignored on Android). |
100
+
101
+ Call `request_review()` only after a clear positive moment (never right after
102
+ launch, onboarding or an error), and keep `open_store_listing()` as an explicit
103
+ "Rate us" button, since that always works.
104
+
105
+ ## License
106
+
107
+ [MIT](LICENSE)
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/flet_review/__init__.py
5
+ src/flet_review/flet_review.py
6
+ src/flet_review.egg-info/PKG-INFO
7
+ src/flet_review.egg-info/SOURCES.txt
8
+ src/flet_review.egg-info/dependency_links.txt
9
+ src/flet_review.egg-info/requires.txt
10
+ src/flet_review.egg-info/top_level.txt
11
+ src/flutter/flet_review/pubspec.yaml
12
+ src/flutter/flet_review/lib/flet_review.dart
13
+ src/flutter/flet_review/lib/src/extension.dart
14
+ src/flutter/flet_review/lib/src/flet_review.dart
@@ -0,0 +1 @@
1
+ flet>=1.0.0
@@ -0,0 +1,2 @@
1
+ flet_review
2
+ flutter
@@ -0,0 +1,3 @@
1
+ library flet_review;
2
+
3
+ export "src/extension.dart" show Extension;
@@ -0,0 +1,15 @@
1
+ import 'package:flet/flet.dart';
2
+
3
+ import 'flet_review.dart';
4
+
5
+ class Extension extends FletExtension {
6
+ @override
7
+ FletService? createService(Control control) {
8
+ switch (control.type) {
9
+ case "InAppReview":
10
+ return InAppReviewService(control: control);
11
+ default:
12
+ return null;
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,44 @@
1
+ import 'package:flet/flet.dart';
2
+ import 'package:flutter/widgets.dart';
3
+ import 'package:in_app_review/in_app_review.dart';
4
+
5
+ class InAppReviewService extends FletService {
6
+ InAppReviewService({required super.control});
7
+
8
+ @override
9
+ void init() {
10
+ super.init();
11
+ debugPrint("InAppReview(${control.id}).init: ${control.properties}");
12
+ control.addInvokeMethodListener(_invokeMethod);
13
+ }
14
+
15
+ Future<dynamic> _invokeMethod(String name, dynamic args) async {
16
+ debugPrint("InAppReview.$name($args)");
17
+ switch (name) {
18
+ case "is_available":
19
+ return await InAppReview.instance.isAvailable();
20
+
21
+ case "request_review":
22
+ // Google/Apple decide whether anything actually shows (quota,
23
+ // eligibility) — this never throws just because it was skipped.
24
+ await InAppReview.instance.requestReview();
25
+ return null;
26
+
27
+ case "open_store_listing":
28
+ await InAppReview.instance.openStoreListing(
29
+ appStoreId: args['app_store_id'] as String?,
30
+ );
31
+ return null;
32
+
33
+ default:
34
+ throw Exception("Unknown InAppReview method: $name");
35
+ }
36
+ }
37
+
38
+ @override
39
+ void dispose() {
40
+ debugPrint("InAppReview(${control.id}).dispose()");
41
+ control.removeInvokeMethodListener(_invokeMethod);
42
+ super.dispose();
43
+ }
44
+ }
@@ -0,0 +1,20 @@
1
+ name: flet_review
2
+ description: Flet extension wrapping the in_app_review plugin (Google Play / App Store review prompt).
3
+ version: 0.1.1
4
+ publish_to: none
5
+
6
+ environment:
7
+ sdk: '>=3.3.0 <4.0.0'
8
+ flutter: ">=1.17.0"
9
+
10
+ dependencies:
11
+ flet: ^1.0.0
12
+ flutter:
13
+ sdk: flutter
14
+
15
+ in_app_review: ^2.0.9
16
+
17
+ dev_dependencies:
18
+ flutter_test:
19
+ sdk: flutter
20
+ flutter_lints: ^3.0.0