Fladder/lib/widgets/shared/alert_content.dart
PartyDonut e7b5bb40ff
feat: UI 2.0 and other Improvements (#357)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
2025-06-01 10:37:19 +02:00

48 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
class ActionContent extends StatelessWidget {
final Widget? title;
final Widget child;
final List<Widget> actions;
final bool showDividers;
final EdgeInsetsGeometry? padding;
const ActionContent({
this.title,
required this.child,
this.padding,
this.showDividers = true,
this.actions = const [],
super.key,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: padding ?? MediaQuery.paddingOf(context).add(const EdgeInsets.symmetric(horizontal: 16)),
child: Column(
mainAxisSize: MainAxisSize.min,
spacing: 16,
children: [
if (title != null) ...[
title!,
if (showDividers)
const Divider(
height: 4,
),
],
Expanded(child: child),
if (actions.isNotEmpty) ...[
if (showDividers)
const Divider(
height: 4,
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: actions,
)
],
],
),
);
}
}