From 0e408063d46458beb2b216c994a5cf75a83b6e36 Mon Sep 17 00:00:00 2001 From: parkyuhyeon Date: Tue, 9 Jul 2024 08:41:58 +0900 Subject: [PATCH] =?UTF-8?q?:lipstick:=20::=20hashtag=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=EC=B6=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/hashtag.dart | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/components/hashtag.dart diff --git a/lib/components/hashtag.dart b/lib/components/hashtag.dart new file mode 100644 index 0000000..cf86ad8 --- /dev/null +++ b/lib/components/hashtag.dart @@ -0,0 +1,36 @@ +import 'package:flutter/material.dart'; +import 'package:grapper/utils/grapper_color.dart'; +import 'package:grapper/utils/grapper_font.dart'; + +class GrapperHashtag extends StatelessWidget { + const GrapperHashtag({ + super.key, + required this.text, + this.isSelected = false, + }); + final String text; + final bool isSelected; + + @override + Widget build(BuildContext context) { + return Container( + height: 30, + alignment: Alignment.center, + padding: isSelected + ? const EdgeInsets.symmetric(horizontal: 20) + : const EdgeInsets.all(0), + decoration: BoxDecoration( + color: isSelected ? GrapperColorRed.normal : Colors.black, + borderRadius: const BorderRadius.all( + Radius.circular(20), + ), + ), + child: GrapperText( + text: '#$text', + grapperFont: GrapperFonts.pretendard_500, + size: 17, + color: Colors.white, + ), + ); + } +}