delete<S> method

Future<bool> delete<S>({
  1. String? tag,
  2. bool force = false,
})

Clears all registered instances (and/or tags). Even the persistent ones.

  • clearFactory clears the callbacks registered by Get.lazyPut()

  • clearRouteBindings clears Instances associated with Routes when using GetMaterialApp. Deletes the Instance<S>, cleaning the memory and closes any open controllers (DisposableInterface).

  • tag Optional "tag" used to register the Instance

  • force Will delete an Instance even if marked as permanent.

Implementation

// bool reset(
//         {@deprecated bool clearFactory = true,
//         @deprecated bool clearRouteBindings = true}) =>
//     GetInstance().reset(
//         // ignore: deprecated_member_use_from_same_package
//         clearFactory: clearFactory,
//         // ignore: deprecated_member_use_from_same_package
//         clearRouteBindings: clearRouteBindings);

/// Deletes the `Instance<S>`, cleaning the memory and closes any open
/// controllers (`DisposableInterface`).
///
/// - [tag] Optional "tag" used to register the Instance
/// - [force] Will delete an Instance even if marked as `permanent`.
Future<bool> delete<S>({String? tag, bool force = false}) async =>
    GetInstance().delete<S>(tag: tag, force: force);