todo-app/lib/ui/image_input_io.dart
Krzysztof kuhy Rudnicki 0798f7b1d0 Attach images to notes, stored on dufs and kept offline
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-25 14:11:15 +02:00

28 lines
750 B
Dart

import 'dart:typed_data';
import 'package:flutter/widgets.dart';
/// Receives pasted or dropped images and the count of non-image files.
typedef ImageInputCallback =
void Function(List<Uint8List> images, int rejected);
/// Off the web there is no document to paste or drop onto (Android attaches
/// through the 📎 button), so this is just [child].
class ImageInputListener extends StatelessWidget {
/// Wraps [child]; [onImages] is never called on this platform.
const ImageInputListener({
required this.onImages,
required this.child,
super.key,
});
/// Unused off the web.
final ImageInputCallback onImages;
/// The screen body.
final Widget child;
@override
Widget build(BuildContext context) => child;
}