From 55fe0ea9db8b9c17c0082c614051632fec1e5051 Mon Sep 17 00:00:00 2001 From: Maximilian Betz <Maximilian.Betz@awi.de> Date: Thu, 31 Mar 2022 16:54:12 +0200 Subject: [PATCH] cleanup --- lib/configuration.dart | 9 +++------ lib/viewevents.dart | 7 +------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/configuration.dart b/lib/configuration.dart index 9b9b006..d8a5458 100644 --- a/lib/configuration.dart +++ b/lib/configuration.dart @@ -83,7 +83,8 @@ class _MyHomePageState extends State<Configuration> { await configuration.storeToSharedPrefs(); debugPrint('Configuration stored!'); - + _status = 'Login success & configuration stored'; + setState(() {}); } on SocketException catch (e) { debugPrint('Exception: $e'); @@ -94,10 +95,6 @@ class _MyHomePageState extends State<Configuration> { _status = '$e'; setState(() {}); } - - _status = 'Success. Login valid, configuration stored'; - setState(() {}); - return; } Future<void> fetchInitData() async { @@ -278,6 +275,6 @@ class _MyHomePageState extends State<Configuration> { } //TODO: write configuration on app dispose! - +//TODO: display mission internet connection properly. //TODO: grey out update button if nothing has changed. ? \ No newline at end of file diff --git a/lib/viewevents.dart b/lib/viewevents.dart index 59fb283..19dcc8e 100644 --- a/lib/viewevents.dart +++ b/lib/viewevents.dart @@ -23,11 +23,6 @@ class _ViewEvents extends State<ViewEvents> { localEvents = await database.getEvents(); int pendingEventCnt = await database.getPendingEventCnt(); - debugPrint("Database Events: "); - for (var event in localEvents){ - debugPrint(event.toString()); - } - _syncStatus = pendingEventCnt.toString() + ' event(s) pending'; setState(() {}); //Got events from database, so update UI } @@ -67,7 +62,7 @@ class _ViewEvents extends State<ViewEvents> { 'put success, remaining events: ' + syncCounter.toString()); event.status = 'EXPORTED'; //Update event to export only once database.updateEvent(event); //Update Event as exported in SQL Database - fetchEventsFromDb(); //update view list //TODO: this is bad for the sync performance! Consider working with localevent list for the UI! + fetchEventsFromDb(); //update view list //TODO: this is bad for the sync performance! setState(() {}); } else { throw Exception('Sync for ' + event.urn + 'failed'); -- GitLab