mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-11-03 23:05:44 +00:00 
			
		
		
		
	Provide release code to sentry
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user