From 244a0420297ff58e820753c77addec8ae4697cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20M=C3=BCller?= Date: Sun, 14 May 2023 19:01:18 +0200 Subject: [PATCH] Added custom error screen widget --- lib/main.dart | 5 +++++ pubspec.yaml | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 484bc51..d5f9382 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'package:flutter/services.dart'; import 'package:jiffy/jiffy.dart'; import 'package:marianum_mobile/data/timetable/timetableProps.dart'; import 'package:marianum_mobile/screen/login/login.dart'; +import 'package:marianum_mobile/widget/errorView.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -20,6 +21,10 @@ Future main() async { ByteData data = await PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem'); SecurityContext.defaultContext.setTrustedCertificatesBytes(data.buffer.asUint8List()); + ErrorWidget.builder = (error) { + return ErrorView(icon: Icons.phonelink_erase_rounded, text: error.toString()); + }; + runApp( MultiProvider( providers: [ diff --git a/pubspec.yaml b/pubspec.yaml index 48469ed..3457cea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,7 +107,6 @@ flutter: - assets/ca/ - assets/background/ - assets/logo/ - - assets/logo/icon - assets/img/ # An image asset can refer to one or more resolution-specific "variants", see