import 'dart:async'; import 'dart:typed_data'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; const platform = const MethodChannel('com.cakewallet.cakewallet/legacy_wallet_migration'); Future decrypt(Uint8List bytes, {@required String key, @required String salt}) async => await platform .invokeMethod('decrypt', {'bytes': bytes, 'key': key, 'salt': salt}); Future readUserDefaults(String key, {@required String type}) async => await platform .invokeMethod('read_user_defaults', {'key': key, 'type': type}); Future getString(String key) async => await readUserDefaults(key, type: 'string') as String; Future getBool(String key) async => await readUserDefaults(key, type: 'bool') as bool; Future getInt(String key) async => await readUserDefaults(key, type: 'int') as int;