mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-06 15:15:50 -06:00
FEATURE move button to the scanner page
This commit is contained in:
@@ -5,8 +5,6 @@ import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/features/notifications/services/local_notification_service.dart';
|
||||
import 'package:paperless_mobile/core/service/file_service.dart';
|
||||
|
||||
part 'document_upload_state.dart';
|
||||
|
||||
@@ -15,9 +13,7 @@ class DocumentUploadCubit extends Cubit<DocumentUploadState> {
|
||||
|
||||
final LabelRepository _labelRepository;
|
||||
|
||||
final LocalNotificationService _notificationService;
|
||||
|
||||
DocumentUploadCubit(this._labelRepository, this._documentApi, this._notificationService)
|
||||
DocumentUploadCubit(this._labelRepository, this._documentApi)
|
||||
: super(const DocumentUploadState()) {
|
||||
_labelRepository.addListener(
|
||||
this,
|
||||
@@ -53,18 +49,6 @@ class DocumentUploadCubit extends Cubit<DocumentUploadState> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> saveLocally(
|
||||
Uint8List bytes, String fileName, String preferredLocaleSubtag
|
||||
) async {
|
||||
var file = await FileService.saveToFile(bytes, fileName);
|
||||
_notificationService.notifyFileSaved(
|
||||
filename: fileName,
|
||||
filePath: file.path,
|
||||
finished: true,
|
||||
locale: preferredLocaleSubtag,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> close() async {
|
||||
_labelRepository.removeListener(this);
|
||||
|
||||
Reference in New Issue
Block a user