filesystem_picker icon indicating copy to clipboard operation
filesystem_picker copied to clipboard

always show parant button `..`

Open mabDc opened this issue 4 years ago • 9 comments

show .. in rootDirectory %YE{RTPZ}7SPN66$R_9(`LT

mabDc avatar Apr 08 '21 07:04 mabDc

@mabDc What is the purpose? What should happen when the ".." in the root is pressed?

andyduke avatar Apr 08 '21 21:04 andyduke

i'm confused for that in you plugin sometimes show .. when button rootName is pressed and sometimes not,

mabDc avatar Apr 11 '21 01:04 mabDc

@mabDc Please provide screenshots of these situations.

andyduke avatar Apr 16 '21 09:04 andyduke

@andyduke

image

image

https://user-images.githubusercontent.com/19526331/115011843-aea7e100-9ee1-11eb-8a44-b135369dbbe1.mp4

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:filesystem_picker/filesystem_picker.dart';
import 'package:path_provider/path_provider.dart';

void main() {
  runApp(MaterialApp(home: Material(child: FHome())));
}

class FHome extends StatefulWidget {
  FHome({Key key}) : super(key: key);

  @override
  _FHomeState createState() => _FHomeState();
}

class _FHomeState extends State<FHome> {
  Map<String, Directory> map;
  @override
  void initState() {
    map = {};
    init();
    super.initState();
  }

  init() async {
    map = {
      "ApplicationDocuments": await getApplicationDocumentsDirectory(),
      /// change here to another exist path
      r"C:\Users\mo\Documents\eso\font\": Directory(r"C:\Users\mo\Documents\eso\font\"),
    };
    setState(() {});
  }

  buildOne(String name, Directory d) {
    return ListTile(
      title: Text(name),
      onTap: () => FilesystemPicker.open(
        title: 'Save to folder',
        context: context,
        rootDirectory: d,
        rootName: d.path,
        fsType: FilesystemType.file,
        allowedExtensions: [".testfornothing"],
        pickText: 'Save file to this folder',
        folderIconColor: Colors.teal,
        fileTileSelectMode: FileTileSelectMode.wholeTile,
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        for (var k in map.keys) buildOne(k, map[k]),
      ],
    );
  }
}

mabDc avatar Apr 16 '21 10:04 mabDc

@mabDc Thank you. I'll see what the problem is.

andyduke avatar Apr 16 '21 12:04 andyduke

@mabDc Try to specify the path C:\Users\mo\Documents\eso\font\ without a trailing slash, like this: C:\Users\mo\Documents\eso\font

andyduke avatar Apr 16 '21 14:04 andyduke

what is the difference between them

mabDc avatar Apr 16 '21 14:04 mabDc

@mabDc This will help identify the problem. I don't have access to Flutter for Windows right now.

andyduke avatar Apr 16 '21 14:04 andyduke

E L8ASSI1NBY1BXO%VTU}39

this is useful ui in desktop with Name Modified editable path .. button like 7zip

@andyduke

mabDc avatar Feb 17 '22 02:02 mabDc