53 lines
1.2 KiB
Dart
53 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'app_card.dart';
|
|
|
|
/// Card shell for list pages: toolbar, divider, full-width table body, footer.
|
|
class AppTableShell extends StatelessWidget {
|
|
const AppTableShell({
|
|
super.key,
|
|
required this.toolbar,
|
|
required this.child,
|
|
this.footer,
|
|
});
|
|
|
|
final Widget toolbar;
|
|
final Widget child;
|
|
final Widget? footer;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
|
|
return AppCard(
|
|
enableHover: false,
|
|
clipBehavior: Clip.none,
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
side: BorderSide(
|
|
color: theme.colorScheme.outline.withValues(alpha: 0.12),
|
|
),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: toolbar,
|
|
),
|
|
const Divider(height: 1),
|
|
Expanded(child: child),
|
|
if (footer != null) ...[
|
|
const Divider(height: 1),
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: footer!,
|
|
),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|