I am building a file locker app in flutter which can lock files as well a folders. When a user unlocks a folder I want my app to show an option to view folder contents but in native file explorer. Is there any way to implement this feature?
(Thanks in advance..)
To list all the files or folders, you have to use flutter_file_manager, path, and path_provider_ex flutter package. Add the following lines in your pubspec. yaml file to add this package in your dependency. Add read / write permissions in your android/app/src/main/AndroidManifest.
You can try this package for the use case you've mentioned: open_file
Usage:
import 'package:open_file/open_file.dart';
import 'package:path_provider/path_provider.dart';
//Get the path to the directory
final String dir = (await getTemporaryDirectory()).path;
//Use the path to launch the directory with the native file explorer
await OpenFile.open('$dir\\');
(Note: Tested on windows OS only)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With