Skip to content

Commit

Permalink
Updated Export Page (#63)
Browse files Browse the repository at this point in the history
* - Updated Export page with better visuals, toast notifications, animations
- Changed return type for CSV and PDF in order to bubble up success to UI
- Added GetFlutter UI Widget library

* Tweaked widget sizes in export
Changed background

Changed sidebar Image to OSU Logo, looks better and more professional.

* Fixed text size mismatch

* Commented out background image for the time being

added flex to widgets for different screens.

* Wrapped widget in singlechildscrollview for rendering fix on reload after sending email

changed font weight to be more noticeable on switch for the time being
  • Loading branch information
amayaevan committed Apr 1, 2020
1 parent 949f891 commit df1c840
Show file tree
Hide file tree
Showing 9 changed files with 441 additions and 187 deletions.
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

0 comments on commit df1c840

Please sign in to comment.