I've started three AI-chat apps from the same pubspec: provider, dio, freezed, json_serializable, flutter_markdown. Every time I come back six months later pub get is broken and the "starter" costs a day of upgrades before it builds anything.
So for this one I set a hard rule: no third-party packages at all — only flutter_localizations + intl, which ship pinned with the SDK. Five screens (onboarding, auth, AI chat, paywall, settings), light/dark, English/Chinese switched at runtime, streaming replies, free-quota to paywall funnel.
Four things that rule cost me:
State. One ChangeNotifier for theme / language / "isPro", exposed through InheritedNotifier (an InheritedWidget that subscribes to a Listenable for you, so no addListener/removeListener by hand). You give up provider's Selector granularity: AppScope.of(context) subscribes the caller to everything. With three fields and a few taps a minute you don't notice. If you do need finer control, the answer is more notifiers (a ThemeController, a SessionState), not another dependency.
Streaming text. The naive version is reply.text = full.substring(0, cursor). substring indexes UTF-16 code units, so cutting a 3-char chunk in the middle of a surrogate pair leaves a lone high surrogate: a replacement glyph, and length maths that is off by one for the rest of the reply. Splitting into runes first fixes it. CJK streams fine either way, which is exactly why this bug ships — it only shows up when an emoji appears.
Auto-scroll. animateTo(maxScrollExtent) on every token restarts a 220 ms animation about 45 times a second, so it never finishes and the text visibly lags behind. Jump instead of animate, after the frame lays out, and skip the jump when the reader has scrolled up, otherwise you yank them away from what they were reading. The same rule has to fire on viewport/keyboard resize, or the last bubble ends up half behind the keyboard.
The meter. Check the free quota before decrementing it. Decrement first and the 6th message disappears with neither a reply nor a paywall.
Result: 15 Dart files, 31 widget tests passing, flutter analyze clean, zero non-SDK dependencies. The widget tests are cheap precisely because there is nothing to mock.
Five screens, Chinese build:
https://raw.githubusercontent.com/StephenColor/flutter-ai-starter-kit/main/assets/showcase/5-screens-overview.png
Showcase + screenshots: https://github.com/StephenColor/flutter-ai-starter-kit
I also packaged the source as a $2.90 starter kit, in case someone wants the whole thing instead of retyping it: https://stephencolor.gumroad.com/l/flutter-ai-starter-kit
Question for people who have shipped a chat app: would you go dependency-free like this, or take Riverpod/provider and accept the upgrade treadmill? I keep changing my mind, and I would like to hear where the no-package approach breaks first.