Fladder/lib/screens/settings/widgets/settings_list_group.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

43 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import 'package:dynamic_color/dynamic_color.dart';
List<Widget> settingsListGroup(BuildContext context, Widget label, List<Widget> children) {
final radius = BorderRadius.circular(24);
final radiusSmall = const Radius.circular(6);
final color = Theme.of(context).colorScheme.surfaceContainerLow.harmonizeWith(Colors.red);
return [
Card(
elevation: 0,
margin: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
color: color,
shape: RoundedRectangleBorder(
borderRadius: radius.copyWith(
bottomLeft: radiusSmall,
bottomRight: radiusSmall,
),
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: label,
),
),
...children.map(
(e) {
return Card(
elevation: 0,
color: color,
margin: const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
shape: RoundedRectangleBorder(
borderRadius: radius.copyWith(
topLeft: radiusSmall,
topRight: radiusSmall,
bottomLeft: e != children.last ? radiusSmall : null,
bottomRight: e != children.last ? radiusSmall : null,
)),
child: e,
);
},
)
];
}