remove method

  1. @override
FutureOr<bool> remove(
  1. String instance
)
override

Remove registration for instance and return true if there are other registrations left

Implementation

@override
FutureOr<bool> remove(String instance) async {
  final token = await SharedPreferencesAsync().getString("$_TOKEN_FOR.$instance");
  if (token != null) {
    await SharedPreferencesAsync().remove("$_INSTANCE_FOR.$token");
  }
  await SharedPreferencesAsync().remove("$_TOKEN_FOR.$instance");
  return (await SharedPreferencesAsync().getKeys())
      .any((it) => it.startsWith(_INSTANCE_FOR));
}