Remove obsolete native event handler

This commit is contained in:
Ming Ming 2024-01-28 22:44:21 +08:00
parent 7bb2f2452a
commit b2c1c39abb
2 changed files with 0 additions and 26 deletions

View file

@ -63,8 +63,6 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
_subscriptions.add(accountPrefController.shareFolder.listen((event) { _subscriptions.add(accountPrefController.shareFolder.listen((event) {
add(_SetShareFolder(event)); add(_SetShareFolder(event));
})); }));
_nativeFileExifUpdatedListener?.begin();
} }
@override @override
@ -72,7 +70,6 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
for (final s in _subscriptions) { for (final s in _subscriptions) {
s.cancel(); s.cancel();
} }
_nativeFileExifUpdatedListener?.end();
return super.close(); return super.close();
} }
@ -322,14 +319,6 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
emit(state.copyWith(error: ExceptionEvent(ev.error, ev.stackTrace))); emit(state.copyWith(error: ExceptionEvent(ev.error, ev.stackTrace)));
} }
void _onNativeFileExifUpdated(FileExifUpdatedEvent ev) {
_log.info(ev);
_refreshThrottler.trigger(
maxResponceTime: const Duration(seconds: 3),
maxPendingCount: 10,
);
}
Future _transformItems(List<FileDescriptor> files) async { Future _transformItems(List<FileDescriptor> files) async {
_log.info("[_transformItems] Queue ${files.length} items"); _log.info("[_transformItems] Queue ${files.length} items");
_itemTransformerQueue.addJob( _itemTransformerQueue.addJob(
@ -419,18 +408,6 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
final _subscriptions = <StreamSubscription>[]; final _subscriptions = <StreamSubscription>[];
var _isHandlingError = false; var _isHandlingError = false;
var _isInitialLoad = true; var _isInitialLoad = true;
// Listen to updates from background isolates as the memories are not shared
late final _nativeFileExifUpdatedListener =
getRawPlatform() == NpPlatform.android
? NativeEventListener<FileExifUpdatedEvent>(_onNativeFileExifUpdated)
: null;
late final _refreshThrottler = Throttler(
onTriggered: (_) {
add(const _Reload());
},
logTag: _log.name,
);
} }
_ItemTransformerResult _buildItem(_ItemTransformerArgument arg) { _ItemTransformerResult _buildItem(_ItemTransformerArgument arg) {

View file

@ -29,7 +29,6 @@ import 'package:nc_photos/entity/collection.dart';
import 'package:nc_photos/entity/file_descriptor.dart'; import 'package:nc_photos/entity/file_descriptor.dart';
import 'package:nc_photos/entity/file_util.dart' as file_util; import 'package:nc_photos/entity/file_util.dart' as file_util;
import 'package:nc_photos/event/event.dart'; import 'package:nc_photos/event/event.dart';
import 'package:nc_photos/event/native_event.dart';
import 'package:nc_photos/exception_event.dart'; import 'package:nc_photos/exception_event.dart';
import 'package:nc_photos/exception_util.dart' as exception_util; import 'package:nc_photos/exception_util.dart' as exception_util;
import 'package:nc_photos/flutter_util.dart' as flutter_util; import 'package:nc_photos/flutter_util.dart' as flutter_util;
@ -40,7 +39,6 @@ import 'package:nc_photos/service.dart' as service;
import 'package:nc_photos/snack_bar_manager.dart'; import 'package:nc_photos/snack_bar_manager.dart';
import 'package:nc_photos/theme.dart'; import 'package:nc_photos/theme.dart';
import 'package:nc_photos/theme/dimension.dart'; import 'package:nc_photos/theme/dimension.dart';
import 'package:nc_photos/throttler.dart';
import 'package:nc_photos/widget/collection_browser.dart'; import 'package:nc_photos/widget/collection_browser.dart';
import 'package:nc_photos/widget/collection_picker.dart'; import 'package:nc_photos/widget/collection_picker.dart';
import 'package:nc_photos/widget/file_sharer_dialog.dart'; import 'package:nc_photos/widget/file_sharer_dialog.dart';
@ -59,7 +57,6 @@ import 'package:np_codegen/np_codegen.dart';
import 'package:np_collection/np_collection.dart'; import 'package:np_collection/np_collection.dart';
import 'package:np_common/object_util.dart'; import 'package:np_common/object_util.dart';
import 'package:np_common/or_null.dart'; import 'package:np_common/or_null.dart';
import 'package:np_platform_util/np_platform_util.dart';
import 'package:to_string/to_string.dart'; import 'package:to_string/to_string.dart';
import 'package:visibility_detector/visibility_detector.dart'; import 'package:visibility_detector/visibility_detector.dart';