ContentSensitivity enum

The possible values for a widget tree's content sensitivity.

There are three ContentSensitivity levels, and these can be set via the SensitiveContent widget.

ContentSensitivity.sensitive is the highest prioritized setting, and if it is set, it will cause the tree to remain marked sensitive even if there are other SensitiveContent widgets in the tree.

ContentSensitivity.autoSensitive is the second most prioritized setting, and it will cause the tree to remain marked auto-sensitive if there are no sensitive SensitiveContent widgets elsewhere in the tree.

ContentSensitivity.notSensitive is the least prioritized setting, and it will cause the tree to remain marked auto-sensitive if there are no sensitive SensitiveContent widgets elsewhere in the tree. If there are no SensitiveContent widgets in the tree, the default setting as queried from the embedding will be used. This could be set by a Flutter developer in native Android; otherwise, Android uses ContentSensitivity.autoSensitive by default; see https://developer.android.com/reference/android/view/View#getContentSensitivity().

  • See SensitiveContent for how to set a ContentSensitivity level in order for sensitive content to be obscured when the Flutter screen is shared.
Inheritance
Available extensions

Values

autoSensitive → const ContentSensitivity

Content sensitivity is auto-detected by the native platform.

When this level is set via a SensitiveContent widget, the window hosting the screen will only be marked as sensitive if other SensitiveContent widgets in the Flutter app with the sensitive level are present in the widget tree.

See https://developer.android.com/reference/android/view/View#CONTENT_SENSITIVITY_AUTO for how this mode behaves on native Android.

For Android Views, this mode attempts to auto detect passwords, 2factor tokens, and other sensitive content. As of API 35, Android cannot determine if Flutter Views contain sensitive content automatically, and thus will never obscure the screen.

sensitive → const ContentSensitivity

The widget tree contains sensitive content.

When this level is set via a SensitiveContent widget, the window hosting the screen will be marked as sensitive during an active media projection session.

See https://developer.android.com/reference/android/view/View#CONTENT_SENSITIVITY_SENSITIVE.

notSensitive → const ContentSensitivity

The widget tree does not contain sensitive content.

When this level is set via a SensitiveContent widget, the window hosting the screen will only be marked as sensitive if other SensitiveContent widgets in the Flutter app with the sensitive level are present in the widget tree.

See https://developer.android.com/reference/android/view/View#CONTENT_SENSITIVITY_NOT_SENSITIVE.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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

Constants

values → const List<ContentSensitivity>
A constant List of the values in this enum, in order of their declaration.