Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
30 lines
781 B
Dart
30 lines
781 B
Dart
import 'package:flutter/foundation.dart';
|
|
|
|
import 'external_media_import.dart';
|
|
|
|
/// Import failures remain available until a visible presentation consumes them.
|
|
class MediaImportFeedbackController extends ChangeNotifier {
|
|
final _pending = <ExternalMediaSelection?>[];
|
|
bool get hasPending => _pending.isNotEmpty;
|
|
|
|
void recordResult(ExternalMediaSelection? result) {
|
|
if (result == null ||
|
|
!result.failed && result.result?.failures.isNotEmpty != true) {
|
|
return;
|
|
}
|
|
_pending.add(result);
|
|
notifyListeners();
|
|
}
|
|
|
|
void recordFailure() {
|
|
_pending.add(null);
|
|
notifyListeners();
|
|
}
|
|
|
|
List<ExternalMediaSelection?> takePending() {
|
|
final notices = List<ExternalMediaSelection?>.of(_pending);
|
|
_pending.clear();
|
|
return notices;
|
|
}
|
|
}
|