mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-07 20:07:48 -06:00
41 lines
1.0 KiB
Dart
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],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|