uptimemesh_flutter 1.0.0 copy "uptimemesh_flutter: ^1.0.0" to clipboard
uptimemesh_flutter: ^1.0.0 copied to clipboard

UptimeMesh Flutter SDK — crash, performance and network monitoring.

uptimemesh_flutter #

pub version license

Flutter SDK for UptimeMesh — automatic crash reporting, session tracking, screen analytics and custom event monitoring.

Features #

  • Automatic crash reportingFlutterError.onError + PlatformDispatcher.onError
  • Session tracking — device model, OS, app version, network type
  • Screen tracking — automatic via NavigatorObserver
  • Custom events — track any user action with properties
  • Offline bufferSharedPreferences persistence, auto-retry on reconnect
  • Batch sending — efficient 30s batching
  • Null-safe — Dart 3 / Flutter 3+

Installation #

Add to pubspec.yaml:

dependencies:
  uptimemesh_flutter: ^1.0.0

Then:

flutter pub get

Quick Start #

// main.dart
import 'package:flutter/material.dart';
import 'package:uptimemesh_flutter/uptimemesh_flutter.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await UptimeMesh.init('YOUR_API_KEY');
  runApp(const MyApp());
}

Get your API key from UptimeMesh dashboard → Mobil Uygulamalar → [App] → Entegrasyon.


API Reference #

await UptimeMesh.init(apiKey, [options]) #

Initialize the SDK. Must be called after WidgetsFlutterBinding.ensureInitialized().

await UptimeMesh.init(
  'YOUR_API_KEY',
  const UptimeMeshOptions(
    debug: true,
    flushInterval: Duration(seconds: 30),
    maxQueueSize: 50,
    apiUrl: 'https://api.uptimemesh.com',  // on-prem override
  ),
);
Option Type Default Description
apiUrl String? https://api.uptimemesh.com API endpoint
flushInterval Duration 30 seconds Auto-flush interval
maxQueueSize int 50 Queue size for immediate flush
debug bool false Print logs to console

Automatic Screen Tracking #

Add UptimeMesh.navigatorObserver to MaterialApp:

MaterialApp(
  navigatorObservers: [UptimeMesh.navigatorObserver],
  routes: {
    '/': (_) => const HomeScreen(),
    '/profile': (_) => const ProfileScreen(),
  },
)

For GoRouter:

GoRouter(
  observers: [UptimeMesh.navigatorObserver],
  routes: [ /* ... */ ],
)

UptimeMesh.trackScreen(name) #

Manual screen tracking.

UptimeMesh.trackScreen('HomeScreen');

UptimeMesh.trackEvent(name, properties?) #

Track custom events.

UptimeMesh.trackEvent('button_tapped', {'button': 'login'});
UptimeMesh.trackEvent('purchase_completed', {
  'amount': 99.90,
  'currency': 'TRY',
  'product_id': 'plan_pro',
});

UptimeMesh.captureError(error, stackTrace?) #

Manually report a caught error.

try {
  await loadData();
} catch (e, stack) {
  UptimeMesh.captureError(e, stack);
}

await UptimeMesh.flush() #

Immediately send all queued events.

await UptimeMesh.flush();

Wrap your app with a runZonedGuarded to catch async errors outside the Flutter framework:

void main() {
  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await UptimeMesh.init('YOUR_API_KEY');
    runApp(const MyApp());
  }, (error, stack) {
    UptimeMesh.captureError(error, stack);
  });
}

What's Collected Automatically #

Data Source
Flutter framework errors FlutterError.onError
Dart async / platform errors PlatformDispatcher.onError
Device model device_info_plus
OS version device_info_plus
App version + build number package_info_plus
Network type (wifi/cellular) connectivity_plus

Event Types #

Type Description Triggered By
crash Unhandled fatal error Framework hooks
error Caught / non-fatal error captureError()
screen Screen view navigatorObserver / trackScreen()
event Custom user action trackEvent()

Offline Mode #

Events are persisted to SharedPreferences when offline. On the next app launch, they are loaded and sent automatically.


Troubleshooting #

Events not showing up?

  1. Enable debug: true — look for [UptimeMesh] prints
  2. Check your API key in the dashboard
  3. Call await UptimeMesh.flush() manually to force send

init() throws?

  • Make sure WidgetsFlutterBinding.ensureInitialized() is called before init()

Screen tracking not working?

  • Ensure UptimeMesh.navigatorObserver is in navigatorObservers list
  • Named routes must be set — unnamed routes have no route.settings.name

Changelog #

1.0.0 — 2026-06-22 #

  • Initial release
  • Crash reporting via FlutterError.onError + PlatformDispatcher.onError
  • navigatorObserver for automatic screen tracking
  • trackEvent, trackScreen, captureError, flush
  • device_info_plus, package_info_plus, connectivity_plus integration
  • SharedPreferences offline buffer
  • Batch sending with 30s interval

License #

MIT © UptimeMesh

0
likes
0
points
613
downloads

Publisher

unverified uploader

Weekly Downloads

UptimeMesh Flutter SDK — crash, performance and network monitoring.

Homepage

License

unknown (license)

Dependencies

connectivity_plus, device_info_plus, flutter, http, package_info_plus, shared_preferences

More

Packages that depend on uptimemesh_flutter