Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] presentLimited method doesn't resolve Future on Android. #1051

Closed
Kurogoma4D opened this issue Nov 30, 2023 · 1 comment · Fixed by #1052
Closed

[Bug report] presentLimited method doesn't resolve Future on Android. #1051

Kurogoma4D opened this issue Nov 30, 2023 · 1 comment · Fixed by #1052

Comments

@Kurogoma4D
Copy link

Version

2.8.1

Platforms

Android

Device Model

Pixel 8 (Android 14)

flutter info

$ flutter doctor -v 
[✓] Flutter (Channel stable, 3.13.1, on macOS 13.5.1 22G90 darwin-arm64, locale ja-JP)
    • Flutter version 3.13.1 on channel stable at [omitted]
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e1e47221e8 (3 months ago), 2023-08-22 21:43:18 -0700
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at [omitted]
    • Platform android-34, build-tools 33.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (4 available)
[omitted]

[✓] Network resources
    • All expected network resources are available.

• No issues found!

How to reproduce?

  1. Run example code.
  2. Tap ElevatedButton on device.
  3. Tap Select photos and videos button at system dialog twice (secondary one caused by presentLimited method).
  4. Some output of print is expected, but nothing.

Logs

Connecting to VM Service at ws://127.0.0.1:62814/oXtXe8MK7OM=/ws
[+6156 ms] D/CompatibilityChangeReporter(21120): Compat change id reported: 78294732; UID 10328; state: ENABLED

Example code (optional)

import 'package:flutter/material.dart';
import 'package:photo_manager/photo_manager.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: ElevatedButton(
            onPressed: () async {
              final status = await PhotoManager.requestPermissionExtend();
              if (status.hasAccess) {
                await PhotoManager.presentLimited();
                print('present limited');
              }

              print('status: $status');
            },
            child: const Text('Hello World!'),
          ),
        ),
      ),
    );
  }
}

Contact

No response

@CaiJingLong
Copy link
Member

3.0.0-dev.4 fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants