diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e95f12..506e30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,3 +24,7 @@ * BugFixes and Improvisations. * All dependant packages updated to latest version + +## [1.0.6] - 25 July 2020 + +* Image Selector Widget Fixes diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..534ecd0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Sharafudheen KK + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 56325f5..089f092 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ No configuration required - the plugin should work out of the box. ### Example ``` dart +import 'dart:async'; +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:path/path.dart'; import 'package:photofilters/photofilters.dart'; @@ -31,19 +34,34 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - imageLib.Image _image; String fileName; - Filter _filter; - List filters = presetFitersList; + List filters = presetFiltersList; + File imageFile; - Future getImage() async { - var imageFile = await ImagePicker.pickImage(source: ImageSource.gallery); + Future getImage(context) async { + imageFile = await ImagePicker.pickImage(source: ImageSource.gallery); fileName = basename(imageFile.path); var image = imageLib.decodeImage(imageFile.readAsBytesSync()); - image = imageLib.copyResize(image, 600); - setState(() { - _image = image; - }); + image = imageLib.copyResize(image, width: 600); + Map imagefile = await Navigator.push( + context, + new MaterialPageRoute( + builder: (context) => new PhotoFilterSelector( + title: Text("Photo Filter Example"), + image: image, + filters: presetFiltersList, + filename: fileName, + loader: Center(child: CircularProgressIndicator()), + fit: BoxFit.contain, + ), + ), + ); + if (imagefile != null && imagefile.containsKey('image_filtered')) { + setState(() { + imageFile = imagefile['image_filtered']; + }); + print(imageFile.path); + } } @override @@ -52,19 +70,17 @@ class _MyAppState extends State { appBar: new AppBar( title: new Text('Photo Filter Example'), ), - body: new Container( - alignment: Alignment(0.0, 0.0), - child: _image == null - ? new Text('No image selected.') - : new PhotoFilterSelector( - image: _image, - filters: presetFitersList, - filename: fileName, - loader: Center(child: CircularProgressIndicator()), - ), + body: Center( + child: new Container( + child: imageFile == null + ? Center( + child: new Text('No image selected.'), + ) + : Image.file(imageFile), + ), ), floatingActionButton: new FloatingActionButton( - onPressed: getImage, + onPressed: () => getImage(context), tooltip: 'Pick Image', child: new Icon(Icons.add_a_photo), ), diff --git a/example/.gitignore b/example/.gitignore index 9a24b78..3a85c7f 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -23,6 +23,8 @@ **/doc/api/ .dart_tool/ .flutter-plugins +.flutter-plugins-dependencies +flutter_export_environment.sh .packages .pub-cache/ .pub/ diff --git a/example/android/gradle.properties b/example/android/gradle.properties index b472197..ea4bbaf 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1 +1,2 @@ org.gradle.jvmargs=-Xmx1536M +android.enableR8=true diff --git a/pubspec.lock b/pubspec.lock index 8a890a2..a284772 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: analyzer: dependency: transitive @@ -14,56 +14,63 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.13" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.4.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.12" convert: dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.1" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.11" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.1.4" csslib: dependency: transitive description: @@ -108,7 +115,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.11.3+17" + version: "0.12.2" http_multi_server: dependency: transitive description: @@ -129,7 +136,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.12" image_picker: dependency: "direct dev" description: @@ -151,13 +158,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.1+1" - json_rpc_2: - dependency: transitive - description: - name: json_rpc_2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" kernel: dependency: transitive description: @@ -178,14 +178,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.6" meta: dependency: "direct main" description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.1.8" mime: dependency: transitive description: @@ -213,21 +213,21 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.9.3" package_resolver: dependency: transitive description: name: package_resolver url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.10" path: dependency: "direct dev" description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" path_provider: dependency: "direct main" description: @@ -248,7 +248,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.4.0" pool: dependency: transitive description: @@ -269,7 +269,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.3" shelf: dependency: transitive description: @@ -309,21 +309,21 @@ packages: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "2.0.0" source_maps: dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.7" + version: "0.10.9" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: @@ -344,7 +344,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" term_glyph: dependency: transitive description: @@ -358,21 +358,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.6.1" + version: "1.14.4" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.4" + version: "0.2.15" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.3.4" typed_data: dependency: transitive description: @@ -387,13 +387,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" - vm_service_client: + vm_service: dependency: transitive description: - name: vm_service_client + name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "0.2.6+2" + version: "4.1.0" watcher: dependency: transitive description: @@ -408,13 +408,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.13" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.3" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.2.5" + version: "3.6.1" yaml: dependency: transitive description: @@ -423,5 +430,5 @@ packages: source: hosted version: "2.1.15" sdks: - dart: ">=2.2.0 <3.0.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.5.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index e768342..db1007a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,10 @@ name: photofilters description: A flutter package for applying various types of filters to an image. You can create your own filters and subfilters too. -version: 1.0.5 -author: Sharafudheen KK +version: 1.0.6 homepage: https://github.com/skkallayath/photofilters environment: - sdk: ">=2.0.0-dev.68.0 <3.0.0" + sdk: ">=2.0.0 <3.0.0" dependencies: flutter: