I want to save the data in Shared preference from Android native side and retrieve from the Flutter module added in it

On Native side, For store the data

with (sharedPreferences.edit()) {
            putInt("Data", 5)
            commit()

On Flutter side for retrieve data

SharedPreferences prefs = await SharedPreferences.getInstance();
result =  (prefs.getInt('Data') ?? 0);
print('Result: $result times.');
var success= await prefs.setInt('counter', result);

print('success $success');
return success;