2022-09-25 22:12:57 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class Item {
|
|
|
|
bool isFolder;
|
|
|
|
Uri uri;
|
|
|
|
String name;
|
|
|
|
|
|
|
|
Item(this.isFolder, this.uri, this.name);
|
2022-09-28 13:31:24 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return 'Item{isFolder: $isFolder, uri: $uri, name: $name}';
|
|
|
|
}
|
2022-09-25 22:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class Folder {
|
|
|
|
List<Item> items;
|
|
|
|
Uri self;
|
|
|
|
Uri parent;
|
|
|
|
|
|
|
|
Folder(this.items, this.self, this.parent);
|
2022-09-27 12:43:34 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return 'Folder{items: $items, self: $self, parent: $parent}';
|
|
|
|
}
|
2022-09-25 22:12:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
abstract class DataProvider {
|
|
|
|
final List<String> validSuffix = [".jpg", ".jpeg", ".png"];
|
|
|
|
|
2022-09-27 12:43:34 +00:00
|
|
|
Future<void> connect();
|
2022-09-25 22:12:57 +00:00
|
|
|
Future<Folder> listOfFiles({Uri? uri});
|
|
|
|
ImageProvider getImageProvider(Uri uri);
|
|
|
|
}
|