Last updated:
0 purchases
sentry isar
Sentry integration for isar package #
package
build
pub
likes
popularity
pub points
sentry_isar
Integration for the isar 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:path_provider/path_provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:sentry_isar/sentry_isar.dart';
import 'user.dart';
Future<void> main() async {
await SentryFlutter.init(
(options) {
options.dsn = 'https://[email protected]/add-your-dsn-here';
options.tracesSampleRate = 1.0;
},
// Init your App.
appRunner: () => runApp(MyApp()),
);
}
Future<void> runApp() async {
final tr = Sentry.startTransaction(
'isarTest',
'db',
bindToScope: true,
);
final dir = await getApplicationDocumentsDirectory();
final isar = await SentryIsar.open(
[UserSchema],
directory: dir.path,
);
final newUser = User()
..name = 'Joe Dirt'
..age = 36;
await isar.writeTxn(() async {
await isar.users.put(newUser); // insert & update
});
final existingUser = await isar.users.get(newUser.id); // get
await isar.writeTxn(() async {
await isar.users.delete(existingUser!.id); // delete
});
await tr.finish(status: const SpanStatus.ok());
}
copied to clipboard
Resources
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.