결재 템플릿 단계 적용 구현
- ApprovalTemplate 엔티티·DTO·원격 리포지토리 추가 - ApprovalController에 템플릿 로딩/적용 상태와 assignSteps 호출 연동 - ApprovalPage 단계 탭에 템플릿 선택 UI 및 적용 확인 다이얼로그 구현 - 템플릿 적용 단위 테스트와 IMPLEMENTATION_TASKS 현황 갱신
This commit is contained in:
58
lib/widgets/components/superport_table.dart
Normal file
58
lib/widgets/components/superport_table.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
/// ShadTable.list를 감싼 공통 테이블 래퍼.
|
||||
class SuperportTable extends StatelessWidget {
|
||||
const SuperportTable({
|
||||
super.key,
|
||||
required this.columns,
|
||||
required this.rows,
|
||||
this.columnSpanExtent,
|
||||
this.rowHeight = 56,
|
||||
this.onRowTap,
|
||||
this.emptyLabel = '데이터가 없습니다.',
|
||||
});
|
||||
|
||||
final List<Widget> columns;
|
||||
final List<List<Widget>> rows;
|
||||
final TableSpanExtent? Function(int index)? columnSpanExtent;
|
||||
final double rowHeight;
|
||||
final void Function(int index)? onRowTap;
|
||||
final String emptyLabel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (rows.isEmpty) {
|
||||
final theme = ShadTheme.of(context);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
child: Center(
|
||||
child: Text(emptyLabel, style: theme.textTheme.muted),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
final tableRows = [
|
||||
for (final row in rows)
|
||||
row
|
||||
.map(
|
||||
(cell) => cell is ShadTableCell ? cell : ShadTableCell(child: cell),
|
||||
)
|
||||
.toList(),
|
||||
];
|
||||
|
||||
return ShadTable.list(
|
||||
header: columns
|
||||
.map(
|
||||
(cell) => cell is ShadTableCell
|
||||
? cell
|
||||
: ShadTableCell.header(child: cell),
|
||||
)
|
||||
.toList(),
|
||||
columnSpanExtent: columnSpanExtent,
|
||||
rowSpanExtent: (_) => FixedTableSpanExtent(rowHeight),
|
||||
onRowTap: onRowTap,
|
||||
children: tableRows,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user