Skip to content

Commit

Permalink
compose_box [nfc]: Make _ContentInput a StatefulWidget
Browse files Browse the repository at this point in the history
Reduce some noise for a later change that implements typing
notifications.

Signed-off-by: Zixuan James Li <[email protected]>
  • Loading branch information
PIG208 committed Oct 11, 2024
1 parent cd38721 commit e2980f2
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/widgets/compose_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
}
}

class _ContentInput extends StatelessWidget {
class _ContentInput extends StatefulWidget {
const _ContentInput({
required this.narrow,
required this.controller,
Expand All @@ -282,6 +282,11 @@ class _ContentInput extends StatelessWidget {
final FocusNode focusNode;
final String hintText;

@override
State<_ContentInput> createState() => _ContentInputState();
}

class _ContentInputState extends State<_ContentInput> {
@override
Widget build(BuildContext context) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
Expand All @@ -296,15 +301,15 @@ class _ContentInput extends StatelessWidget {
maxHeight: 200,
),
child: ComposeAutocomplete(
narrow: narrow,
controller: controller,
focusNode: focusNode,
narrow: widget.narrow,
controller: widget.controller,
focusNode: widget.focusNode,
fieldViewBuilder: (context) {
return TextField(
controller: controller,
focusNode: focusNode,
controller: widget.controller,
focusNode: widget.focusNode,
style: TextStyle(color: colorScheme.onSurface),
decoration: InputDecoration.collapsed(hintText: hintText),
decoration: InputDecoration.collapsed(hintText: widget.hintText),
maxLines: null,
textCapitalization: TextCapitalization.sentences,
);
Expand Down

0 comments on commit e2980f2

Please sign in to comment.