Pretty obvious. It's missing the return statements.
@override
Future<void> setObject<T>(String key, T? value) async {
if (T is int || value is int) {
await _preferences?.setInt(key, value as int);
}
if (T is double || value is double) {
await _preferences?.setDouble(key, value as double);
}
if (T is bool || value is bool) {
await _preferences?.setBool(key, value as bool);
}
if (T is String || value is String) {
await _preferences?.setString(key, value as String);
}
throw Exception('No Implementation Found');
}
Pretty obvious. It's missing the return statements.