diff --git a/uni/lib/view/common_widgets/generic_expansion_card.dart b/uni/lib/view/common_widgets/generic_expansion_card.dart index 072737f91..68f106ffb 100644 --- a/uni/lib/view/common_widgets/generic_expansion_card.dart +++ b/uni/lib/view/common_widgets/generic_expansion_card.dart @@ -1,25 +1,19 @@ -import 'package:flutter/material.dart'; import 'package:expansion_tile_card/expansion_tile_card.dart'; +import 'package:flutter/material.dart'; /// Card with a expansible child -abstract class GenericExpansionCard extends StatefulWidget { +abstract class GenericExpansionCard extends StatelessWidget { const GenericExpansionCard({Key? key}) : super(key: key); - @override - State createState() { - return GenericExpansionCardState(); - } - TextStyle? getTitleStyle(BuildContext context) => Theme.of(context) .textTheme .headlineSmall ?.apply(color: Theme.of(context).primaryColor); String getTitle(); + Widget buildCardContent(BuildContext context); -} -class GenericExpansionCardState extends State { @override Widget build(BuildContext context) { return Container( @@ -31,12 +25,12 @@ class GenericExpansionCardState extends State { expandedColor: (Theme.of(context).brightness == Brightness.light) ? const Color.fromARGB(0xf, 0, 0, 0) : const Color.fromARGB(255, 43, 43, 43), - title: Text(widget.getTitle(), style: widget.getTitleStyle(context)), + title: Text(getTitle(), style: getTitleStyle(context)), elevation: 0, children: [ Container( padding: const EdgeInsets.fromLTRB(12, 0, 12, 12), - child: widget.buildCardContent(context), + child: buildCardContent(context), ) ], ));