Skip to content

Commit f7c1663

Browse files
committedDec 10, 2021
Added toggle for toast and custom toast text
1 parent bd4045a commit f7c1663

File tree

10 files changed

+367
-2
lines changed

10 files changed

+367
-2
lines changed
 

‎.dart_tool/package_config.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"configVersion": 2,
3+
"packages": [
4+
{
5+
"name": "characters",
6+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0",
7+
"packageUri": "lib/",
8+
"languageVersion": "2.12"
9+
},
10+
{
11+
"name": "collection",
12+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0",
13+
"packageUri": "lib/",
14+
"languageVersion": "2.12"
15+
},
16+
{
17+
"name": "flutter",
18+
"rootUri": "file:///C:/flutter/packages/flutter",
19+
"packageUri": "lib/",
20+
"languageVersion": "2.12"
21+
},
22+
{
23+
"name": "meta",
24+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0",
25+
"packageUri": "lib/",
26+
"languageVersion": "2.12"
27+
},
28+
{
29+
"name": "sky_engine",
30+
"rootUri": "file:///C:/flutter/bin/cache/pkg/sky_engine",
31+
"packageUri": "lib/",
32+
"languageVersion": "2.12"
33+
},
34+
{
35+
"name": "typed_data",
36+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0",
37+
"packageUri": "lib/",
38+
"languageVersion": "2.12"
39+
},
40+
{
41+
"name": "vector_math",
42+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1",
43+
"packageUri": "lib/",
44+
"languageVersion": "2.14"
45+
},
46+
{
47+
"name": "launch_review",
48+
"rootUri": "../",
49+
"packageUri": "lib/",
50+
"languageVersion": "2.12"
51+
}
52+
],
53+
"generated": "2021-12-10T11:10:32.367987Z",
54+
"generator": "pub",
55+
"generatorVersion": "2.15.0"
56+
}

‎.dart_tool/package_config_subset

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
launch_review
2+
2.12
3+
file:///C:/Users/patrik/dev/git%20projects/launch_review/
4+
file:///C:/Users/patrik/dev/git%20projects/launch_review/lib/
5+
characters
6+
2.12
7+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0/
8+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0/lib/
9+
collection
10+
2.12
11+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/
12+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
13+
meta
14+
2.12
15+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/
16+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/
17+
typed_data
18+
2.12
19+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/
20+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
21+
vector_math
22+
2.14
23+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1/
24+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1/lib/
25+
sky_engine
26+
2.12
27+
file:///C:/flutter/bin/cache/pkg/sky_engine/
28+
file:///C:/flutter/bin/cache/pkg/sky_engine/lib/
29+
flutter
30+
2.12
31+
file:///C:/flutter/packages/flutter/
32+
file:///C:/flutter/packages/flutter/lib/
33+
2

‎.dart_tool/version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.8.0

‎android/src/main/java/com/iyaffle/launchreview/LaunchReviewPlugin.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ public static void registerWith(Registrar registrar) {
4646
public void onMethodCall(MethodCall call, Result result) {
4747
if (call.method.equals("launch")) {
4848
String appId = call.argument("android_id");
49+
String toastMessage = call.argument("toast_message");
50+
boolean showToast = call.argument("show_toast");
4951

5052
if (appId == null) {
5153
appId = activity.getPackageName();
5254
}
5355

56+
if (toastMessage == null){
57+
toastMessage = "Please Rate Application";
58+
}
5459
Intent rateIntent = new Intent(Intent.ACTION_VIEW,
5560
Uri.parse("market://details?id=" + appId));
5661
boolean marketFound = false;
@@ -78,7 +83,9 @@ public void onMethodCall(MethodCall call, Result result) {
7883
// this make sure only the Google Play app is allowed to
7984
// intercept the intent
8085
rateIntent.setComponent(componentName);
81-
Toast.makeText(activity, "Please Rate Application", Toast.LENGTH_SHORT).show();
86+
if (showToast){
87+
Toast.makeText(activity, toastMessage, Toast.LENGTH_SHORT).show();
88+
}
8289

8390
activity.startActivity(rateIntent);
8491
marketFound = true;
+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
{
2+
"configVersion": 2,
3+
"packages": [
4+
{
5+
"name": "async",
6+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.2",
7+
"packageUri": "lib/",
8+
"languageVersion": "2.12"
9+
},
10+
{
11+
"name": "boolean_selector",
12+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0",
13+
"packageUri": "lib/",
14+
"languageVersion": "2.12"
15+
},
16+
{
17+
"name": "characters",
18+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0",
19+
"packageUri": "lib/",
20+
"languageVersion": "2.12"
21+
},
22+
{
23+
"name": "charcode",
24+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.3.1",
25+
"packageUri": "lib/",
26+
"languageVersion": "2.12"
27+
},
28+
{
29+
"name": "clock",
30+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0",
31+
"packageUri": "lib/",
32+
"languageVersion": "2.12"
33+
},
34+
{
35+
"name": "collection",
36+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0",
37+
"packageUri": "lib/",
38+
"languageVersion": "2.12"
39+
},
40+
{
41+
"name": "cupertino_icons",
42+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3",
43+
"packageUri": "lib/",
44+
"languageVersion": "2.0"
45+
},
46+
{
47+
"name": "fake_async",
48+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0",
49+
"packageUri": "lib/",
50+
"languageVersion": "2.12"
51+
},
52+
{
53+
"name": "flutter",
54+
"rootUri": "file:///C:/flutter/packages/flutter",
55+
"packageUri": "lib/",
56+
"languageVersion": "2.12"
57+
},
58+
{
59+
"name": "flutter_test",
60+
"rootUri": "file:///C:/flutter/packages/flutter_test",
61+
"packageUri": "lib/",
62+
"languageVersion": "2.12"
63+
},
64+
{
65+
"name": "launch_review",
66+
"rootUri": "../../",
67+
"packageUri": "lib/",
68+
"languageVersion": "2.12"
69+
},
70+
{
71+
"name": "matcher",
72+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.11",
73+
"packageUri": "lib/",
74+
"languageVersion": "2.12"
75+
},
76+
{
77+
"name": "meta",
78+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0",
79+
"packageUri": "lib/",
80+
"languageVersion": "2.12"
81+
},
82+
{
83+
"name": "path",
84+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0",
85+
"packageUri": "lib/",
86+
"languageVersion": "2.12"
87+
},
88+
{
89+
"name": "sky_engine",
90+
"rootUri": "file:///C:/flutter/bin/cache/pkg/sky_engine",
91+
"packageUri": "lib/",
92+
"languageVersion": "2.12"
93+
},
94+
{
95+
"name": "source_span",
96+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1",
97+
"packageUri": "lib/",
98+
"languageVersion": "2.12"
99+
},
100+
{
101+
"name": "stack_trace",
102+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0",
103+
"packageUri": "lib/",
104+
"languageVersion": "2.12"
105+
},
106+
{
107+
"name": "stream_channel",
108+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0",
109+
"packageUri": "lib/",
110+
"languageVersion": "2.12"
111+
},
112+
{
113+
"name": "string_scanner",
114+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0",
115+
"packageUri": "lib/",
116+
"languageVersion": "2.12"
117+
},
118+
{
119+
"name": "term_glyph",
120+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0",
121+
"packageUri": "lib/",
122+
"languageVersion": "2.12"
123+
},
124+
{
125+
"name": "test_api",
126+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.3",
127+
"packageUri": "lib/",
128+
"languageVersion": "2.12"
129+
},
130+
{
131+
"name": "typed_data",
132+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0",
133+
"packageUri": "lib/",
134+
"languageVersion": "2.12"
135+
},
136+
{
137+
"name": "vector_math",
138+
"rootUri": "file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1",
139+
"packageUri": "lib/",
140+
"languageVersion": "2.14"
141+
},
142+
{
143+
"name": "launch_review_example",
144+
"rootUri": "../",
145+
"packageUri": "lib/",
146+
"languageVersion": "2.10"
147+
}
148+
],
149+
"generated": "2021-12-10T11:10:35.156087Z",
150+
"generator": "pub",
151+
"generatorVersion": "2.15.0"
152+
}
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
launch_review
2+
2.12
3+
file:///C:/Users/patrik/dev/git%20projects/launch_review/
4+
file:///C:/Users/patrik/dev/git%20projects/launch_review/lib/
5+
async
6+
2.12
7+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.2/
8+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.8.2/lib/
9+
boolean_selector
10+
2.12
11+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/
12+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
13+
characters
14+
2.12
15+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0/
16+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.0/lib/
17+
charcode
18+
2.12
19+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.3.1/
20+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.3.1/lib/
21+
clock
22+
2.12
23+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/
24+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib/
25+
collection
26+
2.12
27+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/
28+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
29+
cupertino_icons
30+
2.0
31+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/
32+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-0.1.3/lib/
33+
fake_async
34+
2.12
35+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/
36+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
37+
matcher
38+
2.12
39+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.11/
40+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.11/lib/
41+
meta
42+
2.12
43+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/
44+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/
45+
path
46+
2.12
47+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/
48+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib/
49+
source_span
50+
2.12
51+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/
52+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/lib/
53+
stack_trace
54+
2.12
55+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/
56+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
57+
stream_channel
58+
2.12
59+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/
60+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
61+
string_scanner
62+
2.12
63+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/
64+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/
65+
term_glyph
66+
2.12
67+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/
68+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/
69+
test_api
70+
2.12
71+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.3/
72+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.3/lib/
73+
typed_data
74+
2.12
75+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/
76+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
77+
vector_math
78+
2.14
79+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1/
80+
file:///C:/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.1/lib/
81+
sky_engine
82+
2.12
83+
file:///C:/flutter/bin/cache/pkg/sky_engine/
84+
file:///C:/flutter/bin/cache/pkg/sky_engine/lib/
85+
flutter
86+
2.12
87+
file:///C:/flutter/packages/flutter/
88+
file:///C:/flutter/packages/flutter/lib/
89+
flutter_test
90+
2.12
91+
file:///C:/flutter/packages/flutter_test/
92+
file:///C:/flutter/packages/flutter_test/lib/
93+
launch_review_example
94+
2.10
95+
file:///C:/Users/patrik/dev/git%20projects/launch_review/example/
96+
file:///C:/Users/patrik/dev/git%20projects/launch_review/example/lib/
97+
2

‎example/.dart_tool/version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.8.0

‎example/.flutter-plugins-dependencies

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"launch_review","path":"C:\\\\Users\\\\patrik\\\\dev\\\\git projects\\\\launch_review\\\\","dependencies":[]}],"android":[{"name":"launch_review","path":"C:\\\\Users\\\\patrik\\\\dev\\\\git projects\\\\launch_review\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"launch_review","dependencies":[]}],"date_created":"2021-12-10 12:10:35.211148","version":"2.8.0"}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
# This is a generated file; do not edit or check into version control.
3+
export "FLUTTER_ROOT=C:\flutter"
4+
export "FLUTTER_APPLICATION_PATH=C:\Users\patrik\dev\git projects\launch_review\example"
5+
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6+
export "FLUTTER_TARGET=lib\main.dart"
7+
export "FLUTTER_BUILD_DIR=build"
8+
export "FLUTTER_BUILD_NAME=1.0.0"
9+
export "FLUTTER_BUILD_NUMBER=1"
10+
export "DART_OBFUSCATION=false"
11+
export "TRACK_WIDGET_CREATION=false"
12+
export "TREE_SHAKE_ICONS=false"
13+
export "PACKAGE_CONFIG=.packages"

‎lib/launch_review.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ class LaunchReview {
99
static Future<void> launch(
1010
{String? androidAppId,
1111
String? iOSAppId,
12+
String? toastMessage,
1213
bool writeReview = true,
14+
bool showToast = true,
1315
bool isiOSBeta = false}) async {
1416
await _channel.invokeMethod('launch', {
1517
'android_id': androidAppId,
1618
'ios_id': iOSAppId,
1719
'write_review': writeReview,
18-
'is_ios_beta': isiOSBeta
20+
'is_ios_beta': isiOSBeta,
21+
'toast_message': toastMessage,
22+
'show_toast': showToast
1923
});
2024
}
2125
}

0 commit comments

Comments
 (0)
Please sign in to comment.