Feature Request: Drag & drop file to upload
This commit is contained in:
parent
e005c64bcf
commit
02d2c8dc29
|
|
@ -15,6 +15,7 @@ import 'package:http/http.dart';
|
|||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:invoiceninja_flutter/redux/document/document_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/dashed_rect.dart';
|
||||
import 'package:invoiceninja_flutter/utils/completers.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
|
@ -85,6 +86,7 @@ class _DocumentGridState extends State<DocumentGrid> {
|
|||
onDragExited: (detail) {
|
||||
setState(() => _dragging = false);
|
||||
},
|
||||
/*
|
||||
child: Container(
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
|
|
@ -103,6 +105,24 @@ class _DocumentGridState extends State<DocumentGrid> {
|
|||
child: Text(localization.dropFileHere),
|
||||
),
|
||||
),
|
||||
*/
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
height: 100,
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: Text(localization.dropFileHere),
|
||||
),
|
||||
color: _dragging
|
||||
? Colors.blue.withOpacity(0.4)
|
||||
: Theme.of(context).scaffoldBackgroundColor,
|
||||
),
|
||||
DashedRect(
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
|
|
|||
|
|
@ -117,7 +117,8 @@ class ExpenseEditNotesState extends State<ExpenseEditNotes> {
|
|||
child: HelpText(localization.saveToUploadDocuments),
|
||||
height: 200,
|
||||
)
|
||||
else
|
||||
else ...[
|
||||
SizedBox(height: 8),
|
||||
DocumentGrid(
|
||||
documents: expense.documents.toList(),
|
||||
onUploadDocument: (path) =>
|
||||
|
|
@ -128,6 +129,7 @@ class ExpenseEditNotesState extends State<ExpenseEditNotes> {
|
|||
onRenamedDocument: () =>
|
||||
store.dispatch(LoadExpense(expenseId: expense.id)),
|
||||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue