Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

[flutter]: fix some warnings

appflowyfac470be9929
diff --git a/app_flowy/lib/startup/tasks/application_task.dart b/app_flowy/lib/startup/tasks/application_task.dart
index ff556fc663..ff8f256255 100644
--- a/app_flowy/lib/startup/tasks/application_task.dart
+++ b/app_flowy/lib/startup/tasks/application_task.dart
@@ -62,7 +62,7 @@ class ApplicationBlocObserver extends BlocObserver {
// ignore: unnecessary_overrides
void onTransition(Bloc bloc, Transition transition) {
// Log.debug("[current]: ${transition.currentState} \n\n[next]: ${transition.nextState}");
- Log.debug("${transition.nextState}");
+ //Log.debug("${transition.nextState}");
super.onTransition(bloc, transition);
}
@@ -71,4 +71,10 @@ class ApplicationBlocObserver extends BlocObserver {
Log.debug(error);
super.onError(bloc, error, stackTrace);
}
+
+ @override
+ void onEvent(Bloc bloc, Object? event) {
+ Log.debug("$event");
+ super.onEvent(bloc, event);
+ }
}
diff --git a/app_flowy/lib/workspace/infrastructure/i_view_impl.dart b/app_flowy/lib/workspace/infrastructure/i_view_impl.dart
index b9838c563c..4189fe3aae 100644
--- a/app_flowy/lib/workspace/infrastructure/i_view_impl.dart
+++ b/app_flowy/lib/workspace/infrastructure/i_view_impl.dart
@@ -57,5 +57,5 @@ class IViewListenerImpl extends IViewListener {
PublishNotifier<UpdateNotifierValue> get updatedNotifier => repo.updatedNotifier;
@override
- PublishNotifier<RestoreNotifierValue> get restoredNotifier => repo.updatedNotifier;
+ PublishNotifier<RestoreNotifierValue> get restoredNotifier => repo.restoredNotifier;
}
diff --git a/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/section.dart b/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/section.dart
index e14908c17a..9a6fe48fe8 100644
--- a/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/section.dart
+++ b/app_flowy/lib/workspace/presentation/widgets/menu/widget/app/section/section.dart
@@ -55,6 +55,7 @@ class ViewSection extends StatelessWidget {
}
class ViewSectionNotifier with ChangeNotifier {
+ bool isDisposed = false;
List<View> _views;
View? _selectedView;
CancelableOperation? _notifyListenerOperation;
@@ -107,7 +108,16 @@ class ViewSectionNotifier with ChangeNotifier {
_notifyListenerOperation = CancelableOperation.fromFuture(
Future.delayed(const Duration(milliseconds: 30), () {}),
).then((_) {
- notifyListeners();
+ if (!isDisposed) {
+ notifyListeners();
+ }
});
}
+
+ @override
+ void dispose() {
+ isDisposed = true;
+ _notifyListenerOperation?.cancel();
+ super.dispose();
+ }
}
diff --git a/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart b/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart
index b72da55152..40045ed3cc 100644
--- a/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart
+++ b/app_flowy/packages/flowy_infra_ui/lib/style_widget/scrolling/styled_scroll_bar.dart
@@ -59,7 +59,9 @@ class ScrollbarState extends State<StyledScrollbar> {
).then((_) {
// Opti: hide with animation
hideHandler = true;
- setState(() {});
+ if (mounted) {
+ setState(() {});
+ }
});
} else {
hideHandler = false;