Add Pixel eye logic. Can comparison with 2 image and monitor
This commit is contained in:
1 parent
da7cb5ea23
commit
e8bd345be6
22 files changed
+993
-73
No files matched your search
@@ -0,0 +1,71 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum ButtonType { primary, secondary }
|
||||
|
||||
class EasyButton extends StatelessWidget {
|
||||
const EasyButton({
|
||||
Key? key,
|
||||
required this.text,
|
||||
required this.onPressed,
|
||||
this.type = ButtonType.primary,
|
||||
this.padding,
|
||||
this.height = 48,
|
||||
this.minWidth = double.infinity,
|
||||
this.borderSide,
|
||||
this.textColor,
|
||||
this.color,
|
||||
this.fontWeight,
|
||||
this.borderRadius = 6,
|
||||
}) : super(key: key);
|
||||
|
||||
final String text;
|
||||
final VoidCallback? onPressed;
|
||||
final ButtonType type;
|
||||
final EdgeInsets? padding;
|
||||
final double height;
|
||||
final double minWidth;
|
||||
final BorderSide? borderSide;
|
||||
final Color? textColor;
|
||||
final Color? color;
|
||||
final FontWeight? fontWeight;
|
||||
final double borderRadius;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.transparent,
|
||||
padding: padding,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return Colors.grey.withOpacity(0.5);
|
||||
}
|
||||
return color ?? (type == ButtonType.secondary ? Colors.white : Colors.blue);
|
||||
}),
|
||||
foregroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
|
||||
if (states.contains(MaterialState.disabled)) {
|
||||
return Colors.grey.withOpacity(0.1);
|
||||
}
|
||||
return color ?? (type == ButtonType.secondary ? Colors.white : Colors.blue);
|
||||
}),
|
||||
minimumSize: MaterialStateProperty.all(Size(minWidth, height)),
|
||||
shape: MaterialStateProperty.all(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(borderRadius)),
|
||||
side: type == ButtonType.secondary ? borderSide ?? BorderSide(color: Colors.grey.withOpacity(0.9)) : BorderSide.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontWeight: fontWeight ?? FontWeight.normal,
|
||||
fontSize: 20,
|
||||
color: textColor ?? (type == ButtonType.secondary ? Colors.grey : Colors.white)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user