cyr_app_kit 0.1.0 copy "cyr_app_kit: ^0.1.0" to clipboard
cyr_app_kit: ^0.1.0 copied to clipboard

Reusable Flutter app kit built on cyr_flutter_core - bootstrap, auth token refresh, FCM push, theme, and common widgets.

cyr_app_kit #

Reusable Flutter app kit built on cyr_flutter_core.

The package provides bootstrap helpers for Dio networking, token refresh, Firebase Cloud Messaging, app theming, and common widgets used across CYR Flutter apps.

Features #

  • App bootstrap around cyr_flutter_core network and presentation config.
  • Access and refresh token storage backed by shared_preferences.
  • Dio interceptor for automatic token refresh and request retry.
  • Firebase Cloud Messaging registration, unregister, and tap handling helpers.
  • Shared theme primitives, snackbar helpers, shimmer, and gradient avatar widgets.

Getting started #

Add the package to your app:

dependencies:
  cyr_app_kit: ^0.1.0

Initialize the app kit before using services that depend on the shared locator:

await bootstrapAppKit(
  AppKitConfig(
    baseUrl: 'https://api.example.com',
    onSessionExpired: () {
      // Navigate the user back to sign in.
    },
  ),
);

Usage #

Store tokens after login:

await appTokenStorage.save(
  accessToken: accessToken,
  refreshToken: refreshToken,
);

Configure push notification callbacks:

final pushService = PushNotificationService(
  appTokenStorage,
  PushNotificationHandlers(
    onTokenRegister: (token, platform) async {
      // Send the FCM token to your backend.
    },
    onTokenUnregister: (token) async {
      // Remove the FCM token from your backend.
    },
    onMessageTap: (message) {
      // Route to the target screen.
    },
  ),
);

await pushService.initialize();

License #

MIT

0
likes
140
points
118
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Reusable Flutter app kit built on cyr_flutter_core - bootstrap, auth token refresh, FCM push, theme, and common widgets.

Repository (GitHub)
View/report issues

Topics

#flutter #dio #theme #push-notification #fcm

License

MIT (license)

Dependencies

cached_network_image, chuck_interceptor, curl_logger_dio_interceptor, cyr_flutter_core, dio, firebase_core, firebase_messaging, flutter, flutter_bloc, gap, get_it, go_router, google_fonts, shared_preferences, shimmer

More

Packages that depend on cyr_app_kit