fix(client): 修正 ChangeNotifier 监听生命周期

This commit is contained in:
Zhou Weidong committed 2026-10-22 19:14:35 +08:00
1 parent 4291031ace
commit 8936c3d6eb
7 files changed
+286 -269

No files matched your search

@@ -79,6 +79,15 @@ class _CommentComposerSheetState extends State<CommentComposerSheet> {
_trackKeyboardInset(_keyboardHeight(context));
}
@override
void didUpdateWidget(covariant CommentComposerSheet oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.controller != widget.controller) {
oldWidget.controller.removeListener(_onControllerChanged);
widget.controller.addListener(_onControllerChanged);
}
}
Future<void> _prepareInput() async {
if (_isAndroid) {
await _keyboardInset.start();