saveComponent method
- ComponentTemplate component
Implementation
Future<void> saveComponent(ComponentTemplate component) async {
emit(state.copyWith(isLoading: true));
final result = await repository.save(component);
result.fold(
(error) => emit(state.copyWith(isLoading: false, error: error)),
(_) => _refresh(),
);
}