diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/api.dart b/lib/api.dart index 8a3676d..46c7e7b 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -4,6 +4,7 @@ import 'package:gql/language.dart' as gqlLang; import 'package:gql_dio_link/gql_dio_link.dart'; import 'package:gql_exec/gql_exec.dart'; import "package:gql_link/gql_link.dart"; +import 'package:sentry/sentry.dart' as sentry; // Configure node const graphqlEndpoint = "https://g1.librelois.fr/gva"; @@ -26,8 +27,12 @@ Future buildQ(query) async { try { client = dio.Dio(); print(client); - } catch (e) { + } catch (e, stack) { print(e); + await sentry.Sentry.captureException( + e, + stackTrace: stack, + ); } // final client = dio.Dio(); Link link; @@ -43,8 +48,12 @@ Future buildQ(query) async { )) .first; return res; - } catch (e) { + } catch (e, stack) { print("Erreur: Noeud injoingnable."); + await sentry.Sentry.captureException( + e, + stackTrace: stack, + ); return 2; } } diff --git a/lib/main.dart b/lib/main.dart index 1c8186f..038ebe5 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,9 +10,16 @@ import 'package:intl/intl.dart'; // import 'package:flutter_html_view'; import 'api.dart'; import "package:dio/dio.dart"; +import 'package:sentry_flutter/sentry_flutter.dart'; -void main() { - runApp(MyApp()); +Future main() async { + await SentryFlutter.init( + (options) { + options.dsn = + 'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110'; + }, + appRunner: () => runApp(MyApp()), + ); } class MyApp extends StatefulWidget { diff --git a/pubspec.lock b/pubspec.lock index 6fb8806..6addfba 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -109,6 +109,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" gql: dependency: transitive description: @@ -200,6 +205,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0-nullsafety.3" + package_info: + dependency: transitive + description: + name: package_info + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.3+2" path: dependency: transitive description: @@ -249,6 +261,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.21" + sentry: + dependency: transitive + description: + name: sentry + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + sentry_flutter: + dependency: "direct main" + description: + name: sentry_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" sky_engine: dependency: transitive description: flutter @@ -303,6 +329,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0-nullsafety.3" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" vector_math: dependency: transitive description: @@ -326,4 +359,4 @@ packages: version: "2.2.1" sdks: dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.12.13+hotfix.5 <2.0.0" + flutter: ">=1.17.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index a6fc6c1..e6c659d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.0.0+3 +version: 0.0.0+4 environment: sdk: ">=2.7.0 <3.0.0" @@ -33,6 +33,7 @@ dependencies: gql_link: intl: flutter_launcher_icons: "^0.8.0" + sentry_flutter: ^4.0.1 flutter_icons: android: "launcher_icon"