KasyKasy

UI vs Logic

Widgets render. Notifiers decide. Where to put each thing.

Kit rule: widgets render and capture input. They never contain business logic.

What goes where

Widget (UI)Notifier (logic)
Text(...), KasyButton(...)goRouterProvider.go('/')
FocusScope.of(context).unfocus()toastProvider.success(...)
context.pop() in a modalRedirecting after login, purchase, error

Providers in the notifiers

ref.read(goRouterProvider).go('/route');
ref.read(toastProvider).error(title: '...', text: '...');
final t = ref.read(translationsProvider);

Why it matters

  • Tests live in the notifier, not in the UI
  • The same screen works on web and native
  • AI and new devs know where to look

Last updated on 08/02/2026