remove method

  1. @override
Future<bool> remove(
  1. ProtocolScheme scheme
)
override

Used to remove a scheme.

Implementation

@override
Future<bool> remove(ProtocolScheme scheme) async {
  final ProcessResult result1 = await Process.run(
    'REG',
    <String>[
      'DELETE',
      'HKCU\\Software\\Classes\\${scheme.scheme}',
      '/v',
      'URL Protocol',
      '/f'
    ],
  );

  final ProcessResult result2 = await Process.run(
    'REG',
    <String>[
      'DELETE',
      'HKCU\\Software\\Classes\\${scheme.scheme}\\shell\\open\\command',
      '/f'
    ],
  );

  return _isSuccessful(result1.stdout.toString()) &&
      _isSuccessful(result2.stdout.toString());
}