Implemented settings, new scan, enhanced UI/UX

This commit is contained in:
Dennis Nemec
2025-11-04 16:52:39 +01:00
parent b19a6e1cd4
commit 7ea9108f62
79 changed files with 3306 additions and 566 deletions

View File

@ -1,3 +1,8 @@
import 'package:hl_lieferservice/exceptions.dart';
import 'package:hl_lieferservice/feature/authentication/bloc/auth_state.dart';
import 'package:hl_lieferservice/feature/authentication/exceptions.dart';
import 'package:hl_lieferservice/main.dart';
import 'package:hl_lieferservice/services/erpframe.dart';
import 'package:intl/intl.dart';
import 'model/delivery.dart';
@ -58,3 +63,24 @@ String getName(DeliveryState state) {
return "ausgeliefert";
}
}
Map<String, String> getSessionOrThrow() {
if (locator.isRegistered<Authenticated>()) {
return {"Cookie": "session_id=${locator.get<Authenticated>().sessionId}"};
} else {
throw UserUnauthorized();
}
}
LocalDocuFrameConfiguration getConfig() {
if (locator.isRegistered<LocalDocuFrameConfiguration>()) {
return locator.get<LocalDocuFrameConfiguration>();
} else {
throw AppConfigNotFound();
}
}
Uri urlBuilder(String path) {
LocalDocuFrameConfiguration config = getConfig();
return Uri.parse("${config.backendUrl}/v1/execute/$path");
}