@@ -265,6 +265,22 @@ class ComposeContentController extends ComposeController<ContentValidationError>
265
265
}
266
266
}
267
267
268
+ class AutocompleteInputWrapper extends StatelessWidget {
269
+ const AutocompleteInputWrapper ({super .key, required this .child});
270
+
271
+ final Widget child;
272
+
273
+ @override
274
+ Widget build (BuildContext context) => InputDecorator (
275
+ decoration: const InputDecoration (),
276
+ child: ConstrainedBox (
277
+ constraints: const BoxConstraints (
278
+ minHeight: _sendButtonSize - 2 * _inputVerticalPadding,
279
+ // TODO constrain this adaptively (i.e. not hard-coded 200)
280
+ maxHeight: 200 ,
281
+ ), child: child));
282
+ }
283
+
268
284
class _ContentInput extends StatelessWidget {
269
285
const _ContentInput ({
270
286
required this .narrow,
@@ -282,30 +298,18 @@ class _ContentInput extends StatelessWidget {
282
298
Widget build (BuildContext context) {
283
299
ColorScheme colorScheme = Theme .of (context).colorScheme;
284
300
285
- return InputDecorator (
286
- decoration: const InputDecoration (),
287
- child: ConstrainedBox (
288
- constraints: const BoxConstraints (
289
- minHeight: _sendButtonSize - 2 * _inputVerticalPadding,
290
-
291
- // TODO constrain this adaptively (i.e. not hard-coded 200)
292
- maxHeight: 200 ,
293
- ),
294
- child: ComposeAutocomplete (
295
- narrow: narrow,
301
+ return AutocompleteInputWrapper (
302
+ child: ComposeAutocomplete (
303
+ narrow: narrow,
304
+ controller: controller,
305
+ focusNode: focusNode,
306
+ fieldViewBuilder: (context) => TextField (
296
307
controller: controller,
297
308
focusNode: focusNode,
298
- fieldViewBuilder: (context) {
299
- return TextField (
300
- controller: controller,
301
- focusNode: focusNode,
302
- style: TextStyle (color: colorScheme.onSurface),
303
- decoration: InputDecoration .collapsed (hintText: hintText),
304
- maxLines: null ,
305
- textCapitalization: TextCapitalization .sentences,
306
- );
307
- }),
308
- ));
309
+ style: TextStyle (color: colorScheme.onSurface),
310
+ decoration: InputDecoration .collapsed (hintText: hintText),
311
+ maxLines: null ,
312
+ textCapitalization: TextCapitalization .sentences)));
309
313
}
310
314
}
311
315
0 commit comments