From c872a8f7600e5aaa88933cae2e8fc85151c144ab Mon Sep 17 00:00:00 2001 From: sm-amoled Date: Mon, 23 Dec 2024 11:50:33 +0900 Subject: [PATCH] =?UTF-8?q?[#346]=20refactor:=20CircularStatusIndicator=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circular_status_indicator.dart | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/presentation/common_components/circular_status_indicator.dart diff --git a/lib/presentation/common_components/circular_status_indicator.dart b/lib/presentation/common_components/circular_status_indicator.dart new file mode 100644 index 0000000..aa0f8ab --- /dev/null +++ b/lib/presentation/common_components/circular_status_indicator.dart @@ -0,0 +1,49 @@ +import 'package:awesome_extensions/awesome_extensions.dart'; +import 'package:flutter/material.dart'; +import 'package:wehavit/common/constants/constants.dart'; +import 'package:wehavit/presentation/presentation.dart'; + +class CircularStatusIndicator extends StatelessWidget { + const CircularStatusIndicator({ + required this.isDone, + this.innerLabel = '', + this.pointColor = CustomColors.pointYellow, + super.key, + }); + + final bool isDone; + final String innerLabel; + final Color pointColor; + + @override + Widget build(BuildContext context) { + return Container( + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: isDone ? pointColor : Colors.transparent, + border: Border.all( + color: CustomColors.whBrightGrey, + width: isDone ? 0 : 1, + ), + ), + width: 25, + height: 25, + alignment: Alignment.center, + child: isDone + ? WHIcon( + size: WHIconsize.small, + iconString: WHIcons.checkMark, + iconColor: isDone ? CustomColors.whGrey900 : CustomColors.whGrey600, + ) + : Text( + innerLabel, + style: context.labelLarge?.copyWith( + color: isDone ? CustomColors.whGrey900 : CustomColors.whGrey600, + fontWeight: FontWeight.w400, + height: 0.8, + ), + ), + ); + } +}