Skip to content

Conversation

Bibhukiju
Copy link
Contributor

functions added

  • share and delete pdf within an app

  • toast msg to alert user about pdf is created and deleted

}

void showToast(String msg) {
Fluttertoast.showToast(msg: msg, gravity: ToastGravity.BOTTOM);
Copy link
Collaborator

@cimplesid cimplesid Oct 15, 2020

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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow ladder import


void removeImage(int index) => _images.removeAt(index);
void showToast(String msg) {
Fluttertoast.showToast(msg: msg, gravity: ToastGravity.BOTTOM);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toast to get

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';
Copy link
Collaborator

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
Copy link
Collaborator

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());
Copy link
Collaborator

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());
Copy link
Collaborator

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 {
Copy link
Collaborator

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;
Copy link
Collaborator

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(
Copy link
Collaborator

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})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make iconData & title required

}
}

void share({int index}) {
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants