Skip to content

Commit 2523f60

Browse files
committed
compose_box [nfc]: Control width at _ComposeBoxContainer
This way the caller doesn't have to do so. This change is NFC because in the non-error-banner case, where the caller is _ComposeBoxLayout, the child already fills the available horizontal space because of the Expanded inside the Row.
1 parent 0e44143 commit 2523f60

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

lib/widgets/compose_box.dart

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -853,13 +853,16 @@ class _ComposeBoxContainer extends StatelessWidget {
853853
Widget build(BuildContext context) {
854854
ColorScheme colorScheme = Theme.of(context).colorScheme;
855855

856-
return Material(
857-
color: colorScheme.surfaceContainerHighest,
858-
child: SafeArea(
859-
minimum: const EdgeInsets.fromLTRB(8, 0, 8, 8),
860-
child: Padding(
861-
padding: const EdgeInsets.only(top: 8.0),
862-
child: child)));
856+
// TODO(design): Maybe put a max width on the compose box, like we do on
857+
// the message list itself
858+
return SizedBox(width: double.infinity,
859+
child: Material(
860+
color: colorScheme.surfaceContainerHighest,
861+
child: SafeArea(
862+
minimum: const EdgeInsets.fromLTRB(8, 0, 8, 8),
863+
child: Padding(
864+
padding: const EdgeInsets.only(top: 8.0),
865+
child: child))));
863866
}
864867
}
865868

@@ -1052,9 +1055,7 @@ class _FixedDestinationComposeBoxState extends State<_FixedDestinationComposeBox
10521055
Widget build(BuildContext context) {
10531056
final errorBanner = _errorBanner(context);
10541057
if (errorBanner != null) {
1055-
return _ComposeBoxContainer(
1056-
child: SizedBox(width: double.infinity,
1057-
child: errorBanner));
1058+
return _ComposeBoxContainer(child: errorBanner);
10581059
}
10591060

10601061
return _ComposeBoxLayout(

0 commit comments

Comments
 (0)