From 875630278c6e5d87fac39e56918c324f2255b965 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Tue, 10 Aug 2021 14:01:15 +0200 Subject: [PATCH] chore: switch image_picker back to upstream https://github.com/flutter/plugins/pull/3194 has finally been merged. Also update to non-deprecated pick* methods. --- lib/pages/chat.dart | 2 +- lib/pages/chat_details.dart | 2 +- lib/pages/settings.dart | 2 +- lib/pages/settings_style.dart | 3 ++- pubspec.lock | 14 ++++++-------- pubspec.yaml | 6 +----- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/pages/chat.dart b/lib/pages/chat.dart index dd9dee15..d1ab393f 100644 --- a/lib/pages/chat.dart +++ b/lib/pages/chat.dart @@ -294,7 +294,7 @@ class ChatController extends State { void openCameraAction() async { // Make sure the textfield is unfocused before opening the camera FocusScope.of(context).requestFocus(FocusNode()); - final file = await ImagePicker().getImage(source: ImageSource.camera); + final file = await ImagePicker().pickImage(source: ImageSource.camera); if (file == null) return; final bytes = await file.readAsBytes(); await showDialog( diff --git a/lib/pages/chat_details.dart b/lib/pages/chat_details.dart index 28ad2261..c604b302 100644 --- a/lib/pages/chat_details.dart +++ b/lib/pages/chat_details.dart @@ -249,7 +249,7 @@ class ChatDetailsController extends State { void setAvatarAction() async { MatrixFile file; if (PlatformInfos.isMobile) { - final result = await ImagePicker().getImage( + final result = await ImagePicker().pickImage( source: ImageSource.gallery, imageQuality: 50, maxWidth: 1600, diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index 2ef75655..d182d2a7 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -67,7 +67,7 @@ class SettingsController extends State { } MatrixFile file; if (PlatformInfos.isMobile) { - final result = await ImagePicker().getImage( + final result = await ImagePicker().pickImage( source: ImageSource.gallery, imageQuality: 50, maxWidth: 1600, diff --git a/lib/pages/settings_style.dart b/lib/pages/settings_style.dart index f61a5246..dcb010bb 100644 --- a/lib/pages/settings_style.dart +++ b/lib/pages/settings_style.dart @@ -16,7 +16,8 @@ class SettingsStyle extends StatefulWidget { class SettingsStyleController extends State { void setWallpaperAction() async { - final wallpaper = await ImagePicker().getImage(source: ImageSource.gallery); + final wallpaper = + await ImagePicker().pickImage(source: ImageSource.gallery); if (wallpaper == null) return; Matrix.of(context).wallpaper = File(wallpaper.path); await Matrix.of(context) diff --git a/pubspec.lock b/pubspec.lock index 8d0c9bac..a57b3990 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -621,26 +621,24 @@ packages: image_picker: dependency: "direct main" description: - path: "packages/image_picker/image_picker" - ref: image_picker_camera_on_android11 - resolved-ref: "6cfc8b8812a71e4eb3480110298d9487da75c560" - url: "https://gitlab.com/famedly/company/frontend/flutter-plugins.git" - source: git - version: "0.8.1+4" + name: image_picker + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.3+2" image_picker_for_web: dependency: transitive description: name: image_picker_for_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.2" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" intl: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 8a668de6..a563af8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,11 +41,7 @@ dependencies: future_loading_dialog: ^0.2.1 geolocator: ^7.4.0 hive_flutter: ^1.1.0 - image_picker: - git: - url: https://gitlab.com/famedly/company/frontend/flutter-plugins.git - ref: image_picker_camera_on_android11 - path: packages/image_picker/image_picker + image_picker: ^0.8.3+2 intl: any localstorage: ^4.0.0+1 lottie: ^1.1.0