From e45be2d7c195baddef9789e44930c651c7a10086 Mon Sep 17 00:00:00 2001 From: Paresh Dudhat Date: Tue, 4 May 2021 23:37:01 +0530 Subject: [PATCH] Updated Pubspec to support flutter 2.0 --- example/.flutter-plugins-dependencies | 1 + .../ios/Flutter/flutter_export_environment.sh | 13 +++++++++++++ example/lib/main.dart | 17 +++++++---------- pubspec.yaml | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 example/.flutter-plugins-dependencies create mode 100644 example/ios/Flutter/flutter_export_environment.sh diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies new file mode 100644 index 0000000..5fa391a --- /dev/null +++ b/example/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"esys_flutter_share","path":"E:\\\\Flutter\\\\project\\\\opensource\\\\esys-flutter-share\\\\","dependencies":["path_provider"]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.28\\\\","dependencies":[]}],"android":[{"name":"esys_flutter_share","path":"E:\\\\Flutter\\\\project\\\\opensource\\\\esys-flutter-share\\\\","dependencies":["path_provider"]},{"name":"path_provider","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.28\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"esys_flutter_share","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-01 20:45:45.702271","version":"2.0.5"} \ No newline at end of file diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh new file mode 100644 index 0000000..9a14a3e --- /dev/null +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=C:\src\flutter" +export "FLUTTER_APPLICATION_PATH=E:\Flutter\project\opensource\esys-flutter-share\example" +export "FLUTTER_TARGET=lib\main.dart" +export "FLUTTER_BUILD_DIR=build" +export "SYMROOT=${SOURCE_ROOT}/../build\ios" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/example/lib/main.dart b/example/lib/main.dart index 8da9b8c..59144f0 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -65,8 +65,8 @@ class _MyHomePageState extends State { Future _shareText() async { try { - Share.text('my text title', - 'This is my text to share with other applications.', 'text/plain'); + Share.text( + 'my text title', 'This is my text to share with other applications.', 'text/plain'); } catch (e) { print('error: $e'); } @@ -75,8 +75,7 @@ class _MyHomePageState extends State { Future _shareImage() async { try { final ByteData bytes = await rootBundle.load('assets/image1.png'); - await Share.file( - 'esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png', + await Share.file('esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png', text: 'My optional text.'); } catch (e) { print('error: $e'); @@ -103,8 +102,7 @@ class _MyHomePageState extends State { Future _shareCSV() async { try { final ByteData bytes = await rootBundle.load('assets/addresses.csv'); - await Share.file( - 'addresses', 'addresses.csv', bytes.buffer.asUint8List(), 'text/csv'); + await Share.file('addresses', 'addresses.csv', bytes.buffer.asUint8List(), 'text/csv'); } catch (e) { print('error: $e'); } @@ -132,8 +130,8 @@ class _MyHomePageState extends State { Future _shareImageFromUrl() async { try { - var request = await HttpClient().getUrl(Uri.parse( - 'https://shop.esys.eu/media/image/6f/8f/af/amlog_transport-berwachung.jpg')); + var request = await HttpClient().getUrl( + Uri.parse('https://shop.esys.eu/media/image/6f/8f/af/amlog_transport-berwachung.jpg')); var response = await request.close(); Uint8List bytes = await consolidateHttpClientResponseBytes(response); await Share.file('ESYS AMLOG', 'amlog.jpg', bytes, 'image/jpg'); @@ -145,8 +143,7 @@ class _MyHomePageState extends State { Future _shareSound() async { try { final ByteData bytes = await rootBundle.load('assets/cat.mp3'); - await Share.file( - 'Sound', 'cat.mp3', bytes.buffer.asUint8List(), 'audio/*'); + await Share.file('Sound', 'cat.mp3', bytes.buffer.asUint8List(), 'audio/*'); } catch (e) { print('error: $e'); } diff --git a/pubspec.yaml b/pubspec.yaml index 8bfc35d..30419a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - path_provider: ^1.1.0 + path_provider: ^2.0.1 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec