Skip to content

Commit f163ffe

Browse files
committed
NOMERGE wip inline/remove typing-notifier mixin
1 parent 524a58e commit f163ffe

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/widgets/compose_box.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class _ContentInputNoTypingNotifier extends _ContentInput {
458458
State<_ContentInput> createState() => _ContentInputStateNoTypingNotifier();
459459
}
460460

461-
class _ContentInputStateBase extends State<_ContentInput> {
461+
class _ContentInputStateBase<T extends _ContentInput> extends State<T> {
462462
static double maxHeight(BuildContext context) {
463463
final clampingTextScaler = MediaQuery.textScalerOf(context)
464464
.clamp(maxScaleFactor: 1.5);
@@ -534,10 +534,7 @@ class _ContentInputStateBase extends State<_ContentInput> {
534534
}
535535

536536

537-
class _ContentInputStateWithTypingNotifier extends _ContentInputStateBase with WidgetsBindingObserver, _TypingNotifierMixin {}
538-
class _ContentInputStateNoTypingNotifier extends _ContentInputStateBase {}
539-
540-
mixin _TypingNotifierMixin on State<_ContentInput>, WidgetsBindingObserver {
537+
class _ContentInputStateWithTypingNotifier extends _ContentInputStateBase<_ContentInputWithTypingNotifier> with WidgetsBindingObserver {
541538
@override
542539
void initState() {
543540
super.initState();
@@ -547,7 +544,7 @@ mixin _TypingNotifierMixin on State<_ContentInput>, WidgetsBindingObserver {
547544
}
548545

549546
@override
550-
void didUpdateWidget(covariant _ContentInput oldWidget) {
547+
void didUpdateWidget(covariant _ContentInputWithTypingNotifier oldWidget) {
551548
super.didUpdateWidget(oldWidget);
552549
if (widget.controller != oldWidget.controller) {
553550
oldWidget.controller.content.removeListener(_contentChanged);
@@ -611,6 +608,8 @@ mixin _TypingNotifierMixin on State<_ContentInput>, WidgetsBindingObserver {
611608
}
612609
}
613610

611+
class _ContentInputStateNoTypingNotifier extends _ContentInputStateBase<_ContentInputNoTypingNotifier> {}
612+
614613
/// The content input for _StreamComposeBox.
615614
class _StreamContentInput extends StatefulWidget {
616615
const _StreamContentInput({required this.narrow, required this.controller});

0 commit comments

Comments
 (0)