20 lines
550 B
Dart
20 lines
550 B
Dart
|
|
import 'package:halkyon_learn_flutter/src/core/files/file_picker.dart';
|
||
|
|
|
||
|
|
/// A [FilePicker] that "picks" [next], if set, and notes what it was asked
|
||
|
|
/// for.
|
||
|
|
class FakeFilePicker() implements FilePicker {
|
||
|
|
/// What the next pick gives; null as if the person cancelled.
|
||
|
|
PickedFile? next;
|
||
|
|
|
||
|
|
/// The extensions of each pick asked for, in order.
|
||
|
|
final asked = <List<String>>[];
|
||
|
|
|
||
|
|
@override
|
||
|
|
Future<PickedFile?> pick({
|
||
|
|
required String label,
|
||
|
|
required List<String> extensions,
|
||
|
|
}) async {
|
||
|
|
asked.add(extensions);
|
||
|
|
return next;
|
||
|
|
}
|
||
|
|
}
|