chico_services 1.3.0 copy "chico_services: ^1.3.0" to clipboard
chico_services: ^1.3.0 copied to clipboard

One-call facades for networking, storage, files, device, maps, and more on top of Chico Kit — call with parameters, defaults inside.

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 #

Androidandroid/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

0
likes
140
points
96
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

One-call facades for networking, storage, files, device, maps, and more on top of Chico Kit — call with parameters, defaults inside.

Repository (GitHub)
View/report issues

Topics

#flutter #networking #storage #helpers #chico

License

MIT (license)

Dependencies

camera, chico_kit, connectivity_plus, cross_file, dio, file_picker, flutter, flutter_secure_storage, geolocator, google_maps_flutter, image_picker, path, permission_handler, share_plus, shared_preferences, sqflite, url_launcher

More

Packages that depend on chico_services