Focused Agent Skills for complete Flutter and Dart app delivery.
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
Streams model sequences of asynchronous events over time. Failure to cancel subscriptions or handle race conditions between events is a major source of memory leaks and stale UI states.
.listen() without assigning the returned StreamSubscription to a variable that is explicitly cancelled in dispose(), close(), or during component unmount.cancel/listen continuations. A generation token is one package-free option:
int _searchGeneration = 0;
Future<void>? _searchCancellation;
Future<void> search(String query) async {
final generation = ++_searchGeneration;
final previous = _searchSubscription;
_searchSubscription = null;
if (previous != null) {
_searchCancellation = Future<void>.microtask(previous.cancel);
}
final cancellation = _searchCancellation;
try {
await cancellation;
} finally {
if (identical(_searchCancellation, cancellation)) {
_searchCancellation = null;
}
}
if (generation != _searchGeneration) return;
_searchSubscription = repository.search(query).listen((result) {
if (generation == _searchGeneration) emit(result);
});
}isClosed before adding events if emissions can race with disposal.// Using rxdart or a timer-based transformer
stream.debounceTime(const Duration(milliseconds: 300));switchMap semantics: map incoming events to a new stream, automatically cancelling the previous inner stream.package:fake_async to control virtual time deterministically. Avoid Future.delayed in unit tests..tessl-plugin
skills
dart-concurrency
dart-language
flutter-accessibility
flutter-ai-integration
flutter-animation
flutter-app-workflow
flutter-architecture
flutter-authentication
flutter-background-execution
flutter-build-release
flutter-ci-cd
flutter-code-review
flutter-dependency-upgrades
flutter-device-testing
flutter-figma-workflow
flutter-in-app-purchases
flutter-localization
references
flutter-location-maps
flutter-media
flutter-networking
flutter-notifications
flutter-observability
flutter-openapi-client
flutter-package-development
flutter-payments-checkout
flutter-performance
flutter-persistence
flutter-platform-integration
flutter-product-analytics
flutter-remote-config
flutter-responsive-layout
flutter-runtime-debugging
flutter-security
flutter-state-management
flutter-testing
flutter-text-rendering
references
flutter-ui-design
flutter-ui-patterns
flutter-visual-effects