real_path_file_selector 0.1.0 copy "real_path_file_selector: ^0.1.0" to clipboard
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.

example/lib/main.dart

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')),
          ],
        ),
      ),
    );
  }
}
0
likes
120
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

flutter realpath file selector for android,linux and other platform.i current build 2 platform.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_spinkit, plugin_platform_interface, than_pkg

More

Packages that depend on real_path_file_selector

Packages that implement real_path_file_selector