Skip to content

Commit 5921cb7

Browse files
chrisbobbegnprice
authored andcommitted
compose: In error banner, use SafeArea.minimum for trailing padding
Before, the 8px end padding would just be added to any SafeArea padding. Now, it's done using SafeArea.minimum, so it doesn't get too big.
1 parent effada0 commit 5921cb7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/widgets/compose_box.dart

+2-3
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ abstract class _Banner extends StatelessWidget {
13891389
/// To control the element's distance from the end edge, override [padEnd].
13901390
Widget? buildTrailing(BuildContext context);
13911391

1392-
/// Whether to add 8px trailing padding.
1392+
/// Whether to apply `end: 8` in [SafeArea.minimum].
13931393
///
13941394
/// Subclasses can use `false` when the [buildTrailing] element
13951395
/// is meant to abut the edge of the screen
@@ -1410,7 +1410,7 @@ abstract class _Banner extends StatelessWidget {
14101410
decoration: BoxDecoration(
14111411
color: getBackgroundColor(designVariables)),
14121412
child: SafeArea(
1413-
minimum: const EdgeInsetsDirectional.only(start: 8)
1413+
minimum: EdgeInsetsDirectional.only(start: 8, end: padEnd ? 8 : 0)
14141414
// (SafeArea.minimum doesn't take an EdgeInsetsDirectional)
14151415
.resolve(Directionality.of(context)),
14161416
child: Padding(
@@ -1426,7 +1426,6 @@ abstract class _Banner extends StatelessWidget {
14261426
const SizedBox(width: 8),
14271427
trailing,
14281428
],
1429-
if (padEnd) const SizedBox(width: 8),
14301429
]))));
14311430
}
14321431
}

0 commit comments

Comments
 (0)