Skip to content

Commit 046abdb

Browse files
committed
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 bb5ae15 commit 046abdb

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
@@ -1333,7 +1333,7 @@ abstract class _Banner extends StatelessWidget {
13331333
/// To control the element's distance from the end edge, override [padEnd].
13341334
Widget? buildTrailing(BuildContext context);
13351335

1336-
/// Whether to add 8px trailing padding.
1336+
/// Whether to apply `end: 8` in [SafeArea.minimum].
13371337
///
13381338
/// Subclasses can use `false` when the [buildTrailing] element
13391339
/// is meant to abut the edge of the screen
@@ -1354,7 +1354,7 @@ abstract class _Banner extends StatelessWidget {
13541354
decoration: BoxDecoration(
13551355
color: getBackgroundColor(designVariables)),
13561356
child: SafeArea(
1357-
minimum: const EdgeInsetsDirectional.only(start: 8)
1357+
minimum: EdgeInsetsDirectional.only(start: 8, end: padEnd ? 8 : 0)
13581358
// (SafeArea.minimum doesn't take an EdgeInsetsDirectional)
13591359
.resolve(Directionality.of(context)),
13601360
child: Padding(
@@ -1370,7 +1370,6 @@ abstract class _Banner extends StatelessWidget {
13701370
const SizedBox(width: 8),
13711371
trailing,
13721372
],
1373-
if (padEnd) const SizedBox(width: 8),
13741373
]))));
13751374
}
13761375
}

0 commit comments

Comments
 (0)