diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index b754213..cd15848 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -24,6 +24,9 @@
+
diff --git a/example/android/app/src/main/kotlin/carnegietechnologies/gallery_saver_example/MainActivity.kt b/example/android/app/src/main/kotlin/carnegietechnologies/gallery_saver_example/MainActivity.kt
index f6c003f..ccc2cd3 100644
--- a/example/android/app/src/main/kotlin/carnegietechnologies/gallery_saver_example/MainActivity.kt
+++ b/example/android/app/src/main/kotlin/carnegietechnologies/gallery_saver_example/MainActivity.kt
@@ -1,13 +1,13 @@
package carnegietechnologies.gallery_saver_example
-import android.os.Bundle
+import io.flutter.embedding.android.FlutterActivity
+import io.flutter.embedding.engine.FlutterEngine
-import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- GeneratedPluginRegistrant.registerWith(this)
+
+ override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
+ GeneratedPluginRegistrant.registerWith(flutterEngine)
}
}
diff --git a/example/lib/main.dart b/example/lib/main.dart
index b63a47c..1ae89b1 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -37,8 +37,10 @@ class _MyAppState extends State {
flex: 1,
child: Container(
child: SizedBox.expand(
- child: RaisedButton(
- color: Colors.blue,
+ child: TextButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Colors.blue),
+ ),
onPressed: _takePhoto,
child: Text(firstButtonText,
style: TextStyle(
@@ -51,8 +53,10 @@ class _MyAppState extends State {
Flexible(
child: Container(
child: SizedBox.expand(
- child: RaisedButton(
- color: Colors.white,
+ child: TextButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Colors.white),
+ ),
onPressed: _recordVideo,
child: Text(secondButtonText,
style: TextStyle(
@@ -69,8 +73,8 @@ class _MyAppState extends State {
}
void _takePhoto() async {
- ImagePicker.pickImage(source: ImageSource.camera)
- .then((File recordedImage) {
+ ImagePicker().getImage(source: ImageSource.camera)
+ .then((PickedFile recordedImage) {
if (recordedImage != null && recordedImage.path != null) {
setState(() {
firstButtonText = 'saving in progress...';
@@ -86,8 +90,8 @@ class _MyAppState extends State {
}
void _recordVideo() async {
- ImagePicker.pickVideo(source: ImageSource.camera)
- .then((File recordedVideo) {
+ ImagePicker().getVideo(source: ImageSource.camera)
+ .then((PickedFile recordedVideo) {
if (recordedVideo != null && recordedVideo.path != null) {
setState(() {
secondButtonText = 'saving in progress...';
@@ -142,8 +146,10 @@ class _ScreenshotWidgetState extends State {
key: _globalKey,
child: Container(
child: SizedBox.expand(
- child: RaisedButton(
- color: Colors.pink,
+ child: TextButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Colors.pink),
+ ),
onPressed: _saveScreenshot,
child: Text(screenshotButtonText,
style: TextStyle(fontSize: textSize, color: Colors.white)),
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 1f2e5c2..e55c15f 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -75,12 +75,17 @@ packages:
name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.5"
+ version: "2.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
gallery_saver:
dependency: "direct dev"
description:
@@ -108,7 +113,28 @@ packages:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
- version: "0.6.3+1"
+ version: "0.7.3"
+ image_picker_for_web:
+ dependency: transitive
+ description:
+ name: image_picker_for_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.0"
+ image_picker_platform_interface:
+ dependency: transitive
+ description:
+ name: image_picker_platform_interface
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.1"
+ js:
+ dependency: transitive
+ description:
+ name: js
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.3"
matcher:
dependency: transitive
description:
@@ -260,7 +286,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.0"
+ version: "2.0.4"
xdg_directories:
dependency: transitive
description:
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 24956f5..3574eef 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -6,7 +6,7 @@ environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
- image_picker: ^0.6.3+1
+ image_picker: ^0.7.3
path_provider: ^2.0.1
http: ^0.13.0
diff --git a/pubspec.lock b/pubspec.lock
index 19f9128..281613c 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -239,7 +239,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.0"
+ version: "2.0.4"
xdg_directories:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 6b0eefb..69ff8ac 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -5,7 +5,6 @@ homepage: https://github.com/CarnegieTechnologies/gallery_saver
environment:
sdk: '>=2.12.0 <3.0.0'
- flutter: ">=1.12.0 <2.0.0"
module:
androidX: true