File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ void showToast(String text) {
90
90
final toaster = makeText.call (toasterClass, const JObjectType (), [
91
91
Jni .getCurrentActivity (),
92
92
Jni .getCachedApplicationContext (),
93
- '😀' ,
93
+ '😀' . toJString () ,
94
94
0 ,
95
95
]);
96
96
final show = toasterClass.instanceMethodId ('show' , '()V' );
@@ -110,10 +110,13 @@ void main() {
110
110
Example ("Minutes of usage since reboot" ,
111
111
() => (uptime () / (60 * 1000 )).floor ()),
112
112
Example ("Back and forth string conversion" , () => backAndForth ()),
113
- Example (
114
- "Device name" ,
115
- () => JClass .forName ("android/os/Build" )
116
- .staticFieldId ("DEVICE" , const JStringType ().signature)),
113
+ Example ("Device name" , () {
114
+ final buildClass = JClass .forName ("android/os/Build" );
115
+ return buildClass
116
+ .staticFieldId ("DEVICE" , JString .type.signature)
117
+ .get (buildClass, JString .type)
118
+ .toDartString (releaseOriginal: true );
119
+ }),
117
120
Example (
118
121
"Package name" ,
119
122
() => JObject .fromReference (Jni .getCurrentActivity ()).use ((activity) =>
You can’t perform that action at this time.
0 commit comments