stackdriver_dart 2.0.1 copy "stackdriver_dart: ^2.0.1" to clipboard
stackdriver_dart: ^2.0.1 copied to clipboard

Flutter package for reporting uncaught application errors and HTTP failures to Google Cloud Error Reporting.

example/lib/main.dart

import 'dart:async';

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Report Sample',
      supportedLocales: const [
        Locale('ja', 'JP'),
        Locale('en', ''),
      ],
      home: const Center(
        child: Text(
          'Report Sample',
          style: TextStyle(
            fontFamily: 'NotoSansJP',
            fontSize: 24,
            fontWeight: FontWeight.w200,
            color: Color.fromRGBO(0, 102, 238, 0.08),
          ),
        ),
      ),
    );
  }
}

Future<void> main() async {
  final config = Config(
      projectId: 'PROJECT_ID',
      key: 'API_KEY',
      service: 'my-app',
      version: '1.0.0');

  final reporter = StackDriverErrorReporter();
  reporter.start(config);

  runZonedGuarded(() async {
    runApp(const MyApp());
  }, (error, trace) {
    reporter.report(err: error, trace: trace);
  });
}
3
likes
160
points
253
downloads

Documentation

API reference

Publisher

verified publisherplayon.jp

Weekly Downloads

Flutter package for reporting uncaught application errors and HTTP failures to Google Cloud Error Reporting.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

dio, flutter, http, pretty_http_logger, stack_trace

More

Packages that depend on stackdriver_dart