acta 0.0.3 copy "acta: ^0.0.3" to clipboard
acta: ^0.0.3 copied to clipboard

A tool for application management that captures events and errors in a structured and extensible way.

example/lib/example.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  ActaJournal.initialize(
    reporters: [
      ConsoleReporter(),
    ],
    options: const HandlerOptions(
      catchAsyncErrors: true,
      logFlutterErrors: true,
      logPlatformErrors: true,
      minSeverity: Severity.info,
      maxBreadcrumbs: 50,
    ),
    initialContext: {'appVersion': '1.0.0', 'build': 1, 'env': 'dev'},
    beforeSend: (report) {
      return report;
    },
    appRunner: () => runApp(const MyApp()),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Test demo')),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () {
                  ActaJournal.addBreadcrumb('Pressed INFO');
                  ActaJournal.report(
                    event: BaseEvent(
                      message: 'User pressed info',
                      severity: Severity.info,
                      metadata: {'screen': 'home'},
                    ),
                  );
                },
                child: const Text('Log info'),
              ),
              ElevatedButton(
                onPressed: () {
                  ActaJournal.addBreadcrumb('Pressed ERROR');
                  throw Exception('Boom!');
                },
                child: const Text('Throw error'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
67
downloads

Publisher

unverified uploader

Weekly Downloads

A tool for application management that captures events and errors in a structured and extensible way.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, hive, hive_flutter, http, mongo_dart

More

Packages that depend on acta