Skip to content

Commit 2ceb503

Browse files
Fix Android implementation of setDouble in shared_preferences (flutter#265)
Fixes flutter/flutter#12449
1 parent fc2df75 commit 2ceb503

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/shared_preferences/android/src/main/java/io/flutter/plugins/sharedpreferences/SharedPreferencesPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
115115
result.success(null);
116116
break;
117117
case "setDouble":
118-
editor.putFloat(key, (float) call.argument("value")).apply();
118+
float floatValue = ((Number) call.argument("value")).floatValue();
119+
editor.putFloat(key, floatValue).apply();
119120
result.success(null);
120121
break;
121122
case "setInt":

0 commit comments

Comments
 (0)