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

How to display the last media captured ? filePath does not exist for MediaCapture #405

Closed
lclalalalala opened this issue Nov 13, 2023 · 5 comments

Comments

@lclalalalala
Copy link

I am new to flutter and app development. Please give me some help.

I just copied paste from the document

import 'package:flutter/cupertino.dart';
import 'package:camerawesome/camerawesome_plugin.dart';
import 'package:path_provider/path_provider.dart';
import 'package:better_open_file/better_open_file.dart';
CameraAwesomeBuilder.awesome(
  saveConfig: SaveConfig.photoAndVideo(),
  onMediaTap: (mediaCapture) {
    OpenFile.open(mediaCapture.filePath);
  },
)

And vscode shows that

The getter 'filePath' isn't defined for the type 'MediaCapture'.
Try importing the library that defines 'filePath', correcting the name to the name of an existing getter, or defining a getter or field named 'filePath'.dart[undefined_getter](https://dart.dev/diagnostics/undefined_getter) 

How can I get the path of last captured photo?

About your device

Brand Model OS
Apple iPhone 14 Pro 16.1

Your flutter version

camerawesome: 2.0.0-dev.1

Flutter 3.13.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d211f42860 (3 weeks ago) • 2023-10-25 13:42:25 -0700
Engine • revision 0545f8705d
Tools • Dart 3.1.5 • DevTools 2.25.0

@lclalalalala
Copy link
Author

I find the right code in the examples. I tried it and works fine.

          onMediaTap: (mediaCapture) {
            // OpenFile.open(
            //   mediaCapture.captureRequest
            //       .when(single: (single) => single.file?.path),
            // );

Why is that commented and not in the document?

@g-apparence
Copy link
Collaborator

There was an issue with the upgrading version of gradle and this package.
It has been recently resolved and this will be uncommented.
Sorry for this

@g-apparence
Copy link
Collaborator

This has been fixed in last commits.

@Nashev
Copy link

Nashev commented Aug 23, 2024

Please reopen the issue and close it just after fix related example in https://docs.page/Apparence-io/camera_awesome/getting_started/awesome-ui

@Nashev
Copy link

Nashev commented Aug 23, 2024

I see a direct related PR already exists: #489

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

No branches or pull requests

3 participants