Chico Kit
Developer helpers for Chico UI — same results, fewer lines.
Depends on chico_ui and re-exports it, so one import covers widgets +
helpers:
import 'package:chico_kit/chico_kit.dart';
Scope: Flutter SDK + chico_ui only. No plugins (maps, camera, HTTP
clients, secure storage, file pickers, etc.).
Full stack guide (UI + kit + services):
../chico_services/doc/STACK.md.
Gallery
cd example
flutter run
Install
Local (while developing next to chico_ui):
dependencies:
chico_kit:
path: ../chico_kit
This package uses publish_to: none and a path dependency on chico_ui.
Before pub.flutter-io.cn: remove publish_to, switch chico_ui to a hosted
constraint (chico_ui: ^x.y.z), then publish UI first and kit second.
Published (later):
dependencies:
chico_kit: ^1.3.0
Need widgets only? Depend on chico_ui alone.
API
| Area | Helpers |
|---|---|
| Context | showToast, showBusy / hideBusy, confirm, prompt, pushPage, replacePage, pushRootPage, popToRoot, showSheet, showActionSheet, unfocus, haptics, isDark / isRtl / isKeyboardVisible, chicoTheme / chicoMedia / chicoL10n |
| Form | context.submitForm, ChicoFormatters |
| Clipboard | ChicoClipboard.copy / paste, context.copyText |
| Responsive | ChicoResponsive, context.chicoValue |
| Validate | required, email, minLength, maxLength, pattern, digits, url, phone, match, equals, compose |
| Format | ChicoFormat.*, ChicoTimeAgo, ChicoCompact |
| Extensions | blank strings, distinct / chunked / moved, 300.ms, atLeast / atMost, Map.getOrPut |
| Async | ChicoDebouncer, ChicoThrottler, ChicoAsync.guard / retry / result |
| Once / bus | ChicoOnce, ChicoOnceKey, ChicoBus, ChicoChannels |
| Cache | ChicoCache |
| Platform | ChicoPlatform |
| Log | ChicoLog |
| URI | ChicoUri, Uri.withQuery / joinPath |
| Codec | ChicoCodec |
| Scroll | scrollToTop / scrollToBottom |
| Paging | ChicoPaging |
| Listen | ChicoListen, chicoAfterFrame |
| Data UI | ChicoAsyncBuilder, ChicoPagedList |
| Result | ChicoResult.ok / err, capture, when |
Forms
ChicoTextFormField(
label: 'Email',
validator: ChicoValidators.compose([
ChicoValidators.required(),
ChicoValidators.email(),
]),
inputFormatters: ChicoFormatters.maxLength(80),
);
Navigation
await context.pushPage(const DetailPage());
final ok = await context.confirm(
'Delete item?',
confirmTone: ChicoButtonTone.destructive,
);
Cache / once / channels
final cache = ChicoCache<String>(ttl: const Duration(minutes: 5));
cache.put('token', value);
ChicoOnceKey.run('paywall', openPaywall);
ChicoChannels.on<String>('cart', (msg) => showToast(msg));
ChicoChannels.emit<String>('cart', 'updated');
Layout
Projects/
chico_ui/ # widgets + tokens
chico_kit/ # this package → depends on chico_ui
License
MIT
Libraries
- chico_kit
- Chico Kit — helpers that cut boilerplate on top of Chico UI.