-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Question]: the class XFILE doesn't exist. #1271
Comments
Do what the warning suggests and add the dependency to cross_file, which is an official package from the Flutter team. |
maybe share_plus should export the package? same as what |
Good point @werainkhatri a PR with the fix is more than welcome ;) |
you got it! |
you can write import 'package:cross_file/cross_file.dart'; |
What is your question?
In your example, you don't have the problem because XFile is referenced by this import : 'package:image_picker/image_picker.dart'
In the example below, I have commented the line of the import 'package:cross_file/cross_file.dart' so you can see the problem. If you uncomment the import 'package:cross_file/cross_file.dart'; you'll see the other message.
Thanks.
Code sample :
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:share_plus/share_plus.dart';
// TODO : uncomment the line below to refrence XFile
//import 'package:cross_file/cross_file.dart';
class DataShareService {
void sharingFile({
required String filename,
required BuildContext context,
required String subject,
}) async {
}
}
Checklist before submitting a question
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: