admin
2022-01-20 d8ef9a783b9e0b2a495f02fdf3daaf27ef49e99d
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import 'dart:ui';
 
import 'package:flutter/material.dart';
import '../../utils/ui_constant.dart';
 
class MyOutlineButton extends StatelessWidget {
  final String text;
  final double radius;
  final double height;
  final double? width;
  final Color color;
  final double fontSize;
  final GestureTapCallback? onClick;
  final EdgeInsets? padding;
 
  MyOutlineButton(this.text, this.radius,
      {GestureTapCallback? this.onClick,
      Color this.color = ColorConstant.theme,
      double this.height = 26,
      double this.fontSize = 12,
      double? this.width = null,
      EdgeInsets? this.padding = null});
 
  @override
  Widget build(BuildContext context) {
    Container child = Container(
      alignment: Alignment.center,
      height: height,
      width: width,
      padding: padding,
      decoration: BoxDecoration(
        color: Colors.transparent,
        border: Border.all(color: color, width: 1),
        borderRadius: BorderRadius.circular(radius),
      ),
      child: Text(
        text,
        style: TextStyle(color: color, fontSize: fontSize),
      ),
    );
 
    return InkWell(
        onTap: () {
          onClick!();
        },
        child: child);
  }
}
 
class MyFillButton extends StatelessWidget {
  final String text;
  final Color textColor;
  final double radius;
  final double height;
  final double? width;
  final Color color;
  final double fontSize;
  final GestureTapCallback? onClick;
  final EdgeInsets? padding;
  final bool? enable;
 
  MyFillButton(this.text, this.radius,
      {GestureTapCallback? this.onClick,
      Color this.color = ColorConstant.theme,
      Color this.textColor = Colors.white,
      double this.height = 26,
      double this.fontSize = 12,
      double? this.width = null,
      EdgeInsets? this.padding = null,
      bool? this.enable = true});
 
  @override
  Widget build(BuildContext context) {
    Container child = Container(
      alignment: Alignment.center,
      height: height,
      width: width,
      padding: padding,
      decoration: BoxDecoration(
        color: enable! ? color : const Color(0xFFCBCBCB),
        borderRadius: BorderRadius.circular(radius),
      ),
      child: Text(
        text,
        style: TextStyle(color: textColor, fontSize: fontSize),
      ),
    );
 
    return InkWell(
        onTap: () {
          onClick!();
        },
        child: child);
  }
}
 
class RoundCheckBox extends StatefulWidget {
  var value = false;
 
  Function(bool) onChanged;
 
  RoundCheckBox({Key? key, required this.value, required this.onChanged})
      : super(key: key);
 
  @override
  _RoundCheckBoxState createState() => _RoundCheckBoxState();
}
 
class _RoundCheckBoxState extends State<RoundCheckBox> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: GestureDetector(
          onTap: () {
            widget.value = !widget.value;
            widget.onChanged(widget.value);
          },
          child: Padding(
            padding: const EdgeInsets.all(10.0),
            child: widget.value
                ? const Icon(
                    Icons.check_circle,
                    size: 19,
                    color: Colors.green,
                  )
                : const Icon(
                    Icons.panorama_fish_eye,
                    size: 19,
                    color: Colors.black12,
                  ),
          )),
    );
  }
}