Remove share package

This commit is contained in:
Hillel Coren 2021-11-14 00:29:39 +02:00
parent 7931a301e7
commit e19bb51893
9 changed files with 8 additions and 27 deletions

View File

@ -4,7 +4,6 @@ import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart'; import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_share/flutter_share.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/data/models/models.dart';
@ -23,6 +22,7 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart'; import 'package:invoiceninja_flutter/utils/platforms.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:share/share.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class DocumentGrid extends StatelessWidget { class DocumentGrid extends StatelessWidget {
@ -221,10 +221,7 @@ class DocumentTile extends StatelessWidget {
await File(filePath) await File(filePath)
.writeAsBytes(response.bodyBytes); .writeAsBytes(response.bodyBytes);
await FlutterShare.shareFile( await Share.shareFiles([filePath]);
title: '${localization.name}',
filePath: filePath,
);
} }
} else if (value == localization.delete) { } else if (value == localization.delete) {
confirmCallback( confirmCallback(

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io' as file; import 'dart:io' as file;
import 'package:flutter_redux/flutter_redux.dart'; import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_share/flutter_share.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
@ -25,6 +24,7 @@ import 'package:native_pdf_view/native_pdf_view.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:invoiceninja_flutter/utils/web_stub.dart' import 'package:invoiceninja_flutter/utils/web_stub.dart'
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart'; if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
import 'package:share/share.dart';
class ClientPdfView extends StatefulWidget { class ClientPdfView extends StatefulWidget {
const ClientPdfView({ const ClientPdfView({
@ -329,8 +329,7 @@ class _ClientPdfViewState extends State<ClientPdfView> {
'${directory.path}/${client.number}.pdf'; '${directory.path}/${client.number}.pdf';
final pdfData = file.File(filePath); final pdfData = file.File(filePath);
pdfData.writeAsBytes(_response.bodyBytes); pdfData.writeAsBytes(_response.bodyBytes);
await FlutterShare.shareFile( await Share.shareFiles([filePath]);
title: fileName, filePath: filePath);
} }
}, },
), ),

View File

@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:io' as file; import 'dart:io' as file;
import 'package:flutter_redux/flutter_redux.dart'; import 'package:flutter_redux/flutter_redux.dart';
import 'package:flutter_share/flutter_share.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
@ -26,6 +25,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:invoiceninja_flutter/utils/web_stub.dart' import 'package:invoiceninja_flutter/utils/web_stub.dart'
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart'; if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
import 'package:invoiceninja_flutter/ui/invoice/invoice_pdf_vm.dart'; import 'package:invoiceninja_flutter/ui/invoice/invoice_pdf_vm.dart';
import 'package:share/share.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class InvoicePdfView extends StatefulWidget { class InvoicePdfView extends StatefulWidget {
@ -274,8 +274,7 @@ class _InvoicePdfViewState extends State<InvoicePdfView> {
'${directory.path}/${invoice.invoiceId}.pdf'; '${directory.path}/${invoice.invoiceId}.pdf';
final pdfData = file.File(filePath); final pdfData = file.File(filePath);
pdfData.writeAsBytes(_response.bodyBytes); pdfData.writeAsBytes(_response.bodyBytes);
await FlutterShare.shareFile( await Share.shareFiles([filePath]);
title: fileName, filePath: filePath);
} }
} }
}, },

View File

@ -1,6 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io' as file; import 'dart:io' as file;
import 'package:flutter_share/flutter_share.dart';
import 'package:built_collection/built_collection.dart'; import 'package:built_collection/built_collection.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -38,6 +37,7 @@ import 'package:path_provider/path_provider.dart';
import 'package:redux/redux.dart'; import 'package:redux/redux.dart';
import 'package:invoiceninja_flutter/utils/web_stub.dart' import 'package:invoiceninja_flutter/utils/web_stub.dart'
if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart'; if (dart.library.html) 'package:invoiceninja_flutter/utils/web.dart';
import 'package:share/share.dart';
import 'credit_report.dart'; import 'credit_report.dart';
@ -424,10 +424,7 @@ class ReportsScreenVM {
final filePath = '${directory.path}/$filename'; final filePath = '${directory.path}/$filename';
final csvFile = file.File(filePath); final csvFile = file.File(filePath);
csvFile.writeAsString(csvData); csvFile.writeAsString(csvData);
await FlutterShare.shareFile( await Share.shareFiles([filePath]);
title: filename,
//text: 'Example share text',
filePath: filePath);
} }
}); });
} }

View File

@ -50,7 +50,6 @@ dependencies:
flutter_typeahead: flutter_typeahead:
git: git:
url: git://github.com/hillelcoren/flutter_typeahead.git url: git://github.com/hillelcoren/flutter_typeahead.git
flutter_share: ^2.0.0
package_info: ^2.0.2 package_info: ^2.0.2
rounded_loading_button: ^2.0.5 rounded_loading_button: ^2.0.5
version: ^2.0.0 version: ^2.0.0

View File

@ -50,7 +50,6 @@ dependencies:
flutter_typeahead: flutter_typeahead:
git: git:
url: git://github.com/hillelcoren/flutter_typeahead.git url: git://github.com/hillelcoren/flutter_typeahead.git
flutter_share: ^2.0.0
package_info: ^2.0.2 package_info: ^2.0.2
rounded_loading_button: ^2.0.5 rounded_loading_button: ^2.0.5
version: ^2.0.0 version: ^2.0.0

View File

@ -380,13 +380,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.2" version: "0.8.2"
flutter_share:
dependency: "direct main"
description:
name: flutter_share
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_slidable: flutter_slidable:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -58,7 +58,6 @@ dependencies:
flutter_typeahead: flutter_typeahead:
git: git:
url: git://github.com/hillelcoren/flutter_typeahead.git url: git://github.com/hillelcoren/flutter_typeahead.git
flutter_share: ^2.0.0
package_info: ^2.0.2 package_info: ^2.0.2
rounded_loading_button: ^2.0.5 rounded_loading_button: ^2.0.5
version: ^2.0.0 version: ^2.0.0

View File

@ -50,7 +50,6 @@ dependencies:
flutter_typeahead: flutter_typeahead:
git: git:
url: git://github.com/hillelcoren/flutter_typeahead.git url: git://github.com/hillelcoren/flutter_typeahead.git
flutter_share: ^2.0.0
package_info: ^2.0.2 package_info: ^2.0.2
rounded_loading_button: ^2.0.5 rounded_loading_button: ^2.0.5
version: ^2.0.0 version: ^2.0.0