-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
counter.dart
45 lines (43 loc) · 1.08 KB
/
counter.dart
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
import 'package:shop/constants/app_color.dart';
import 'package:shop/constants/size.dart';
import 'package:flutter/material.dart';
class CounterButton extends StatelessWidget {
const CounterButton({
Key? key,
this.text,
this.icon,
this.press,
}) : super(key: key);
final String? text;
final IconData? icon;
final VoidCallback? press;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: press,
child: Container(
height: getScreenHeight(25),
width: getScreeWidth(25),
margin: EdgeInsets.only(right: 8),
alignment: Alignment.center,
decoration: BoxDecoration(
color: text != null ? Colors.white : kPrimary,
borderRadius: BorderRadius.circular(4),
border: Border.all(
width: 1.0,
color: kAppIcon,
),
),
child: text != null
? Text(
text!,
)
: Icon(
icon,
size: 15,
color: Colors.white,
),
),
);
}
}