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;
|
Color? textColor;
|
final double fontSize;
|
final GestureTapCallback? onClick;
|
final EdgeInsets? padding;
|
|
MyOutlineButton(this.text, this.radius,
|
{GestureTapCallback? this.onClick,
|
Color this.color = ColorConstant.theme,
|
Color? textColor,
|
double this.height = 26,
|
double this.fontSize = 12,
|
double? this.width = null,
|
EdgeInsets? this.padding = null}) {
|
textColor ??= this.color;
|
}
|
|
@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: textColor, 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,
|
),
|
)),
|
);
|
}
|
}
|