-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shareand delete #42
base: dev
Are you sure you want to change the base?
Shareand delete #42
Conversation
@@ -43,6 +44,10 @@ Future cropImage(String imagepath, Function(String) onCrop) async { | |||
} | |||
} | |||
|
|||
void showToast(String msg) { | |||
Fluttertoast.showToast(msg: msg, gravity: ToastGravity.BOTTOM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get.showSnackbar()
use this remove fluttertoast
@@ -1,4 +1,5 @@ | |||
import 'dart:io'; | |||
import 'package:fluttertoast/fluttertoast.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow ladder import
@@ -27,4 +28,7 @@ class ImageToPdfController extends GetxController { | |||
} | |||
|
|||
void removeImage(int index) => _images.removeAt(index); | |||
void showToast(String msg) { | |||
Fluttertoast.showToast(msg: msg, gravity: ToastGravity.BOTTOM); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toast to get
@@ -7,6 +7,7 @@ import 'package:EasyScan/Utils/constants.dart'; | |||
import 'package:EasyScan/widgets/history_card.dart'; | |||
import 'package:EasyScan/Utils/permission_checker.dart'; | |||
import 'package:native_pdf_renderer/native_pdf_renderer.dart'; | |||
import 'package:share/share.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lader import
final file = dd.File(fileSystemEntitys[index].path); | ||
file.delete(recursive: false); | ||
} catch (e) { | ||
//error will be here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refresh file
_savedPdfController.refreshFiles(); | ||
_savedPdfController.deleteFile(i); | ||
showToast("Pdf has been deleted"); | ||
Get.to(HomeScreen()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't go back
onPressed: () { | ||
_imageToPdfController.exportToPdf(); | ||
showToast("Pdf has been created"); | ||
Get.to(HomeScreen()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't navigate
@@ -0,0 +1,26 @@ | |||
import 'package:flutter/material.dart'; | |||
|
|||
class ShareDelOption extends StatelessWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better naming like customRow
or customDialogOption
class ShareDelOption extends StatelessWidget { | ||
final IconData iconData; | ||
final String title; | ||
final Color color; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iconColor
return Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Icon( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either user Icon
as parameter or give default value to color
final IconData iconData; | ||
final String title; | ||
final Color color; | ||
const ShareDelOption({Key key, this.iconData, this.title, this.color}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make iconData & title required
@@ -42,6 +43,19 @@ class PdfController extends GetxController { | |||
} | |||
} | |||
|
|||
void share({int index}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make index required parameter remove curly
functions added
share and delete pdf within an app
toast msg to alert user about pdf is created and deleted