From 2f150a0f128ff03816c48c8239f25d4c092e18c6 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 16 Feb 2020 19:29:09 +0200 Subject: [PATCH] Reports --- lib/ui/dashboard/dashboard_chart.dart | 2 +- lib/ui/reports/client_report.dart | 2 +- lib/ui/reports/reports_screen_vm.dart | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/ui/dashboard/dashboard_chart.dart b/lib/ui/dashboard/dashboard_chart.dart index 2e30a8d32..aca1ea733 100644 --- a/lib/ui/dashboard/dashboard_chart.dart +++ b/lib/ui/dashboard/dashboard_chart.dart @@ -141,7 +141,7 @@ class _DashboardChartState extends State { child: Container( color: isSelected ? Colors.blue : theme.cardColor, padding: - EdgeInsets.only(left: 16, top: 16, right: 32, bottom: 8), + EdgeInsets.only(left: 16, top: 8, right: 32, bottom: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/ui/reports/client_report.dart b/lib/ui/reports/client_report.dart index 6e2aabc1e..bf8bca33f 100644 --- a/lib/ui/reports/client_report.dart +++ b/lib/ui/reports/client_report.dart @@ -266,7 +266,7 @@ ReportResult clientReport( row.add(client.getReportNumber( value: value, currencyId: client.settings.currencyId)); } else { - row.add(client.getReportString(value: value)); + row.add(client.getReportString(value: '$value')); } } diff --git a/lib/ui/reports/reports_screen_vm.dart b/lib/ui/reports/reports_screen_vm.dart index ca6a15775..d82864bd0 100644 --- a/lib/ui/reports/reports_screen_vm.dart +++ b/lib/ui/reports/reports_screen_vm.dart @@ -1,3 +1,4 @@ +import 'dart:html'; import 'dart:io' as file; import 'package:flutter_share/flutter_share.dart'; import 'package:built_collection/built_collection.dart'; @@ -191,13 +192,11 @@ class ReportsScreenVM { '${state.uiState.reportsUIState.report}_report_$date.csv'; if (kIsWeb) { - /* - final encodedFileContents = Uri.encodeComponent(data); + final encodedFileContents = Uri.encodeComponent(csvData); AnchorElement( href: 'data:text/plain;charset=utf-8,$encodedFileContents') ..setAttribute('download', filename) ..click(); - */ } else { final directory = await getExternalStorageDirectory(); final filePath = '${directory.path}/$filename';