real_path_file_selector 0.1.0
real_path_file_selector: ^0.1.0 copied to clipboard
flutter realpath file selector for android,linux and other platform.i current build 2 platform.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:real_path_file_selector/real_path_file_selector.dart';
import 'package:than_pkg/than_pkg.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
home: const MyApp(),
darkTheme: ThemeData.dark(),
),
);
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
void _scanVideo() async {
final scannerPathList = await RealPathFileSelector.openFileScanner.open(
context,
mimeType: 'video',
thumbnailDirPath: '${await ThanPkg.platform.getAppExternalPath()}/tem',
);
debugPrint(scannerPathList.toString());
}
Future<void> _fileExplor() async {
final pathList = await RealPathFileSelector.openFileExplorer.open(
context,
// mimeTypes: ['video'],
title: 'Choose Video File',
initPath: '/home/thancoder/Downloads',
thumbnailDirPath: '${await ThanPkg.platform.getAppExternalPath()}/tem',
);
debugPrint(pathList.toString());
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Real Path File Chooser')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 10,
children: [
TextButton(onPressed: _scanVideo, child: Text('Scan Video')),
TextButton(onPressed: _fileExplor, child: Text('File Explorer')),
],
),
),
);
}
}