@@ -146,15 +146,15 @@ export function AccessibilityInspector({
146146
147147 const tree = buildAccessibilityTree ( roots ) ;
148148 const storedExpandedIds =
149- source === "react-native"
149+ source === "react-native" || source === "flutter"
150150 ? [ ]
151151 : readStoredStringArray ( expandedStorageKey ( udid ) ) ;
152152 setExpandedIds (
153153 storedExpandedIds . length > 0
154154 ? new Set ( storedExpandedIds )
155155 : defaultExpandedAccessibilityIds (
156156 tree ,
157- source === "react-native" ? 2 : 10 ,
157+ source === "react-native" || source === "flutter" ? 2 : 10 ,
158158 ) ,
159159 ) ;
160160 expandedInitializedKeyRef . current = expansionKey ;
@@ -467,6 +467,7 @@ function NodeDetails({
467467 [ "Module" , node . moduleName ?? "" ] ,
468468 [ "NativeScript" , nativeScriptDescription ( node . nativeScript ) ] ,
469469 [ "React Native" , reactNativeDescription ( node . reactNative ) ] ,
470+ [ "Flutter" , flutterDescription ( node . flutter ) ] ,
470471 [ "UIKit Class" , node . className ?? "" ] ,
471472 [ "Last JS" , lastUIKitScriptText ( node ) ] ,
472473 [ "Value" , node . AXValue ?? "" ] ,
@@ -727,6 +728,7 @@ function errorMessage(error: unknown): string {
727728const HIERARCHY_SOURCE_ORDER : AccessibilitySource [ ] = [
728729 "nativescript" ,
729730 "react-native" ,
731+ "flutter" ,
730732 "swiftui" ,
731733 "in-app-inspector" ,
732734 "native-ax" ,
@@ -756,6 +758,9 @@ function sourceLabel(source: AccessibilitySource): string {
756758 if ( source === "react-native" ) {
757759 return "React Native" ;
758760 }
761+ if ( source === "flutter" ) {
762+ return "Flutter" ;
763+ }
759764 if ( source === "swiftui" ) {
760765 return "SwiftUI" ;
761766 }
@@ -795,6 +800,17 @@ function reactNativeDescription(
795800 return [ tag , testID , nativeID ] . filter ( Boolean ) . join ( " / " ) ;
796801}
797802
803+ function flutterDescription ( value : Record < string , unknown > | null | undefined ) {
804+ if ( ! value ) {
805+ return "" ;
806+ }
807+ const widgetType =
808+ typeof value . widgetType === "string" ? value . widgetType : "" ;
809+ const stateType = typeof value . stateType === "string" ? value . stateType : "" ;
810+ const key = typeof value . key === "string" ? value . key : "" ;
811+ return [ widgetType , stateType , key ] . filter ( Boolean ) . join ( " / " ) ;
812+ }
813+
798814function lastUIKitScriptText ( node : AccessibilityNode ) : string {
799815 const direct = stringRecordValue ( node . uikitScript , "script" ) ;
800816 if ( direct ) {
0 commit comments