dartway_serverpod_core_flutter 0.2.0 copy "dartway_serverpod_core_flutter: ^0.2.0" to clipboard
dartway_serverpod_core_flutter: ^0.2.0 copied to clipboard

Flutter side of the DartWay core: a typed realtime data layer over the Serverpod module, session management, connection-aware error handling and context-rich alerting.

dartway_serverpod_core_flutter #

The Flutter side of the DartWay core: a typed realtime data layer over the DartWay Serverpod module, plus sessions and context-rich error alerting.

  • Data layer in one lineref.watchModelList<NewsPost>() gives a typed live list: realtime sync, pagination, filters and skeleton loading states out of the box. ref.watchModel / ref.readModel read a single one; writes go through DwRepository.saveModel / DwRepository.deleteModel — no service wrappers, no manual sockets.
  • Sessions — passwordless auth flow on the app's own user model, session survives restarts via the authentication key manager.
  • Out-of-the-box alerting — errors are reported with app context (current route, mounted features, failed action or endpoint.method, platform, app version, user) instead of a minified web stack trace. Pass a configured DwAlerts into DwCore and it just works; custom policies plug in via DwConfig.onErrorReport.
  • Connection-aware error handling — network blips become toasts, not alerts (dwReportingOnFailedCall, streaming error classifier).

Quick start #

Your app declares the core once, typed with its own Serverpod Client and user model, and reaches it anywhere as dw:

/// Declared by the app — the framework does not export a `dw` singleton for you.
late final DwCore<Client, UserProfile> dw;

void initDwCore({required String backendUrl}) {
  dw = DwCore<Client, UserProfile>(
    config: DwConfig(
      defaultModelGetter: DwRepository.getDefault,
      appVersion: '1.0.0',
    ),
    client: Client(
      backendUrl,
      // Connection blips become a toast; everything else enters the error
      // pipeline with `endpoint.method` attached.
      onFailedCall: dwReportingOnFailedCall(
        onConnectionError: (_, _) => dw.notify.error('Network error'),
      ),
    )..authKeyProvider = DwAuthenticationKeyManager(),
    dwAlerts: DwAlerts.init(telegramConfig: myAlertsConfig),
    getUserId: (userProfile) => userProfile?.id,
  );
}
// A live list in a widget:
ref.watchModelList<NewsPost>().dwBuildListAsync(
  loadingItemsCount: 5,
  childBuilder: (posts) => ListView(...),
);

This package re-exports dartway_flutter (app bootstrap, guarded actions, notifications — no design system) — one import covers the standard app surface. The backend counterpart is dartway_serverpod_core_server.

See the canonical example app in the DartWay monorepo (example/).

0
likes
0
points
417
downloads

Publisher

verified publisherdartway.dev

Weekly Downloads

Flutter side of the DartWay core: a typed realtime data layer over the Serverpod module, session management, connection-aware error handling and context-rich alerting.

Homepage
Repository (GitHub)
View/report issues

Topics

#dartway #serverpod #flutter #riverpod #realtime

License

unknown (license)

Dependencies

collection, dartway_flutter, dartway_serverpod_core_client, dartway_serverpod_core_shared, file_picker, flutter, flutter_riverpod, heif_converter, image, image_picker, intl, path, path_provider, serverpod_client, shared_preferences

More

Packages that depend on dartway_serverpod_core_flutter