계정 정보 다이얼로그 추가 및 전체 목록 페치 개선
This commit is contained in:
@@ -276,9 +276,15 @@ class _PaginationFooter extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ShadTheme.of(context);
|
||||
final currentPage = pagination.currentPage.clamp(1, pagination.totalPages);
|
||||
final int totalPages =
|
||||
pagination.totalPages <= 0 ? 1 : pagination.totalPages;
|
||||
final int currentPage = pagination.currentPage < 1
|
||||
? 1
|
||||
: (pagination.currentPage > totalPages
|
||||
? totalPages
|
||||
: pagination.currentPage);
|
||||
final canGoPrev = currentPage > 1 && !isLoading;
|
||||
final canGoNext = currentPage < pagination.totalPages && !isLoading;
|
||||
final canGoNext = currentPage < totalPages && !isLoading;
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -306,10 +312,16 @@ class _PaginationFooter extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'${pagination.totalItems}건 · 페이지 $currentPage / ${pagination.totalPages}',
|
||||
'${pagination.totalItems}건 · 페이지 $currentPage / $totalPages',
|
||||
style: theme.textTheme.small,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
ShadButton.ghost(
|
||||
size: ShadButtonSize.sm,
|
||||
onPressed: canGoPrev ? () => onPageChange?.call(1) : null,
|
||||
child: const Icon(lucide.LucideIcons.chevronsLeft, size: 16),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ShadButton.ghost(
|
||||
size: ShadButtonSize.sm,
|
||||
onPressed: canGoPrev
|
||||
@@ -325,6 +337,13 @@ class _PaginationFooter extends StatelessWidget {
|
||||
: null,
|
||||
child: const Icon(lucide.LucideIcons.chevronRight, size: 16),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ShadButton.ghost(
|
||||
size: ShadButtonSize.sm,
|
||||
onPressed:
|
||||
canGoNext ? () => onPageChange?.call(totalPages) : null,
|
||||
child: const Icon(lucide.LucideIcons.chevronsRight, size: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user