Prechádzať zdrojové kódy

Made ChipButton component

ashilkn 2 rokov pred
rodič
commit
62208bf93d

+ 38 - 0
lib/ui/components/buttons/chip_button_widget.dart

@@ -0,0 +1,38 @@
+import "package:flutter/material.dart";
+import "package:photos/theme/ente_theme.dart";
+
+class ChipButtonWidget extends StatelessWidget {
+  final String label;
+  final IconData? leadingIcon;
+  const ChipButtonWidget(
+    this.label, {
+    this.leadingIcon,
+    super.key,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    return Padding(
+      padding: const EdgeInsets.all(8.0),
+      child: Row(
+        mainAxisAlignment: MainAxisAlignment.center,
+        children: [
+          leadingIcon != null
+              ? Icon(
+                  leadingIcon,
+                  size: 17,
+                )
+              : const SizedBox.shrink(),
+          const SizedBox(width: 4),
+          Padding(
+            padding: const EdgeInsets.symmetric(horizontal: 4),
+            child: Text(
+              label,
+              style: getEnteTextTheme(context).smallBold,
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}