reset method
Resets the controller to its initial state.
Implementation
Future<void> reset() async {
final attachments = [...value];
for (final attachment in attachments) {
final file = attachment.file;
final uploadState = attachment.uploadState;
if (file == null || uploadState.isSuccess || isWeb) continue;
await _removeFromCache(file);
}
value = initialAttachments ?? const [];
}