feat(pagination): 공통 컨트롤 도입과 사용자 관리 가이드 추가
- 테이블 푸터에서 SuperportPaginationControls를 사용하도록 각 관리 페이지 페이지네이션 로직을 정리 - SuperportPaginationControls 위젯을 추가하고 SuperportTable 푸터를 개선해 페이지 사이즈 선택과 이동 버튼을 분리 - 사용자 등록·계정 관리 요구사항을 문서화한 doc/user_setting.md를 작성하고 AGENTS.md 코멘트 규칙을 업데이트 - flutter analyze를 수행해 빌드 경고가 없음을 확인
This commit is contained in:
@@ -574,39 +574,46 @@ class _OutboundPageState extends State<OutboundPage> {
|
||||
style: theme.textTheme.muted,
|
||||
),
|
||||
)
|
||||
: ShadTable.list(
|
||||
header: OutboundTableSpec.headers
|
||||
.map(
|
||||
(header) =>
|
||||
ShadTableCell.header(child: Text(header)),
|
||||
)
|
||||
.toList(),
|
||||
children: [
|
||||
for (final row in visibleRecords.map(
|
||||
_buildRecordRow,
|
||||
))
|
||||
[
|
||||
for (final value in row)
|
||||
ShadTableCell(
|
||||
child: Text(
|
||||
value,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
: () {
|
||||
final baseOffset = _rowNumberOffset(
|
||||
visibleRecords.length,
|
||||
);
|
||||
return ShadTable.list(
|
||||
header: OutboundTableSpec.headers
|
||||
.map(
|
||||
(header) =>
|
||||
ShadTableCell.header(child: Text(header)),
|
||||
)
|
||||
.toList(),
|
||||
children: [
|
||||
for (var i = 0; i < visibleRecords.length; i++)
|
||||
[
|
||||
for (final value in _buildRecordRow(
|
||||
visibleRecords[i],
|
||||
baseOffset + i + 1,
|
||||
))
|
||||
ShadTableCell(
|
||||
child: Text(
|
||||
value,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
columnSpanExtent: (index) =>
|
||||
const FixedTableSpanExtent(
|
||||
OutboundTableSpec.columnSpanWidth,
|
||||
),
|
||||
rowSpanExtent: (index) => const FixedTableSpanExtent(
|
||||
OutboundTableSpec.rowSpanHeight,
|
||||
),
|
||||
onRowTap: (rowIndex) {
|
||||
final record = visibleRecords[rowIndex];
|
||||
_selectRecord(record, openDetail: true);
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
columnSpanExtent: (index) =>
|
||||
const FixedTableSpanExtent(
|
||||
OutboundTableSpec.columnSpanWidth,
|
||||
),
|
||||
rowSpanExtent: (index) =>
|
||||
const FixedTableSpanExtent(
|
||||
OutboundTableSpec.rowSpanHeight,
|
||||
),
|
||||
onRowTap: (rowIndex) {
|
||||
final record = visibleRecords[rowIndex];
|
||||
_selectRecord(record, openDetail: true);
|
||||
},
|
||||
);
|
||||
}(),
|
||||
),
|
||||
if (filtered.isNotEmpty) ...[
|
||||
const SizedBox(height: 12),
|
||||
@@ -787,10 +794,10 @@ class _OutboundPageState extends State<OutboundPage> {
|
||||
}
|
||||
}
|
||||
|
||||
List<String> _buildRecordRow(OutboundRecord record) {
|
||||
List<String> _buildRecordRow(OutboundRecord 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,
|
||||
@@ -808,6 +815,16 @@ class _OutboundPageState extends State<OutboundPage> {
|
||||
];
|
||||
}
|
||||
|
||||
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(OutboundRecord record) async {
|
||||
await showInventoryTransactionDetailDialog<void>(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user