Updated onboarding, reformatted files, improved referenced documents view, updated error handling

This commit is contained in:
Anton Stubenbord
2022-11-03 22:15:36 +01:00
parent 2f2312d5f3
commit 40133b6e0e
117 changed files with 1788 additions and 1021 deletions

View File

@@ -17,12 +17,15 @@ class ConnectivityStatusServiceImpl implements ConnectivityStatusService {
@override
Stream<bool> connectivityChanges() {
return connectivity.onConnectivityChanged.map(_hasActiveInternetConnection).asBroadcastStream();
return connectivity.onConnectivityChanged
.map(_hasActiveInternetConnection)
.asBroadcastStream();
}
@override
Future<bool> isConnectedToInternet() async {
return _hasActiveInternetConnection(await (Connectivity().checkConnectivity()));
return _hasActiveInternetConnection(
await (Connectivity().checkConnectivity()));
}
@override

View File

@@ -13,8 +13,8 @@ import 'package:injectable/injectable.dart';
import 'package:web_socket_channel/io.dart';
abstract class StatusService {
Future<void> startListeningBeforeDocumentUpload(
String httpUrl, AuthenticationInformation credentials, String documentFileName);
Future<void> startListeningBeforeDocumentUpload(String httpUrl,
AuthenticationInformation credentials, String documentFileName);
}
@Singleton(as: StatusService)
@@ -86,9 +86,11 @@ class LongPollingStatusService implements StatusService {
do {
final response = await httpClient.get(
Uri.parse('$httpUrl/api/documents/?query=$documentFileName added:${formatDate(today)}'),
Uri.parse(
'$httpUrl/api/documents/?query=$documentFileName added:${formatDate(today)}'),
);
final data = PagedSearchResult.fromJson(jsonDecode(response.body), DocumentModel.fromJson);
final data = PagedSearchResult.fromJson(
jsonDecode(response.body), DocumentModel.fromJson);
if (data.count > 0) {
consumptionFinished = true;
final docId = data.results[0].id;