isInstantiatedIn method

bool isInstantiatedIn(
  1. LevitScope scope, {
  2. String? tag,
})

Internal helper to check if this state is instantiated in a specific scope.

Implementation

bool isInstantiatedIn(LevitScope scope, {String? tag}) {
  final instanceKey =
      tag != null ? 'ls_value_${getProviderTag(this, tag)}' : _defaultKey;
  return scope.isInstantiated<_LevitStateInstance<T>>(tag: instanceKey);
}