Chico Services

One-call facades for app infrastructure on top of Chico Kit / Chico UI.

import 'package:chico_services/chico_services.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await ChicoServices.init(baseUrl: 'https://api.example.com');
  runApp(const ChicoApp(home: HomePage()));
}
final me = await context.apiBusy(() => ChicoApi.get('/me'));
await ChicoStore.put('users', '1', {'name': 'Ada'});
final photo = await ChicoFiles.pickImage();
await ChicoShare.text('Hello');
final pos = await ChicoLocation.current();
await ChicoLauncher.maps(lat: pos!.latitude, lng: pos.longitude);

Install (local)

dependencies:
  chico_services:
    path: ../chico_services

API

Facade Calls
ChicoServices init(baseUrl: …) — prefs + store + optional API
ChicoAuth configure / restore / signIn / signOut / listenable
ChicoApi get / post / put / patch / delete, tokens, *Result
ChicoSecure put / get / delete / clear
ChicoPrefs typed prefs getters/setters
ChicoStore SQLite docs: put / get / all / delete
ChicoFiles pickImage / takePhoto / pickDocument(s)
ChicoPermissions camera / photos / location / …
ChicoLocation current / lastKnown / distanceMeters
ChicoLauncher url / maps / phone / email / sms
ChicoShare text / files
ChicoNet isOnline / onChange
ChicoCameraView live preview + capture
ChicoMapView Google Map + markers
Context context.api, context.apiBusy, signInBusy, signOutBusy

Stack guide

See doc/STACK.md — boot, auth, async screens, paged lists, and recipes in ~15 minutes.

Maps API key

Android — android/app/src/main/AndroidManifest.xml:

<meta-data
    android:name="com.google.android.geo.API_KEY"
    android:value="YOUR_ANDROID_MAPS_API_KEY"/>

iOS — in AppDelegate before GeneratedPluginRegistrant:

GMSServices.provideAPIKey("YOUR_IOS_MAPS_API_KEY")

Still optional

Push (Firebase / OneSignal) stays app-specific — it forces Firebase config on every consumer, so it is not a hard dependency here. Wire FCM in the app when needed, then wrap with the same one-liner style.

Platform notes

  • Camera preview is mobile-only.
  • Windows + project on E: / Pub cache on C:: example sets kotlin.incremental=false (see example/android/gradle.properties).

License

MIT

Libraries

chico_services
Chico Services — one-call facades for app infrastructure.