Gallery/lib/data_provider/data_provider.dart

36 lines
670 B
Dart
Raw Permalink Normal View History

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);
@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);
@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"];
Future<void> connect();
2022-09-25 22:12:57 +00:00
Future<Folder> listOfFiles({Uri? uri});
ImageProvider getImageProvider(Uri uri);
}