reload files after poping from drawing page
add delete item in top menu bar add feature to rename file by tapping on title bar
This commit is contained in:
@ -3,12 +3,14 @@ import 'dart:math';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'wip_toast.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../canvas/document_types.dart';
|
||||
import '../canvas/paint_controller.dart';
|
||||
import '../context/file_change_notifier.dart';
|
||||
import '../export/export_pdf.dart';
|
||||
import 'icon_material_button.dart';
|
||||
import 'wip_toast.dart';
|
||||
|
||||
class DrawingPageTopActions extends StatefulWidget {
|
||||
const DrawingPageTopActions(
|
||||
@ -159,6 +161,20 @@ class _DrawingPageTopActionsState extends State<DrawingPageTopActions> {
|
||||
);
|
||||
},
|
||||
),
|
||||
PopupMenuItem<int>(
|
||||
value: 0,
|
||||
child: const Text(
|
||||
'Delete',
|
||||
style: TextStyle(color: Color(0xffe5e5e5)),
|
||||
),
|
||||
onTap: () {
|
||||
widget.controller.file.delete().then((value) {
|
||||
Provider.of<FileChangeNotifier>(context, listen: false)
|
||||
.loadAllNotes();
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
),
|
||||
]);
|
||||
},
|
||||
),
|
||||
|
@ -1,9 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../canvas/document_types.dart';
|
||||
import '../canvas/drawing_page.dart';
|
||||
import '../context/file_change_notifier.dart';
|
||||
|
||||
class NoteTile extends StatelessWidget {
|
||||
const NoteTile({Key? key, required this.data}) : super(key: key);
|
||||
@ -19,9 +17,7 @@ class NoteTile extends StatelessWidget {
|
||||
MaterialPageRoute(
|
||||
builder: (context) => DrawingPage(meta: data),
|
||||
),
|
||||
).then((value) =>
|
||||
Provider.of<FileChangeNotifier>(context, listen: false)
|
||||
.loadAllNotes());
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 100,
|
||||
|
Reference in New Issue
Block a user