Added possibility to upload documents from file system

This commit is contained in:
Anton Stubenbord
2022-11-10 23:21:01 +01:00
parent 0469191635
commit 5a63ca2513
7 changed files with 101 additions and 22 deletions

View File

@@ -29,10 +29,11 @@ import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart';
class DocumentUploadPage extends StatefulWidget {
final Uint8List pdfBytes;
final Uint8List fileBytes;
const DocumentUploadPage({
Key? key,
required this.pdfBytes,
required this.fileBytes,
}) : super(key: key);
@override
@@ -190,7 +191,7 @@ class _DocumentUploadPageState extends State<DocumentUploadPage> {
_isUploadLoading = true;
});
await BlocProvider.of<DocumentsCubit>(context).addDocument(
widget.pdfBytes,
widget.fileBytes,
_formKey.currentState?.value[fkFileName],
onConsumptionFinished: (document) {
ScaffoldMessenger.of(rootScaffoldKey.currentContext!).showSnackBar(