- file_handler/image_manager: jfif, jpe, wbmp uzantilari - .desktop + install.sh MimeType: image/vnd.wap.wbmp eklendi - main.dart: yeni pencere oncekinin saginda acilir (screen_retriever ile ekran tespiti) - viewer_screen: 2sn polling kaldirildi, konum kaydi tek akisa oturtuldu (acilis + move/resize debounce + close senkron) - dist/rebuild-deb.sh: .desktop kaynaktan kopyalanir (MimeType/StartupWMClass guncel kalir) - .deb guncellendi, docs: session-2026-08-03 + plan dokumanlari
29 lines
821 B
Dart
29 lines
821 B
Dart
import 'package:file_picker/file_picker.dart';
|
|
import 'image_manager.dart';
|
|
|
|
class FileHandler {
|
|
/// Open file picker dialog and load images
|
|
static Future<void> openFileDialog() async {
|
|
final result = await FilePicker.platform.pickFiles(
|
|
type: FileType.custom,
|
|
allowedExtensions: ['png', 'jpg', 'jpeg', 'jfif', 'jpe', 'webp', 'bmp', 'gif', 'wbmp'],
|
|
allowMultiple: true,
|
|
);
|
|
|
|
if (result != null && result.files.isNotEmpty) {
|
|
final paths = result.files
|
|
.where((f) => f.path != null)
|
|
.map((f) => f.path!)
|
|
.toList();
|
|
ImageManager.instance.addImages(paths);
|
|
}
|
|
}
|
|
|
|
/// Load images from given file paths
|
|
static void loadImagesFromPaths(List<String> paths) {
|
|
if (paths.isNotEmpty) {
|
|
ImageManager.instance.addImages(paths);
|
|
}
|
|
}
|
|
}
|