Kohei Seino 2024-01-31 08:16:01 +09:00 committed by GitHub
parent abebd340d7
commit 9ed650aee5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

View file

@ -318,7 +318,7 @@ class _SemanticsDebuggerPainter extends CustomPainter {
} else {
switch (data.textDirection!) {
case TextDirection.rtl:
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDF}';
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDI}';
case TextDirection.ltr:
effectivelabel = tooltipAndLabel;
}

View file

@ -524,6 +524,27 @@ void main() {
// ignore: avoid_dynamic_calls
expect(_getSemanticsDebuggerPainter(debuggerKey: debugger, tester: tester).labelStyle, labelStyle);
});
testWidgets('SemanticsDebugger label for rtl.', (WidgetTester tester) async {
final UniqueKey debugger = UniqueKey();
final Key label = UniqueKey();
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.rtl,
child: SemanticsDebugger(
key: debugger,
child: Semantics(
label: 'ملصق',
textDirection: TextDirection.rtl,
key: label,
),
),
),
);
expect(_getMessageShownInSemanticsDebugger(widgetKey: label, debuggerKey: debugger, tester: tester), '\u2067ملصق\u2069');
});
}
String _getMessageShownInSemanticsDebugger({