Skip to content

[image_picker] picking methods future is not completed if closing native model quickly on iOS devices #134715

@MattisBrizard

Description

@MattisBrizard

Is there an existing issue for this?

Steps to reproduce

  1. Open the gallery with pickMultipleMedia.
  2. Close the native modal very quickly

Expected results

The future ends normally.

Actual results

The future never ends.

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: OutlinedButton(
            onPressed: () async {
              debugPrint('Gallery opened');
              await ImagePicker().pickMultipleMedia();
              debugPrint('Gallery closed');
            },
            child: const Text('Open gallery'),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
image_picker_bug.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.1, on macOS 13.0.1 22A400 darwin-arm64, locale fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.82.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions