Compare commits

..

No commits in common. 'a6c2ee5fb5330ca0cb285a7b1b07941bb7f8b76b' and '1cd30c296ded07d184132924faf0a31cd4b6b4f9' have entirely different histories.

@ -42,7 +42,9 @@ Future main() async {
options.tracesSampleRate = 1.0;
options.reportPackages = false;
Sentry.configureScope(
setSentryScope,
(scope) => scope.setUser(
SentryUser(username: Platform.environment['USER']),
),
);
},
appRunner: () => runApp(const MyApp()),
@ -114,7 +116,9 @@ class _MyHomePageState extends State<MyHomePage> {
}
Sentry.captureMessage(
'Found ${result.length} codes.',
withScope: setSentryScope,
withScope: (scope) {
SentryUser(username: Platform.environment['USER']);
},
);
Future.delayed(const Duration(seconds: 3), () {
if (status == Status.notFound) {

@ -1,7 +1,4 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:zbar_scan_plugin/zbar_scan_plugin.dart';
import 'package:collection/collection.dart';
import 'dart:math';
@ -35,20 +32,5 @@ CenterAndSize getCenterAndSizeOfPoints(List<PointInfo> points) {
center: center,
size: size * 1.2,
);
}
setSentryScope(Scope scope) {
var infoLines = File('/etc/os-release').readAsStringSync().split('\n').where((line) => line.contains('='));
Map<String, dynamic> data = {};
for (var info in infoLines) {
var parts = info.split('=');
data['OS_${parts.first}'] = parts.sublist(1).join('=');
}
return scope.setUser(
SentryUser(
id: File('/etc/machine-id').readAsStringSync(),
username: Platform.environment['USER'],
data: data,
),
);
}

Loading…
Cancel
Save