Skip to content
Snippets Groups Projects
Commit 0a3e968a authored by Maximilian Betz's avatar Maximilian Betz
Browse files

some more exception handling#

parent 0045f696
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,7 @@ class _MyHomePageState extends State<Configuration> {
HapticFeedback.vibrate();
//TODO: display success user feedback
//TODO: store complete "configuration"
} catch (e) {
throw Exception('Something went wrong try again');
}
......
......@@ -13,7 +13,7 @@ class Overview extends StatelessWidget {
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
child: const Text('Add Event', style: TextStyle(fontSize: 22)),
child: const Text('Add Event', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/second');
},
......@@ -22,7 +22,7 @@ class Overview extends StatelessWidget {
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
child: const Text('View and Sync', style: TextStyle(fontSize: 22)),
child: const Text('View & Sync', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/third');
},
......@@ -31,7 +31,7 @@ class Overview extends StatelessWidget {
const SizedBox(height: 10),
Expanded(
child: ElevatedButton(
child: const Text('Configuration', style: TextStyle(fontSize: 22)),
child: const Text('Configuration', style: TextStyle(fontSize: 36)),
onPressed: () {
Navigator.pushNamed(context, '/forth');
},
......
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'datamodel.dart';
import 'package:http/http.dart' as http;
......@@ -57,6 +58,9 @@ class _ViewEvents extends State<ViewEvents> {
}
_sync_status = 'export success';
}
} on SocketException catch (e) {
_sync_status = 'No connection';
setState(() {});
} catch (e) {
debugPrint('Exception: $e');
_sync_status = '$e';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment