Merge branch 'main' into drewroengoogle-patch-1
diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version
index 241b187..717f6c6 100644
--- a/.ci/flutter_master.version
+++ b/.ci/flutter_master.version
@@ -1 +1 @@
-c40173f114fa8b830531578586f4f4eedd2b2c1f
+f842ed916514879fe6898b2a5a4053c63c3308fe
diff --git a/packages/dynamic_layouts/example/test/wrap_example_test.dart b/packages/dynamic_layouts/example/test/wrap_example_test.dart
index 03dfabd..c517a9e 100644
--- a/packages/dynamic_layouts/example/test/wrap_example_test.dart
+++ b/packages/dynamic_layouts/example/test/wrap_example_test.dart
@@ -3,17 +3,17 @@
 // found in the LICENSE file.
 
 import 'package:example/wrap_layout_example.dart';
+import 'package:flutter/foundation.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_test/flutter_test.dart';
 
 void main() {
   testWidgets('Check that the children are layed out.',
       (WidgetTester tester) async {
-    await tester.pumpWidget(
-      const MaterialApp(
-        home: WrapExample(),
-      ),
+    const MaterialApp app = MaterialApp(
+      home: WrapExample(),
     );
+    await tester.pumpWidget(app);
     await tester.pumpAndSettle();
 
     // See if there are children layed out.
@@ -23,10 +23,29 @@
     expect(find.text('Index 3'), findsOneWidget);
     expect(find.text('Index 4'), findsOneWidget);
 
+    // Material 3 changes the expected layout positioning.
+    final bool usesMaterial3 = (app.theme ?? ThemeData.light()).useMaterial3;
+    final Offset offset0 = usesMaterial3
+        ? Offset(0.0, _getExpectedYOffset(91.0))
+        : const Offset(0.0, 103.0);
+    final Offset offset1 = usesMaterial3
+        ? Offset(65.0, _getExpectedYOffset(121.0))
+        : const Offset(66.0, 124.0);
+    final Offset offset3 = usesMaterial3
+        ? Offset(270.0, _getExpectedYOffset(171.0))
+        : const Offset(271.0, 174.0);
+    final Offset offset4 = usesMaterial3
+        ? Offset(380.0, _getExpectedYOffset(221.0))
+        : const Offset(381.0, 224.0);
+
     // See if they are in expected position.
-    expect(tester.getTopLeft(find.text('Index 0')), const Offset(0.0, 103.0));
-    expect(tester.getTopLeft(find.text('Index 1')), const Offset(66.0, 124.0));
-    expect(tester.getTopLeft(find.text('Index 3')), const Offset(271.0, 174.0));
-    expect(tester.getTopLeft(find.text('Index 4')), const Offset(381.0, 224.0));
+    expect(tester.getTopLeft(find.text('Index 0')), offset0);
+    expect(tester.getTopLeft(find.text('Index 1')), offset1);
+    expect(tester.getTopLeft(find.text('Index 3')), offset3);
+    expect(tester.getTopLeft(find.text('Index 4')), offset4);
   });
 }
+
+double _getExpectedYOffset(double nonWeb) {
+  return kIsWeb ? nonWeb - 0.5 : nonWeb;
+}
diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md
index e3603a0..4672e6a 100644
--- a/packages/image_picker/image_picker_android/CHANGELOG.md
+++ b/packages/image_picker/image_picker_android/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.8.7+4
+
+* Updates the example to use the latest versions of the platform interface APIs.
+
 ## 0.8.7+3
 
 * Bumps androidx.activity:activity from 1.7.1 to 1.7.2.
diff --git a/packages/image_picker/image_picker_android/example/lib/main.dart b/packages/image_picker/image_picker_android/example/lib/main.dart
index 7d58a2a..e9abf0c 100755
--- a/packages/image_picker/image_picker_android/example/lib/main.dart
+++ b/packages/image_picker/image_picker_android/example/lib/main.dart
@@ -111,22 +111,23 @@
         await _displayPickImageDialog(context,
             (double? maxWidth, double? maxHeight, int? quality) async {
           try {
-            final List<XFile>? pickedFileList = isMedia
+            final ImageOptions imageOptions = ImageOptions(
+              maxWidth: maxWidth,
+              maxHeight: maxHeight,
+              imageQuality: quality,
+            );
+            final List<XFile> pickedFileList = isMedia
                 ? await _picker.getMedia(
                     options: MediaOptions(
                         allowMultiple: isMultiImage,
-                        imageOptions: ImageOptions(
-                          maxWidth: maxWidth,
-                          maxHeight: maxHeight,
-                          imageQuality: quality,
-                        )),
+                        imageOptions: imageOptions),
                   )
-                : await _picker.getMultiImage(
-                    maxWidth: maxWidth,
-                    maxHeight: maxHeight,
-                    imageQuality: quality,
+                : await _picker.getMultiImageWithOptions(
+                    options: MultiImagePickerOptions(
+                      imageOptions: imageOptions,
+                    ),
                   );
-            if (pickedFileList != null && context.mounted) {
+            if (pickedFileList.isNotEmpty && context.mounted) {
               _showPickedSnackBar(context, pickedFileList);
             }
             setState(() {
@@ -167,11 +168,13 @@
         await _displayPickImageDialog(context,
             (double? maxWidth, double? maxHeight, int? quality) async {
           try {
-            final XFile? pickedFile = await _picker.getImage(
+            final XFile? pickedFile = await _picker.getImageFromSource(
               source: source,
-              maxWidth: maxWidth,
-              maxHeight: maxHeight,
-              imageQuality: quality,
+              options: ImagePickerOptions(
+                maxWidth: maxWidth,
+                maxHeight: maxHeight,
+                imageQuality: quality,
+              ),
             );
             if (pickedFile != null && context.mounted) {
               _showPickedSnackBar(context, <XFile>[pickedFile]);
diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml
index 98ef9e4..e5b4a6a 100755
--- a/packages/image_picker/image_picker_android/pubspec.yaml
+++ b/packages/image_picker/image_picker_android/pubspec.yaml
@@ -3,7 +3,7 @@
 repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android
 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
 
-version: 0.8.7+3
+version: 0.8.7+4
 
 environment:
   sdk: ">=2.18.0 <4.0.0"