mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Provide release code to sentry
This commit is contained in:
parent
b41f1a2ac7
commit
3ae9342a86
1 changed files with 11 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ import 'package:inventree/widget/home.dart';
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:one_context/one_context.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
import 'dsn.dart';
|
||||
|
||||
|
|
@ -17,15 +18,23 @@ import 'package:sentry_flutter/sentry_flutter.dart';
|
|||
|
||||
Future<void> main() async {
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await runZonedGuarded<Future<void>>(() async {
|
||||
|
||||
PackageInfo info = await PackageInfo.fromPlatform();
|
||||
String pkg = info.packageName;
|
||||
String version = info.version;
|
||||
String build = info.buildNumber;
|
||||
|
||||
String release = "${pkg}@${version}:${build}";
|
||||
|
||||
await Sentry.init((options) {
|
||||
options.dsn = SENTRY_DSN_KEY;
|
||||
options.release = release;
|
||||
options.environment = isInDebugMode() ? "debug" : "release";
|
||||
});
|
||||
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// Pass any flutter errors off to the Sentry reporting context!
|
||||
FlutterError.onError = (FlutterErrorDetails details) async {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue