Implemented settings, new scan, enhanced UI/UX
This commit is contained in:
@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user