fix(inventory-ui): 필터·창고 선택 상호작용 정비
- 입고/출고/대여 상태·대여구분 드롭다운에 제네릭 타입을 명시해 null 허용 옵션에서도 SDK 경고를 제거\n- 입고 목록 include 라벨에 customers→'고객 포함'을 추가해 UI 설명을 통일\n- WarehouseSelectField가 선택된 라벨과 동일한 검색어일 때 전체 옵션을 복원하고 suggestions를 초기화하도록 로직을 보강\n- FilterBar의 필터 적용 배지를 윤곽 스타일로 교체하고 테마 색상 대비를 조정\n- DatePicker 버튼을 outline 버튼 자체에서 정렬/아이콘 슬롯으로 구성해 긴 날짜 라벨이 잘리지 않도록 개선\n- 필터 배지/날짜 버튼 UI 변경에 맞춰 인벤토리 요약 골든 이미지를 갱신\n- flutter analyze, flutter test로 회귀를 검증
This commit is contained in:
@@ -230,6 +230,19 @@ class _InventoryWarehouseSelectFieldState
|
||||
return;
|
||||
}
|
||||
final keyword = _controller.text.trim();
|
||||
final selectedLabel = _selectedLabel;
|
||||
final matchesSelectedLabel =
|
||||
selectedLabel != null && keyword == selectedLabel;
|
||||
if (matchesSelectedLabel) {
|
||||
_debounce?.cancel();
|
||||
setState(() {
|
||||
_isSearching = false;
|
||||
_suggestions
|
||||
..clear()
|
||||
..addAll(_availableOptions(_initialOptions));
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (keyword.isEmpty) {
|
||||
_debounce?.cancel();
|
||||
setState(() {
|
||||
@@ -328,6 +341,14 @@ class _InventoryWarehouseSelectFieldState
|
||||
return '${option.name} (${option.code})';
|
||||
}
|
||||
|
||||
String? get _selectedLabel {
|
||||
final selected = _selected;
|
||||
if (selected == null) {
|
||||
return null;
|
||||
}
|
||||
return selected.id == -1 ? widget.allLabel : _displayLabel(selected);
|
||||
}
|
||||
|
||||
Widget _buildLoadingInput() {
|
||||
return Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
@@ -363,11 +384,13 @@ class _InventoryWarehouseSelectFieldState
|
||||
textEditingController: _controller,
|
||||
focusNode: _focusNode,
|
||||
optionsBuilder: (textEditingValue) {
|
||||
if (textEditingValue.text.trim().isEmpty) {
|
||||
if (_suggestions.isEmpty) {
|
||||
return _availableOptions(_initialOptions);
|
||||
}
|
||||
return _suggestions;
|
||||
final keyword = textEditingValue.text.trim();
|
||||
final selectedLabel = _selectedLabel;
|
||||
final shouldShowAll =
|
||||
keyword.isEmpty ||
|
||||
(selectedLabel != null && keyword == selectedLabel);
|
||||
if (shouldShowAll) {
|
||||
return _availableOptions(_initialOptions);
|
||||
}
|
||||
return _suggestions;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user