Skip to content
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

Updated Export Page #63

Merged
merged 5 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added blamo/assets/images/OSU-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blamo/assets/images/dirt2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added blamo/assets/images/plants.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions blamo/lib/Export/CSVExporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ class CSVExporter {

CSVExporter(this.stateData);

void exportToCSV() async{
Future<String> exportToCSV() async{
String toWrite;
await getData();
buildCSVLines();
toWrite = formatLinesToString();
debugPrint("toWrite: $toWrite");
csvWrite(toWrite, stateData.currentDocument);
String response = await csvWrite(toWrite, stateData.currentDocument);
return response;
}

Future<int> getData() async{
Expand Down Expand Up @@ -112,7 +113,7 @@ class CSVExporter {
return formattedString;
}

void csvWrite(String toWrite, String csvName) async {
Future<String> csvWrite(String toWrite, String csvName) async {
await new Future.delayed(new Duration(milliseconds: 50));
PermissionStatus permission =
await PermissionHandler().checkPermissionStatus(PermissionGroup.storage);
Expand All @@ -132,9 +133,9 @@ class CSVExporter {
debugPrint("(CSV) printing csv to: $filepathCSV");
await file.writeAsString(toWrite);
debugPrint("(CSV) done writing csv");
return;
return "done";
}
return;
return "failed";
}

//testing
Expand Down
1 change: 1 addition & 0 deletions blamo/lib/Export/email.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Future<String> sendEmail(String documentName,String docType) async {
debugPrint("output path: " + outputPath);
} catch (e) {
print("EMAIL.dart - No filepath found for document to send");
return "No $docType type file found for $documentName";
}

if(outputPath != null) {
Expand Down