Added custom tour ordering
This commit is contained in:
@ -14,6 +14,8 @@
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
997C0E4FB7B2C67AB8388B3F /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB0CFA44E0F4A317CC3E8B41 /* Pods_RunnerTests.framework */; };
|
||||
CAFC9CC8D4DE6A37AF21BCD7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F2499FC75E94DB5A00A1507 /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -40,14 +42,20 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0F2499FC75E94DB5A00A1507 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
20C61E69ACC59657689C39B0 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
2504B6EAF74460EDFF2C3034 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
2F591058654CE4129294673B /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
6E068ED7E85C34D749C5FEEC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
85C723A0EDD97FFF5B2BD758 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -55,13 +63,24 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F632AF4257FECE6E4D6B8524 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
FB0CFA44E0F4A317CC3E8B41 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
8C070AF792EDA6C56B543C6F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
997C0E4FB7B2C67AB8388B3F /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CAFC9CC8D4DE6A37AF21BCD7 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -76,6 +95,15 @@
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7A92659C1D86874FFAC72EDC /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0F2499FC75E94DB5A00A1507 /* Pods_Runner.framework */,
|
||||
FB0CFA44E0F4A317CC3E8B41 /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -94,6 +122,8 @@
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||
ED39057CEE7CA15DEFF8D2EE /* Pods */,
|
||||
7A92659C1D86874FFAC72EDC /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -121,6 +151,19 @@
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ED39057CEE7CA15DEFF8D2EE /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85C723A0EDD97FFF5B2BD758 /* Pods-Runner.debug.xcconfig */,
|
||||
6E068ED7E85C34D749C5FEEC /* Pods-Runner.release.xcconfig */,
|
||||
20C61E69ACC59657689C39B0 /* Pods-Runner.profile.xcconfig */,
|
||||
2F591058654CE4129294673B /* Pods-RunnerTests.debug.xcconfig */,
|
||||
F632AF4257FECE6E4D6B8524 /* Pods-RunnerTests.release.xcconfig */,
|
||||
2504B6EAF74460EDFF2C3034 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@ -128,8 +171,10 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
2682F75C0133161F95975778 /* [CP] Check Pods Manifest.lock */,
|
||||
331C807D294A63A400263BE5 /* Sources */,
|
||||
331C807F294A63A400263BE5 /* Resources */,
|
||||
8C070AF792EDA6C56B543C6F /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -145,12 +190,14 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
4C53ED7C58784643594B286A /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
174761F3B03AFDA6621CD1D2 /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -222,6 +269,45 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
174761F3B03AFDA6621CD1D2 /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
2682F75C0133161F95975778 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@ -238,6 +324,28 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
4C53ED7C58784643594B286A /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@ -365,6 +473,7 @@
|
||||
DEVELOPMENT_TEAM = 37Z4ZA4QU2;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@ -379,6 +488,7 @@
|
||||
};
|
||||
331C8088294A63A400263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 2F591058654CE4129294673B /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -396,6 +506,7 @@
|
||||
};
|
||||
331C8089294A63A400263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = F632AF4257FECE6E4D6B8524 /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -411,6 +522,7 @@
|
||||
};
|
||||
331C808A294A63A400263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 2504B6EAF74460EDFF2C3034 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -545,6 +657,7 @@
|
||||
DEVELOPMENT_TEAM = 37Z4ZA4QU2;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
@ -568,6 +681,7 @@
|
||||
DEVELOPMENT_TEAM = 37Z4ZA4QU2;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.business";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
||||
3
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
3
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
@ -4,4 +4,7 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@ -60,7 +60,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
|
||||
debugPrint("🔵 Opening browser to: http://localhost:3000/login");
|
||||
|
||||
final loginUrl = Uri.parse('http://192.168.1.9:3000/login');
|
||||
final loginUrl = Uri.parse('http://100.72.100.33:3000/login');
|
||||
final launched = await launchUrl(
|
||||
loginUrl,
|
||||
mode: LaunchMode.externalApplication,
|
||||
|
||||
@ -56,7 +56,7 @@ class _CarManagementPageState extends State<CarManagementPage> {
|
||||
return Scaffold(
|
||||
body: BlocConsumer<CarsBloc, CarsState>(
|
||||
listener: (context, state) {
|
||||
if (state is CarsLoaded) {
|
||||
if (state is CarsLoaded && context.read<TourBloc>().state is TourLoaded) {
|
||||
var tour = (context.read<TourBloc>().state as TourLoaded).tour.copyWith();
|
||||
tour.driver.cars = state.cars;
|
||||
context.read<TourBloc>().add(UpdateTour(tour: tour));
|
||||
|
||||
@ -4,6 +4,8 @@ import 'package:hl_lieferservice/dto/discount_add_response.dart';
|
||||
import 'package:hl_lieferservice/dto/discount_update_response.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/bloc/delivery_event.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/bloc/delivery_state.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/bloc/note_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/bloc/note_event.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/repository/delivery_repository.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/detail/repository/note_repository.dart';
|
||||
import 'package:hl_lieferservice/widget/operations/bloc/operation_bloc.dart';
|
||||
@ -15,6 +17,7 @@ import '../../../../model/delivery.dart' as model;
|
||||
|
||||
class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
OperationBloc opBloc;
|
||||
NoteBloc noteBloc;
|
||||
DeliveryRepository repository;
|
||||
NoteRepository noteRepository;
|
||||
|
||||
@ -22,6 +25,7 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
required this.opBloc,
|
||||
required this.repository,
|
||||
required this.noteRepository,
|
||||
required this.noteBloc
|
||||
}) : super(DeliveryInitial()) {
|
||||
on<UnscanArticleEvent>(_unscan);
|
||||
on<ResetScanAmountEvent>(_resetAmount);
|
||||
@ -34,10 +38,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
on<FinishDeliveryEvent>(_finishDelivery);
|
||||
}
|
||||
|
||||
void _finishDelivery(
|
||||
FinishDeliveryEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) async {
|
||||
void _finishDelivery(FinishDeliveryEvent event,
|
||||
Emitter<DeliveryState> emit,) async {
|
||||
final currentState = state;
|
||||
opBloc.add(LoadOperation());
|
||||
|
||||
@ -70,10 +72,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _updatePayment(
|
||||
UpdateSelectedPaymentMethodEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) {
|
||||
void _updatePayment(UpdateSelectedPaymentMethodEvent event,
|
||||
Emitter<DeliveryState> emit,) {
|
||||
final currentState = state;
|
||||
|
||||
if (currentState is DeliveryLoaded) {
|
||||
@ -85,10 +85,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _updateDeliveryOptions(
|
||||
UpdateDeliveryOptionEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) {
|
||||
void _updateDeliveryOptions(UpdateDeliveryOptionEvent event,
|
||||
Emitter<DeliveryState> emit,) {
|
||||
final currentState = state;
|
||||
|
||||
if (currentState is DeliveryLoaded) {
|
||||
@ -113,10 +111,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _updateDiscount(
|
||||
UpdateDiscountEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) async {
|
||||
void _updateDiscount(UpdateDiscountEvent event,
|
||||
Emitter<DeliveryState> emit,) async {
|
||||
opBloc.add(LoadOperation());
|
||||
|
||||
try {
|
||||
@ -165,7 +161,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
} catch (e, st) {
|
||||
debugPrint(
|
||||
"Fehler beim Hinzufügen eins Discounts zur Lieferung: ${event.deliveryId}:",
|
||||
"Fehler beim Hinzufügen eins Discounts zur Lieferung: ${event
|
||||
.deliveryId}:",
|
||||
);
|
||||
debugPrint("$e");
|
||||
debugPrint("$st");
|
||||
@ -176,10 +173,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _removeDiscount(
|
||||
RemoveDiscountEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) async {
|
||||
void _removeDiscount(RemoveDiscountEvent event,
|
||||
Emitter<DeliveryState> emit,) async {
|
||||
opBloc.add(LoadOperation());
|
||||
|
||||
try {
|
||||
@ -245,6 +240,10 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
noteId: response.values.note.rowId,
|
||||
);
|
||||
|
||||
noteBloc.add(AddNoteOffline(note: response.values.note.noteDescription,
|
||||
deliveryId: delivery.id,
|
||||
noteId: response.values.note.rowId));
|
||||
|
||||
delivery.articles = [...delivery.articles, delivery.discount!.article];
|
||||
|
||||
emit(currentState.copyWith(delivery));
|
||||
@ -253,7 +252,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
} catch (e, st) {
|
||||
debugPrint(
|
||||
"Fehler beim Hinzufügen eins Discounts zur Lieferung: ${event.deliveryId}:",
|
||||
"Fehler beim Hinzufügen eins Discounts zur Lieferung: ${event
|
||||
.deliveryId}:",
|
||||
);
|
||||
debugPrint("$e");
|
||||
debugPrint("$st");
|
||||
@ -313,10 +313,8 @@ class DeliveryBloc extends Bloc<DeliveryEvent, DeliveryState> {
|
||||
}
|
||||
}
|
||||
|
||||
void _resetAmount(
|
||||
ResetScanAmountEvent event,
|
||||
Emitter<DeliveryState> emit,
|
||||
) async {
|
||||
void _resetAmount(ResetScanAmountEvent event,
|
||||
Emitter<DeliveryState> emit,) async {
|
||||
opBloc.add(LoadOperation());
|
||||
|
||||
try {
|
||||
|
||||
@ -23,16 +23,44 @@ class NoteBloc extends Bloc<NoteEvent, NoteState> {
|
||||
on<AddImageNote>(_upload);
|
||||
on<RemoveImageNote>(_removeImage);
|
||||
on<ResetNotes>(_reset);
|
||||
on<AddNoteOffline>(_addOffline);
|
||||
}
|
||||
|
||||
Future<void> _reset(ResetNotes event, Emitter<NoteState> emit) async {
|
||||
emit.call(NoteInitial());
|
||||
}
|
||||
|
||||
Future<void> _removeImage(
|
||||
RemoveImageNote event,
|
||||
Emitter<NoteState> emit,
|
||||
) async {
|
||||
Future<void> _addOffline(AddNoteOffline event,
|
||||
Emitter<NoteState> emit,) async {
|
||||
if (state is NoteInitial) {
|
||||
emit(
|
||||
NoteLoadedBase(
|
||||
notes: [Note(content: event.note, id: int.parse(event.noteId))],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (state is NoteLoadedBase) {
|
||||
emit(
|
||||
NoteLoadedBase(
|
||||
notes: [
|
||||
...(state as NoteLoadedBase).notes,
|
||||
Note(content: event.note, id: int.parse(event.noteId)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
if (state is NoteLoaded) {
|
||||
final current = state as NoteLoaded;
|
||||
emit(NoteLoaded(notes: [...current.notes, Note(content: event.note, id: int.parse(event.noteId))],
|
||||
templates: [...current.templates],
|
||||
images: [...current.images]));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _removeImage(RemoveImageNote event,
|
||||
Emitter<NoteState> emit,) async {
|
||||
opBloc.add(LoadOperation());
|
||||
|
||||
try {
|
||||
|
||||
@ -18,6 +18,14 @@ class AddNote extends NoteEvent {
|
||||
final String deliveryId;
|
||||
}
|
||||
|
||||
class AddNoteOffline extends NoteEvent {
|
||||
AddNoteOffline({required this.note, required this.deliveryId, required this.noteId});
|
||||
|
||||
final String note;
|
||||
final String noteId;
|
||||
final String deliveryId;
|
||||
}
|
||||
|
||||
class RemoveNote extends NoteEvent {
|
||||
RemoveNote({required this.noteId});
|
||||
|
||||
|
||||
@ -10,14 +10,21 @@ class NoteLoading extends NoteState {}
|
||||
|
||||
class NoteLoadingFailed extends NoteState {}
|
||||
|
||||
class NoteLoaded extends NoteState {
|
||||
NoteLoaded({
|
||||
class NoteLoadedBase extends NoteState {
|
||||
NoteLoadedBase({
|
||||
required this.notes,
|
||||
required this.templates,
|
||||
required this.images,
|
||||
});
|
||||
|
||||
List<Note> notes;
|
||||
}
|
||||
|
||||
class NoteLoaded extends NoteLoadedBase {
|
||||
NoteLoaded({
|
||||
required this.templates,
|
||||
required this.images,
|
||||
required super.notes,
|
||||
});
|
||||
|
||||
List<NoteTemplate> templates;
|
||||
List<(ImageNote, Uint8List)> images;
|
||||
|
||||
|
||||
@ -48,11 +48,29 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
bool _customerAccepted = false;
|
||||
bool _noteAccepted = false;
|
||||
bool _notesEmpty = true;
|
||||
bool _isCustomerSignatureEmpty = true;
|
||||
bool _isDriverSignatureEmpty = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
_customerController.addListener(() {
|
||||
if (_isCustomerSignatureEmpty != _customerController.isEmpty) {
|
||||
setState(() {
|
||||
_isCustomerSignatureEmpty = _customerController.isEmpty;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
_driverController.addListener(() {
|
||||
if (_isDriverSignatureEmpty != _driverController.isEmpty) {
|
||||
setState(() {
|
||||
_isDriverSignatureEmpty = _driverController.isEmpty;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// only load notes if they are not already loaded
|
||||
final noteState = context.read<NoteBloc>().state;
|
||||
if (noteState is NoteInitial) {
|
||||
@ -63,6 +81,7 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
@override
|
||||
void dispose() {
|
||||
_customerController.dispose();
|
||||
_driverController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@ -92,12 +111,18 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
_notesEmpty = current.notes.isEmpty;
|
||||
});
|
||||
}
|
||||
|
||||
if (current is NoteLoadedBase) {
|
||||
setState(() {
|
||||
_notesEmpty = current.notes.isEmpty;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
builder: (context, state) {
|
||||
final current = state;
|
||||
|
||||
if (current is NoteLoaded) {
|
||||
if (current is NoteLoadedBase) {
|
||||
if (current.notes.isEmpty) {
|
||||
return const SizedBox(
|
||||
width: double.infinity,
|
||||
@ -107,12 +132,12 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.event_note_outlined),
|
||||
title: Text(current.notes[index].content),
|
||||
contentPadding: EdgeInsets.all(20),
|
||||
contentPadding: const EdgeInsets.all(20),
|
||||
tileColor: Theme.of(context).colorScheme.onSecondary,
|
||||
);
|
||||
},
|
||||
@ -121,7 +146,7 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
);
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
return const SizedBox(
|
||||
width: double.infinity,
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
@ -156,12 +181,19 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Flexible(
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
onTap: _notesEmpty ? null : () {
|
||||
setState(() {
|
||||
_noteAccepted = !_noteAccepted;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"Ich nehme die oben genannten Anmerkungen zur Lieferung zur Kenntnis.",
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -177,11 +209,18 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Flexible(
|
||||
Flexible(
|
||||
child: InkWell(
|
||||
child: Text(
|
||||
"Ich bestätige, dass ich die Ware im ordnungsgemäßen Zustand erhalten habe und, dass die Aufstell- und Einbauarbeiten korrekt durchgeführt wurden.",
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_customerAccepted = !_customerAccepted;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -195,6 +234,16 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
Widget build(BuildContext context) {
|
||||
String formattedDate = DateFormat("dd.MM.yyyy").format(DateTime.now());
|
||||
|
||||
bool isButtonEnabled;
|
||||
if (!_isDriverSigning) {
|
||||
isButtonEnabled =
|
||||
_customerAccepted &&
|
||||
(_noteAccepted || _notesEmpty) &&
|
||||
!_isCustomerSignatureEmpty;
|
||||
} else {
|
||||
isButtonEnabled = !_isDriverSignatureEmpty;
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title:
|
||||
@ -247,9 +296,8 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
child: Center(
|
||||
child: FilledButton(
|
||||
onPressed:
|
||||
!(_customerAccepted && (_noteAccepted || _notesEmpty))
|
||||
? null
|
||||
: () async {
|
||||
isButtonEnabled
|
||||
? () async {
|
||||
if (!_isDriverSigning) {
|
||||
setState(() {
|
||||
_isDriverSigning = true;
|
||||
@ -260,7 +308,8 @@ class _SignatureViewState extends State<SignatureView> {
|
||||
(await _driverController.toPngBytes())!,
|
||||
);
|
||||
}
|
||||
},
|
||||
}
|
||||
: null,
|
||||
child:
|
||||
!_isDriverSigning
|
||||
? const Text("Weiter")
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:hl_lieferservice/feature/delivery/overview/bloc/tour_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/bloc/tour_event.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/presentation/delivery_info.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/presentation/delivery_list.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/presentation/delivery_overview_custom_sort.dart';
|
||||
import 'package:hl_lieferservice/model/tour.dart';
|
||||
|
||||
import '../../../../model/delivery.dart';
|
||||
@ -11,7 +12,11 @@ import '../../../authentication/bloc/auth_bloc.dart';
|
||||
import '../../../authentication/bloc/auth_state.dart';
|
||||
|
||||
class DeliveryOverview extends StatefulWidget {
|
||||
const DeliveryOverview({super.key, required this.tour, required this.distances});
|
||||
const DeliveryOverview({
|
||||
super.key,
|
||||
required this.tour,
|
||||
required this.distances,
|
||||
});
|
||||
|
||||
final Tour tour;
|
||||
final Map<String, double> distances;
|
||||
@ -44,9 +49,7 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
}
|
||||
|
||||
Future<void> _loadTour() async {
|
||||
Authenticated state = context
|
||||
.read<AuthBloc>()
|
||||
.state as Authenticated;
|
||||
Authenticated state = context.read<AuthBloc>().state as Authenticated;
|
||||
context.read<TourBloc>().add(LoadTour(teamId: state.user.number));
|
||||
}
|
||||
|
||||
@ -59,23 +62,13 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
children:
|
||||
widget.tour.driver.cars.map((car) {
|
||||
Color? backgroundColor;
|
||||
Color? iconColor = Theme
|
||||
.of(context)
|
||||
.primaryColor;
|
||||
Color? iconColor = Theme.of(context).primaryColor;
|
||||
Color? textColor;
|
||||
|
||||
if (_selectedCarId == car.id) {
|
||||
backgroundColor = Theme
|
||||
.of(context)
|
||||
.primaryColor;
|
||||
textColor = Theme
|
||||
.of(context)
|
||||
.colorScheme
|
||||
.onSecondary;
|
||||
iconColor = Theme
|
||||
.of(context)
|
||||
.colorScheme
|
||||
.onSecondary;
|
||||
backgroundColor = Theme.of(context).primaryColor;
|
||||
textColor = Theme.of(context).colorScheme.onSecondary;
|
||||
iconColor = Theme.of(context).colorScheme.onSecondary;
|
||||
}
|
||||
|
||||
return Padding(
|
||||
@ -108,7 +101,6 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RefreshIndicator(
|
||||
@ -118,7 +110,12 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
children: [
|
||||
DeliveryInfo(tour: widget.tour),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10,
|
||||
right: 10,
|
||||
top: 15,
|
||||
bottom: 10,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -126,10 +123,7 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
children: [
|
||||
Text(
|
||||
"Fahrten",
|
||||
style: Theme
|
||||
.of(context)
|
||||
.textTheme
|
||||
.headlineSmall,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -147,9 +141,22 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
_deliveries = _deliveries.reversed.toList();
|
||||
});
|
||||
}
|
||||
|
||||
if (value == "custom") {
|
||||
showDialog(
|
||||
context: context,
|
||||
fullscreenDialog: true,
|
||||
builder: (context) => CustomSortDialog(),
|
||||
);
|
||||
}
|
||||
|
||||
if (value == "distance") {
|
||||
// TODO: muss noch implementiert werden
|
||||
}
|
||||
});
|
||||
},
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||
itemBuilder:
|
||||
(BuildContext context) => <PopupMenuEntry<String>>[
|
||||
PopupMenuItem<String>(
|
||||
value: 'name-asc',
|
||||
child: Text('Name (A-Z)'),
|
||||
@ -162,10 +169,13 @@ class _DeliveryOverviewState extends State<DeliveryOverview> {
|
||||
value: 'distance',
|
||||
child: Text('Entfernung'),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
value: 'custom',
|
||||
child: Text('Eigene Sortierung'),
|
||||
),
|
||||
],
|
||||
child: Icon(Icons.filter_list),
|
||||
)
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -0,0 +1,113 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/bloc/tour_bloc.dart';
|
||||
import 'package:hl_lieferservice/feature/delivery/overview/bloc/tour_state.dart';
|
||||
|
||||
class CustomSortDialog extends StatefulWidget {
|
||||
const CustomSortDialog({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _CustomSortDialogState();
|
||||
}
|
||||
|
||||
class _CustomSortDialogState extends State<CustomSortDialog> {
|
||||
Widget _information() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(top: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Icon(Icons.info_outline, color: Colors.blueAccent),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Ziehen Sie die einzelnen Lieferungen mit dem Finger in die gewünschte Position.",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(),
|
||||
_sortableList(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _sortableList() {
|
||||
return BlocBuilder<TourBloc, TourState>(
|
||||
builder: (context, state) {
|
||||
final currentState = state;
|
||||
|
||||
if (currentState is TourLoaded) {
|
||||
return Expanded(
|
||||
child: ReorderableListView(
|
||||
onReorder: (oldIndex, newIndex) {},
|
||||
children: currentState.tour.deliveries.indexed.fold([], (
|
||||
acc,
|
||||
current,
|
||||
) {
|
||||
final delivery = current.$2;
|
||||
final index = current.$1;
|
||||
|
||||
acc.add(
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Theme.of(context).primaryColor,
|
||||
child: Text(
|
||||
"${index + 1}",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
title: Text(delivery.customer.name),
|
||||
subtitle: Text(delivery.customer.address.toString(), style: TextStyle(fontSize: 11),),
|
||||
trailing: Icon(Icons.drag_handle),
|
||||
key: Key("reorder-item-${delivery.id}"),
|
||||
),
|
||||
);
|
||||
return acc;
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Center(child: CircularProgressIndicator());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Dialog(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 10, top: 15),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Fahrten sortieren",
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Expanded(child: _information()),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -20,7 +20,12 @@ class _DeliveryOverviewPageState extends State<DeliveryOverviewPage> {
|
||||
if (state is TourLoaded) {
|
||||
final currentState = state;
|
||||
|
||||
return Center(child: DeliveryOverview(tour: currentState.tour, distances: currentState.distances));
|
||||
return Center(
|
||||
child: DeliveryOverview(
|
||||
tour: currentState.tour,
|
||||
distances: currentState.distances,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Container();
|
||||
|
||||
@ -71,6 +71,7 @@ class _DeliveryAppState extends State<DeliveryApp> {
|
||||
BlocProvider(
|
||||
create:
|
||||
(context) => DeliveryBloc(
|
||||
noteBloc: context.read<NoteBloc>(),
|
||||
opBloc: context.read<OperationBloc>(),
|
||||
noteRepository: NoteRepository(
|
||||
service: NoteService(
|
||||
|
||||
Reference in New Issue
Block a user