-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtagbutton.dart
More file actions
54 lines (50 loc) · 1.47 KB
/
tagbutton.dart
File metadata and controls
54 lines (50 loc) · 1.47 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
50
51
52
53
54
import 'package:eventzu/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class TagButton extends StatefulWidget {
TagButton({required this.tagname});
final String tagname;
@override
State<TagButton> createState() => _TagButtonState();
}
class _TagButtonState extends State<TagButton> {
@override
bool _enabled = false;
Color _tagcolor = Colors.transparent;
Color _tagnamecolor = kbuttonbackcolor;
Widget build(BuildContext context) {
return TextButton(
onPressed: () {
if (_enabled == false) {
setState(() {
_enabled = true;
_tagcolor = kbuttonbackcolor;
_tagnamecolor = kbackgroundcolor;
});
} else {
setState(() {
_enabled = false;
_tagcolor = Colors.transparent;
_tagnamecolor = kbuttonbackcolor;
});
}
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
border: Border.all(color: kbuttonbackcolor, width: 2.0),
color: _tagcolor,
),
child: Padding(
padding: const EdgeInsets.only(
top: 6.5, bottom: 6.5, left: 15.0, right: 15.0),
child: Text(
'${widget.tagname}',
style: TextStyle(
fontSize: 12.0, fontFamily: "sans-serif", color: _tagnamecolor),
),
),
),
);
}
}