TCICPermissionSerial class
统一的授权(权限)串行队列。
目标:避免在短时间内并发触发多个系统授权弹窗,改为“串行授权”。
约定:
- waitingList 用于观察当前待授权队列(按添加顺序)。
- add/remove 是基础队列能力;通常业务侧直接用 ensureGranted。
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
waitingList
→ List<
String> -
待授权列表(用于排队与调试观测)
final
Methods
-
add<
T> (String tag, Future< T> task()) → Future<T> - 将一个异步任务加入串行队列执行。
-
ensureGranted(
Permission permission, {String? tag}) → Future< bool> - 串行地确保某个系统权限已授权。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String tag) → bool - 从待授权列表移除一个任务标记。
-
request(
Permission permission, {String? tag}) → Future< PermissionStatus> - 串行地发起一次权限 request(不做额外 isGranted 过滤)。
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → TCICPermissionSerial
-
final