Skip to content

Commit 4fcdb6e

Browse files
committed
content: Use directional layout for block quotations
Previously, the `Quotation` widget hardcoded the border and padding to the left side. This resulted in an incorrect layout in RTL locales, where the quote bar remained on the left while the text aligned to the right. We now use `EdgeInsetsDirectional` and `BorderDirectional` so that the layout flips correctly based on the text direction. Suggested by @gnprice.
1 parent 9296fb3 commit 4fcdb6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/widgets/content.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,12 @@ class Quotation extends StatelessWidget {
468468
@override
469469
Widget build(BuildContext context) {
470470
return Padding(
471-
padding: const EdgeInsets.only(left: 10),
471+
padding: const EdgeInsetsDirectional.only(start: 10),
472472
child: Container(
473-
padding: const EdgeInsets.only(left: 5),
473+
padding: const EdgeInsetsDirectional.only(start: 5),
474474
decoration: BoxDecoration(
475-
border: Border(
476-
left: BorderSide(
475+
border: BorderDirectional(
476+
start: BorderSide(
477477
width: 5,
478478
// Web has the same color in light and dark mode.
479479
color: const HSLColor.fromAHSL(1, 0, 0, 0.87).toColor()))),

0 commit comments

Comments
 (0)