PrivacyAgreementHelper class

隐私协议辅助类

负责:1)持久化用户是否已同意;2)在需要时弹出协议并返回结果。

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

clearAgreed() Future<void>
清除同意状态(用于测试或重新展示)
hasAgreed() Future<bool>
是否已同意过协议
markAgreed() Future<void>
标记为已同意(用于 PrivacyGate 等场景,弹窗同意后持久化)
show(BuildContext context, {PrivacyAgreementConfig config = const PrivacyAgreementConfig()}) Future<bool?>
弹出协议弹窗,返回用户选择(true 同意 / false 拒绝 / null 关闭)
showIfNeeded(BuildContext context, {PrivacyAgreementConfig config = const PrivacyAgreementConfig()}) Future<bool>
若未同意过则弹出协议,否则直接返回 true。 context 需为已挂载的 BuildContext。 返回 true 表示用户已同意(含之前已同意),false 表示本次拒绝。