mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Make sure fab semantics end up on top (#34512)
This commit is contained in:
parent
8f75d53735
commit
1427fef8f8
@ -462,11 +462,9 @@ class FloatingActionButton extends StatelessWidget {
|
||||
);
|
||||
|
||||
if (tooltip != null) {
|
||||
result = MergeSemantics(
|
||||
child: Tooltip(
|
||||
message: tooltip,
|
||||
child: result,
|
||||
),
|
||||
result = Tooltip(
|
||||
message: tooltip,
|
||||
child: result,
|
||||
);
|
||||
}
|
||||
|
||||
@ -477,7 +475,7 @@ class FloatingActionButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
return MergeSemantics(child: result);
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -763,6 +763,22 @@ void main() {
|
||||
paintsExactlyCountTimes(#clipPath, 0),
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('Can find FloatingActionButton semantics', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: FloatingActionButton(onPressed: () {}),
|
||||
));
|
||||
|
||||
expect(
|
||||
tester.getSemantics(find.byType(FloatingActionButton)),
|
||||
matchesSemantics(
|
||||
hasTapAction: true,
|
||||
hasEnabledState: true,
|
||||
isButton: true,
|
||||
isEnabled: true,
|
||||
),
|
||||
);
|
||||
}, semanticsEnabled: true);
|
||||
}
|
||||
|
||||
Offset _rightEdgeOfFab(WidgetTester tester) {
|
||||
|
Loading…
Reference in New Issue
Block a user