-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#346] refactor: CircularStatusIndicator 컴포넌트 추가
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
lib/presentation/common_components/circular_status_indicator.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
), | ||
), | ||
); | ||
} | ||
} |