feat(pagination): 공통 컨트롤 도입과 사용자 관리 가이드 추가
- 테이블 푸터에서 SuperportPaginationControls를 사용하도록 각 관리 페이지 페이지네이션 로직을 정리 - SuperportPaginationControls 위젯을 추가하고 SuperportTable 푸터를 개선해 페이지 사이즈 선택과 이동 버튼을 분리 - 사용자 등록·계정 관리 요구사항을 문서화한 doc/user_setting.md를 작성하고 AGENTS.md 코멘트 규칙을 업데이트 - flutter analyze를 수행해 빌드 경고가 없음을 확인
This commit is contained in:
@@ -645,10 +645,10 @@ class _InboundPageState extends State<InboundPage> {
|
||||
return records;
|
||||
}
|
||||
|
||||
List<String> _buildRecordRow(InboundRecord record) {
|
||||
List<String> _buildRecordRow(InboundRecord record, int displayIndex) {
|
||||
final primaryItem = record.items.isNotEmpty ? record.items.first : null;
|
||||
return [
|
||||
record.number.split('-').last,
|
||||
displayIndex.toString(),
|
||||
_dateFormatter.format(record.processedAt),
|
||||
record.warehouse,
|
||||
record.transactionNumber,
|
||||
@@ -670,13 +670,15 @@ class _InboundPageState extends State<InboundPage> {
|
||||
DeviceBreakpoint breakpoint,
|
||||
) {
|
||||
final visibleColumns = _visibleColumnsFor(breakpoint);
|
||||
final baseOffset = _rowNumberOffset(records.length);
|
||||
return ShadTable.list(
|
||||
header: [
|
||||
for (final index in visibleColumns)
|
||||
ShadTableCell.header(child: Text(InboundTableSpec.headers[index])),
|
||||
],
|
||||
children: [
|
||||
for (final record in records) _buildTableCells(record, visibleColumns),
|
||||
for (var i = 0; i < records.length; i++)
|
||||
_buildTableCells(records[i], visibleColumns, baseOffset + i + 1),
|
||||
],
|
||||
columnSpanExtent: (index) =>
|
||||
const FixedTableSpanExtent(InboundTableSpec.columnSpanWidth),
|
||||
@@ -718,8 +720,9 @@ class _InboundPageState extends State<InboundPage> {
|
||||
List<ShadTableCell> _buildTableCells(
|
||||
InboundRecord record,
|
||||
List<int> visibleColumns,
|
||||
int displayIndex,
|
||||
) {
|
||||
final values = _buildRecordRow(record);
|
||||
final values = _buildRecordRow(record, displayIndex);
|
||||
return [
|
||||
for (final index in visibleColumns)
|
||||
ShadTableCell(
|
||||
@@ -728,6 +731,16 @@ class _InboundPageState extends State<InboundPage> {
|
||||
];
|
||||
}
|
||||
|
||||
int _rowNumberOffset(int currentCount) {
|
||||
final page = _result?.page ?? _currentPage;
|
||||
final pageSize = _result?.pageSize ?? _pageSize;
|
||||
final safePage = page > 0 ? page : 1;
|
||||
final safePageSize = pageSize > 0
|
||||
? pageSize
|
||||
: (currentCount > 0 ? currentCount : 1);
|
||||
return (safePage - 1) * safePageSize;
|
||||
}
|
||||
|
||||
Future<void> _showDetailDialog(InboundRecord record) async {
|
||||
await showInventoryTransactionDetailDialog<void>(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user