Skip to main content

easyslo 0.1.1 copy "easyslo: ^0.1.1" to clipboard
easyslo: ^0.1.1 copied to clipboard

Lightweight outcome monitoring for Flutter. Persistent batching, offline retries, and success-rate SLOs.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:easyslo/easyslo.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  // Await local setup so the first app outcomes can be persisted. Network
  // delivery runs in the background and initialization errors never escape.
  await Sdk.init(const String.fromEnvironment('MOBILESLO_KEY'));
  runApp(const Example());
}

class Example extends StatelessWidget {
  const Example({super.key});
  @override
  Widget build(BuildContext context) => MaterialApp(
      home: Scaffold(
          appBar: AppBar(title: const Text('EasySLO example')),
          body: Center(
              child: Column(mainAxisSize: MainAxisSize.min, children: [
            FilledButton(
                onPressed: () => Sdk.success('checkout'),
                child: const Text('Report successful checkout')),
            OutlinedButton(
                onPressed: () =>
                    Sdk.failure('checkout', Exception('Checkout failed')),
                child: const Text('Report failed checkout')),
            TextButton(
                onPressed: () => Sdk.flush(),
                child: const Text('Flush queued outcomes')),
          ]))));
}
0
likes
0
points
180
downloads

Publisher

verified publishereasyslo.com

Weekly Downloads

Lightweight outcome monitoring for Flutter. Persistent batching, offline retries, and success-rate SLOs.

Homepage

Topics

#monitoring #observability #reliability #slo

License

unknown (license)

Dependencies

crypto, dio, flutter, http, package_info_plus, path, sqflite, uuid

More

Packages that depend on easyslo

Packages that implement easyslo