AccessibilityTools class

A checker for debug mode that highlights accessibility issues and provides various tools for testing app's accessibility.

Issues are highlighted using a warning box.

Add this widget to your MaterialApp's or CupertinoApp's builder method:

return MaterialApp(
  builder: (context, child) {
    return AccessibilityTools(
      child: child,
    );
  },
);

Accessibility tools are only enabled in debug mode. In release mode, they are not available and don't show any UI. This is done because Accessibility tools use some components that are not available in release mode. See https://github.com/rebelappstudio/accessibility_tools/issues/36 for more details.

For widget tests, you can set debugRunCheckersInTests to true to enable accessibility checkers.

Inheritance

Constructors

AccessibilityTools({Key? key, required Widget? child, MinimumTapAreas? minimumTapAreas = MinimumTapAreas.material, LogLevel logLevel = LogLevel.verbose, bool checkSemanticLabels = true, bool checkMissingInputLabels = true, bool checkFontOverflows = false, bool checkImageLabels = true, ButtonsAlignment buttonsAlignment = ButtonsAlignment.bottomRight, bool enableButtonsDrag = true, TestingToolsConfiguration testingToolsConfiguration = const TestingToolsConfiguration(), TestEnvironment testEnvironment = const TestEnvironment()})
Default constructor.
const

Properties

buttonsAlignment ButtonsAlignment
Accessibility tools buttons alignment.
final
checkFontOverflows bool
Whether to check font overflows.
final
checkImageLabels bool
Whether to check if image labels are present.
final
checkMissingInputLabels bool
Whether to check if input labels of text fields are present.
final
checkSemanticLabels bool
Whether to check if semantic labels are present.
final
child Widget?
The child widget to wrap accessibility tools around.
final
enableButtonsDrag bool
Whether accessibility tools buttons are draggable from their initial position to another corner of the screen.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
logLevel LogLevel
Log level for the accessibility tools.
final
minimumTapAreas MinimumTapAreas?
Minimum tap areas to check.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
testEnvironment TestEnvironment
Default test environment for the testing tools.
final
testingToolsConfiguration TestingToolsConfiguration
Configuration for the testing tools.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AccessibilityTools>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Properties

debugIgnoreTapAreaIssuesInTools bool
Forces accessibility tools to ignore its own tap area size issues.
getter/setter pair
debugRunCheckersInTests bool
Forces accessibility checkers to run when running from a test.
getter/setter pair