Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when a Flutter screen needs app state or data - separate presentation from state, keep business logic out of widgets, and follow the app's existing state solution (Riverpod 3 Notifier/AsyncNotifier, or the official ChangeNotifier+ListenableBuilder MVVM pattern)
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Widgets render state; something else owns it. Keeping business logic and data out of the widget tree is what makes Flutter screens testable and rebuilds cheap.
Core principle: Follow the app's existing state solution (Riverpod, Bloc, Provider, etc.) — do not introduce a second one. The pattern matters more than the library.
setState.StatefulWidget is for ephemeral UI only (animation controllers, focus, scroll) — anything that outlives a rebuild or comes from a service is app state.FutureBuilder/AsyncValue that only renders the happy path ships a spinner-forever bug.Notifier/AsyncNotifier, not StateNotifier)StateNotifier/StateNotifierProvider/StateProvider/ChangeNotifierProvider are legacy as of Riverpod 3 — use Notifier/AsyncNotifier in new code. If the repo still uses StateNotifier, follow it; don't migrate existing code on your own initiative.
// state owner: no widgets, pure logic — unit-testable without pumping a widget
class TaskListNotifier extends AsyncNotifier<List<Task>> {
@override
Future<List<Task>> build() => ref.read(taskRepositoryProvider).list();
Future<void> reload() async {
state = const AsyncLoading();
state = await AsyncValue.guard(() => ref.read(taskRepositoryProvider).list());
}
}
final taskListProvider = AsyncNotifierProvider<TaskListNotifier, List<Task>>(TaskListNotifier.new);
// widget: watches state, renders each case, sends intents — no logic
ref.watch(taskListProvider).when(
loading: () => const AppSpinner(),
error: (e, _) => AppErrorView(message: e.toString(), onRetry: () => ref.read(taskListProvider.notifier).reload()),
data: (tasks) => tasks.isEmpty ? const EmptyView() : TaskList(tasks: tasks),
);
ChangeNotifier + ListenableBuilder)Flutter's own architecture guide and the flutter-apply-architecture-best-practices skill teach this pattern when the app has no state-management package at all:
class TaskListViewModel extends ChangeNotifier {
TaskListViewModel(this._repo);
final TaskRepository _repo;
List<Task>? _tasks;
Object? _error;
bool _loading = false;
List<Task>? get tasks => _tasks;
Object? get error => _error;
bool get loading => _loading;
Future<void> load() async {
_loading = true; _error = null; notifyListeners();
try { _tasks = await _repo.list(); }
catch (e) { _error = e; }
finally { _loading = false; notifyListeners(); }
}
}
ListenableBuilder(
listenable: viewModel,
builder: (context, _) => switch (viewModel) {
_ when viewModel.loading => const AppSpinner(),
_ when viewModel.error != null => AppErrorView(message: '${viewModel.error}', onRetry: viewModel.load),
_ => TaskList(tasks: viewModel.tasks ?? const []),
},
)
Pick one pattern per app and stay consistent with what's already there — don't introduce a second state-management approach into a repo that already has one.
build or initState.setState juggling data that came from an API.dispose).아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the diff adds or changes an endpoint, resolver, RPC, job or query that takes an object id, a role check, a request binding or a tenant filter - BOLA/IDOR, function-level authorization, mass assignment and tenant scoping
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use on every UI change - semantic HTML, labels for controls, keyboard-navigable dialogs/menus, visible focus, and never color as the only signal
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
How to work a task returned with review, QA or UAT findings. Use when a task is in need_revision or PR review comments are in your context.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the repository keeps its alerting in code, or a person asks for alerts outside TaskTrooper - PrometheusRule YAML, a Cloud Monitoring alert policy in Terraform, a Datadog monitor, each routed to TaskTrooper's alert ingest URL so it opens an incident here
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.