|
|
|
|
@ -80,8 +80,7 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
|
|
|
|
|
return widget.initialValue!.any((init) {
|
|
|
|
|
// Try Lookup-specific comparison first (id/value)
|
|
|
|
|
if (element is Lookup && init is Lookup) {
|
|
|
|
|
return (element.id != null && element.id == init.id) ||
|
|
|
|
|
(element.value != null && element.value == init.value);
|
|
|
|
|
return (element.id != null && element.id == init.id) || (element.value != null && element.value == init.value);
|
|
|
|
|
}
|
|
|
|
|
// Fallback to identifier comparison
|
|
|
|
|
if (element.identifier != null && init.identifier != null) {
|
|
|
|
|
@ -124,8 +123,7 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
|
|
|
|
|
return widget.initialValue!.any((init) {
|
|
|
|
|
// Try Lookup-specific comparison first (id/value)
|
|
|
|
|
if (element is Lookup && init is Lookup) {
|
|
|
|
|
return (element.id != null && element.id == init.id) ||
|
|
|
|
|
(element.value != null && element.value == init.value);
|
|
|
|
|
return (element.id != null && element.id == init.id) || (element.value != null && element.value == init.value);
|
|
|
|
|
}
|
|
|
|
|
// Fallback to identifier comparison
|
|
|
|
|
if (element.identifier != null && init.identifier != null) {
|
|
|
|
|
@ -166,8 +164,7 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
|
|
|
|
|
final hasMatch = oldWidget.initialValue.any((old) {
|
|
|
|
|
// Try Lookup-specific comparison first (id/value)
|
|
|
|
|
if (old is Lookup && current is Lookup) {
|
|
|
|
|
return (old.id != null && old.id == current.id) ||
|
|
|
|
|
(old.value != null && old.value == current.value);
|
|
|
|
|
return (old.id != null && old.id == current.id) || (old.value != null && old.value == current.value);
|
|
|
|
|
}
|
|
|
|
|
// Fallback to identifier comparison
|
|
|
|
|
if (old.identifier != null && current.identifier != null) {
|
|
|
|
|
@ -189,15 +186,11 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
|
|
|
|
|
final isEmpty = (X == NullableLoadingProvider ? widget.staticData : provider?.items)?.isEmpty ?? true;
|
|
|
|
|
|
|
|
|
|
// Determine the actual loading state - respect explicit loading prop and enabled state
|
|
|
|
|
final bool isActuallyLoading = widget.enabled
|
|
|
|
|
? (widget.loading ?? ((X == NullableLoadingProvider) ? false : provider?.loading ?? false))
|
|
|
|
|
: false; // Never show loading when disabled
|
|
|
|
|
final bool isActuallyLoading = widget.enabled ? (widget.loading ?? ((X == NullableLoadingProvider) ? false : provider?.loading ?? false)) : false; // Never show loading when disabled
|
|
|
|
|
|
|
|
|
|
// Provide a valid stateCode when disabled to prevent AppLoadingManager from auto-fetching
|
|
|
|
|
// When enabled, use the provider's actual stateCode
|
|
|
|
|
final int? effectiveStateCode = widget.enabled
|
|
|
|
|
? ((X == NullableLoadingProvider) ? 200 : provider?.stateCode)
|
|
|
|
|
: 200; // Return 200 when disabled to indicate "loaded" state (prevents auto-fetch)
|
|
|
|
|
final int? effectiveStateCode = widget.enabled ? ((X == NullableLoadingProvider) ? 200 : provider?.stateCode) : 200; // Return 200 when disabled to indicate "loaded" state (prevents auto-fetch)
|
|
|
|
|
|
|
|
|
|
return AppLoadingManager(
|
|
|
|
|
isLoading: isActuallyLoading,
|
|
|
|
|
@ -240,7 +233,7 @@ class _MultipleItemDropDownMenuState<T extends Base, X extends LoadingListNotifi
|
|
|
|
|
if (_selectedItem.isEmpty)
|
|
|
|
|
Text(
|
|
|
|
|
context.translation.select,
|
|
|
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: AppColor.textStyleColor(context)),
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Wrap(
|
|
|
|
|
|