tik_icon_button.dart
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import 'package:flutter/material.dart';
class TikIconButton extends StatelessWidget {
const TikIconButton(
{Key? key,
this.borderColor,
this.borderRadius,
this.borderWidth,
this.buttonSize,
this.fillColor,
this.icon,
this.onPressed})
: super(key: key);
final double? borderRadius;
final double? buttonSize;
final Color? fillColor;
final Color? borderColor;
final double? borderWidth;
final Widget? icon;
final void Function()? onPressed;
@override
Widget build(BuildContext context) => Material(
borderRadius:
borderRadius != null ? BorderRadius.circular(borderRadius!) : null,
color: Colors.transparent,
clipBehavior: Clip.antiAlias,
child: Ink(
width: buttonSize,
height: buttonSize,
decoration: BoxDecoration(
color: fillColor,
border: Border.all(
color: borderColor ?? Colors.transparent,
width: borderWidth ?? 0,
),
borderRadius: borderRadius != null
? BorderRadius.circular(borderRadius!)
: null,
),
child: IconButton(
icon: icon!,
onPressed: onPressed,
splashRadius: buttonSize,
),
),
);
}