sentry_hive 7.18.0 copy "sentry_hive: ^7.18.0" to clipboard
sentry_hive: ^7.18.0 copied to clipboard

An integration which adds support for performance tracing for the hive package.


Sentry integration for hive package #

package build pub likes popularity pub points
sentry_hive build pub package likes popularity pub points

Integration for the hive package.

Usage

  • Sign up for a Sentry.io account and get a DSN at https://sentry.io.

  • Follow the installing instructions on pub.dev.

  • Initialize the Sentry SDK using the DSN issued by Sentry.io.

  • Call...

import 'package:sentry/sentry.dart';
import 'package:hive/hive.dart';
import 'package:sentry_hive/sentry_hive.dart';
import 'package:path_provider/path_provider.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) {
      options.dsn = 'https://example@sentry.io/add-your-dsn-here';
      options.tracesSampleRate = 1.0;
    },
    appRunner: () => runApp(YourApp()),
  );
}

Future<void> insertUser() async {
  // Use [SentryHive] where you would use [Hive]
  final appDir = await getApplicationDocumentsDirectory();
  SentryHive
    ..init(appDir.path)
    ..registerAdapter(PersonAdapter());

  var box = await SentryHive.openBox('testBox');

  var person = Person(
    name: 'Dave',
    age: 22,
  );

  await box.put('dave', person);

  print(box.get('dave')); // Dave: 22
}

@HiveType(typeId: 1)
class Person {
  Person({required this.name, required this.age});

  @HiveField(0)
  String name;

  @HiveField(1)
  int age;

  @override
  String toString() {
    return '$name: $age';
  }
}

Resources

  • Documentation
  • Forum
  • Discord
  • Stack Overflow
  • Twitter Follow
2
likes
0
pub points
81%
popularity

Publisher

verified publishersentry.io

An integration which adds support for performance tracing for the hive package.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

hive, meta, sentry

More

Packages that depend on sentry_hive