@@ -376,8 +376,34 @@ class ComposeContentController extends ComposeController<ContentValidationError>
376376 }
377377}
378378
379- class _ContentInput extends StatefulWidget {
380- const _ContentInput ({
379+ abstract class _ContentInput extends StatefulWidget {
380+ factory _ContentInput .withTypingNotifier ({
381+ required Narrow narrow,
382+ required SendableNarrow destination,
383+ required ComposeBoxController controller,
384+ required String hintText,
385+ }) => _ContentInputWithTypingNotifier ._(
386+ narrow: narrow,
387+ destination: destination,
388+ controller: controller,
389+ hintText: hintText,
390+ );
391+
392+ // We'll use this soon.
393+ // ignore: unused_element
394+ factory _ContentInput .noTypingNotifier ({
395+ required Narrow narrow,
396+ required SendableNarrow destination,
397+ required ComposeBoxController controller,
398+ required String hintText,
399+ }) => _ContentInputNoTypingNotifier ._(
400+ narrow: narrow,
401+ destination: destination,
402+ controller: controller,
403+ hintText: hintText,
404+ );
405+
406+ const _ContentInput ._({
381407 required this .narrow,
382408 required this .destination,
383409 required this .controller,
@@ -388,12 +414,33 @@ class _ContentInput extends StatefulWidget {
388414 final SendableNarrow destination;
389415 final ComposeBoxController controller;
390416 final String hintText;
417+ }
418+
419+ class _ContentInputWithTypingNotifier extends _ContentInput {
420+ const _ContentInputWithTypingNotifier ._({
421+ required super .narrow,
422+ required super .destination,
423+ required super .controller,
424+ required super .hintText,
425+ }) : super ._();
426+
427+ @override
428+ State <_ContentInput > createState () => _ContentInputStateWithTypingNotifier ();
429+ }
430+
431+ class _ContentInputNoTypingNotifier extends _ContentInput {
432+ const _ContentInputNoTypingNotifier ._({
433+ required super .narrow,
434+ required super .destination,
435+ required super .controller,
436+ required super .hintText,
437+ }) : super ._();
391438
392439 @override
393- State <_ContentInput > createState () => _ContentInputState ();
440+ State <_ContentInput > createState () => _ContentInputStateNoTypingNotifier ();
394441}
395442
396- class _ContentInputState extends State <_ContentInput > with WidgetsBindingObserver , _TypingNotifierMixin {
443+ class _ContentInputStateBase extends State <_ContentInput > {
397444 static double maxHeight (BuildContext context) {
398445 final clampingTextScaler = MediaQuery .textScalerOf (context)
399446 .clamp (maxScaleFactor: 1.5 );
@@ -468,6 +515,10 @@ class _ContentInputState extends State<_ContentInput> with WidgetsBindingObserve
468515 }
469516}
470517
518+
519+ class _ContentInputStateWithTypingNotifier extends _ContentInputStateBase with WidgetsBindingObserver , _TypingNotifierMixin {}
520+ class _ContentInputStateNoTypingNotifier extends _ContentInputStateBase {}
521+
471522mixin _TypingNotifierMixin on State <_ContentInput >, WidgetsBindingObserver {
472523 @override
473524 void initState () {
@@ -588,7 +639,7 @@ class _StreamContentInputState extends State<_StreamContentInput> {
588639 final streamName = store.streams[widget.narrow.streamId]? .name
589640 ?? zulipLocalizations.unknownChannelName;
590641 final topic = TopicName (widget.controller.topic.textNormalized);
591- return _ContentInput (
642+ return _ContentInput . withTypingNotifier (
592643 narrow: widget.narrow,
593644 destination: TopicNarrow (widget.narrow.streamId, topic),
594645 controller: widget.controller,
@@ -678,7 +729,7 @@ class _FixedDestinationContentInput extends StatelessWidget {
678729
679730 @override
680731 Widget build (BuildContext context) {
681- return _ContentInput (
732+ return _ContentInput . withTypingNotifier (
682733 narrow: narrow,
683734 destination: narrow,
684735 controller: controller,
0 commit comments