use PDI to end the isolated scope for RLI (#141345)
will fix https://github.com/flutter/flutter/issues/141344 https://unicode.org/reports/tr9/#Explicit_Directional_Isolates https://api.flutter.dev/flutter/foundation/Unicode/RLI-constant.html
This commit is contained in:
parent
abebd340d7
commit
9ed650aee5
@ -318,7 +318,7 @@ class _SemanticsDebuggerPainter extends CustomPainter {
|
|||||||
} else {
|
} else {
|
||||||
switch (data.textDirection!) {
|
switch (data.textDirection!) {
|
||||||
case TextDirection.rtl:
|
case TextDirection.rtl:
|
||||||
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDF}';
|
effectivelabel = '${Unicode.RLI}$tooltipAndLabel${Unicode.PDI}';
|
||||||
case TextDirection.ltr:
|
case TextDirection.ltr:
|
||||||
effectivelabel = tooltipAndLabel;
|
effectivelabel = tooltipAndLabel;
|
||||||
}
|
}
|
||||||
|
@ -524,6 +524,27 @@ void main() {
|
|||||||
// ignore: avoid_dynamic_calls
|
// ignore: avoid_dynamic_calls
|
||||||
expect(_getSemanticsDebuggerPainter(debuggerKey: debugger, tester: tester).labelStyle, labelStyle);
|
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({
|
String _getMessageShownInSemanticsDebugger({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user