Skip to content

Commit bd68c26

Browse files
committed
compose_box [nfc]: Make _ContentInput a StatefulWidget
Reduce some noise for a later change that implements typing notices. Signed-off-by: Zixuan James Li <[email protected]>
1 parent 0984e86 commit bd68c26

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

lib/widgets/compose_box.dart

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
269269
}
270270
}
271271

272-
class _ContentInput extends StatelessWidget {
272+
class _ContentInput extends StatefulWidget {
273273
const _ContentInput({
274274
required this.narrow,
275275
required this.controller,
@@ -282,6 +282,11 @@ class _ContentInput extends StatelessWidget {
282282
final FocusNode focusNode;
283283
final String hintText;
284284

285+
@override
286+
State<_ContentInput> createState() => _ContentInputState();
287+
}
288+
289+
class _ContentInputState extends State<_ContentInput> {
285290
@override
286291
Widget build(BuildContext context) {
287292
ColorScheme colorScheme = Theme.of(context).colorScheme;
@@ -296,15 +301,15 @@ class _ContentInput extends StatelessWidget {
296301
maxHeight: 200,
297302
),
298303
child: ComposeAutocomplete(
299-
narrow: narrow,
300-
controller: controller,
301-
focusNode: focusNode,
304+
narrow: widget.narrow,
305+
controller: widget.controller,
306+
focusNode: widget.focusNode,
302307
fieldViewBuilder: (context) {
303308
return TextField(
304-
controller: controller,
305-
focusNode: focusNode,
309+
controller: widget.controller,
310+
focusNode: widget.focusNode,
306311
style: TextStyle(color: colorScheme.onSurface),
307-
decoration: InputDecoration.collapsed(hintText: hintText),
312+
decoration: InputDecoration.collapsed(hintText: widget.hintText),
308313
maxLines: null,
309314
textCapitalization: TextCapitalization.sentences,
310315
);

0 commit comments

Comments
 (0)