mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
Add ADIconButton
This commit is contained in:
34
packages/apidash_design_system/lib/widgets/button_icon.dart
Normal file
34
packages/apidash_design_system/lib/widgets/button_icon.dart
Normal file
@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ADIconButton extends StatelessWidget {
|
||||
const ADIconButton({
|
||||
super.key,
|
||||
required this.icon,
|
||||
this.iconSize,
|
||||
this.onPressed,
|
||||
this.color,
|
||||
this.visualDensity,
|
||||
this.tooltip,
|
||||
});
|
||||
|
||||
final IconData icon;
|
||||
final double? iconSize;
|
||||
final VoidCallback? onPressed;
|
||||
final Color? color;
|
||||
final VisualDensity? visualDensity;
|
||||
final String? tooltip;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
tooltip: tooltip,
|
||||
icon: Icon(
|
||||
icon,
|
||||
size: iconSize ?? 16,
|
||||
),
|
||||
color: color,
|
||||
visualDensity: visualDensity,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user