1
0
forked from firka/firka

feat: add borderColor to firka card

This commit is contained in:
checkedear
2026-04-25 16:58:33 +02:00
parent 39d4f49e99
commit c19dd2f7eb

View File

@@ -6,8 +6,9 @@ import 'package:firka_common/ui/theme/style.dart';
enum Attach { none, bottom, top } enum Attach { none, bottom, top }
class FirkaCard extends StatelessWidget { class FirkaCard extends StatelessWidget {
final EdgeInsetsGeometry padding; final EdgeInsets padding;
final EdgeInsetsGeometry margin; final EdgeInsets margin;
final Color? borderColor;
final double? height; final double? height;
final double? width; final double? width;
final bool shadow; final bool shadow;
@@ -18,8 +19,8 @@ class FirkaCard extends StatelessWidget {
factory FirkaCard({ factory FirkaCard({
required List<Widget> left, required List<Widget> left,
EdgeInsetsGeometry padding = const EdgeInsets.all(12), EdgeInsets padding = const EdgeInsets.all(12),
EdgeInsetsGeometry margin = const EdgeInsets.all(4), EdgeInsets margin = const EdgeInsets.all(4),
bool shadow = true, bool shadow = true,
List<Widget> center = const [], List<Widget> center = const [],
List<Widget> right = const [], List<Widget> right = const [],
@@ -61,6 +62,7 @@ class FirkaCard extends StatelessWidget {
this.margin = const EdgeInsets.all(4), this.margin = const EdgeInsets.all(4),
this.shadow = true, this.shadow = true,
this.attached = Attach.none, this.attached = Attach.none,
this.borderColor,
this.color, this.color,
this.height, this.height,
this.width, this.width,
@@ -91,6 +93,9 @@ class FirkaCard extends StatelessWidget {
] ]
: [], : [],
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: borderColor == null
? BorderSide.none
: BorderSide(color: borderColor!),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular( top: Radius.circular(
attached == Attach.top ? attachedRounding : defaultRounding, attached == Attach.top ? attachedRounding : defaultRounding,