Files
paperless-mobile/lib/features/landing/view/widgets/expansion_card.dart
Anton Stubenbord 8e5eb5a6c6 Update Landing page
2023-08-01 21:58:20 +02:00

41 lines
1.0 KiB
Dart

import 'package:flutter/material.dart';
class ExpansionCard extends StatelessWidget {
final Widget title;
final Widget content;
final bool initiallyExpanded;
const ExpansionCard({
super.key,
required this.title,
required this.content,
this.initiallyExpanded = false,
});
@override
Widget build(BuildContext context) {
return Card(
margin: const EdgeInsets.all(16),
child: Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
expansionTileTheme: ExpansionTileThemeData(
shape: Theme.of(context).cardTheme.shape,
collapsedShape: Theme.of(context).cardTheme.shape,
),
listTileTheme: ListTileThemeData(
shape: Theme.of(context).cardTheme.shape,
),
),
child: ExpansionTile(
backgroundColor: Theme.of(context).colorScheme.surface,
initiallyExpanded: initiallyExpanded,
title: title,
children: [content],
),
),
);
}
}