saveData<T> method
Implementation
@override
Future<bool> saveData<T>(String key, T? value) async {
if (value != null && value is! String && value is! int && value is! double && value is! bool) {
throw ArgumentError(
'Unsupported value type ${value.runtimeType}. '
'Supported types: String, int, double, bool.',
);
}
final result = await methodChannel.invokeMethod<bool>('saveData', {
'key': key,
'value': value,
});
return result ?? false;
}