Преглед на файлове

made IconButton component

ashilkn преди 2 години
родител
ревизия
db31aedb2e
променени са 1 файла, в които са добавени 35 реда и са изтрити 0 реда
  1. 35 0
      lib/ui/components/icon_button_widget.dart

+ 35 - 0
lib/ui/components/icon_button_widget.dart

@@ -0,0 +1,35 @@
+import 'package:flutter/material.dart';
+import 'package:photos/theme/ente_theme.dart';
+
+class IconButtonWidget extends StatelessWidget {
+  final bool isPrimary;
+  final bool isSecondary;
+  final bool isRounded;
+  final IconData icon;
+  const IconButtonWidget({
+    this.isPrimary = true,
+    this.isSecondary = false,
+    this.isRounded = false,
+    required this.icon,
+    super.key,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    final colorTheme = getEnteColorScheme(context);
+    return GestureDetector(
+      child: Container(
+        padding: const EdgeInsets.all(8),
+        height: 40,
+        width: 40,
+        decoration: BoxDecoration(
+          borderRadius: BorderRadius.circular(20),
+        ),
+        child: Icon(
+          Icons.close_outlined,
+          color: isSecondary ? colorTheme.strokeMuted : colorTheme.strokeBase,
+        ),
+      ),
+    );
+  }
+}