GAM3RG33K / flutter_settings_screens

Settings Screen with Custom Shared Preference Interface
MIT License
176 stars 71 forks source link

What's the purpose of defaultValue on setX()? #84

Open alevinetx opened 2 years ago

alevinetx commented 2 years ago

version: 0.3.2-null-safety

In CacheProvider, all setX methods have an optional parameter for defaultValue.

 Future<void> setInt(String key, int? value, {int? defaultValue});
 Future<void> setString(String key, String? value, {String? defaultValue});
 Future<void> setDouble(String key, double? value, {double? defaultValue});
 Future<void> setBool(String key, bool? value, {bool? defaultValue});

Is this intentional, instead of placing them on getX? If so, what's the intended purpose? I don't see it being used in the provided example.

Thank you !