UI nit picks

This commit is contained in:
xsahil03x
2020-11-20 17:55:55 +05:30
parent 389656a477
commit c384588d5b
4 changed files with 102 additions and 111 deletions
+13 -25
View File
@@ -1,50 +1,38 @@
import 'package:flutter/material.dart';
extension ColorUtils on Color {
Color mix(Color another, double amount) {
return Color.lerp(this, another, amount);
}
}
class NeumorphicButton extends StatelessWidget {
final Widget child;
final Color backgroundColor;
final EdgeInsets margin;
final EdgeInsets padding;
const NeumorphicButton({
Key key,
@required this.child,
this.backgroundColor = Colors.white,
this.margin = const EdgeInsets.all(8),
this.padding = const EdgeInsets.all(14),
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: child,
margin: margin,
padding: padding,
margin: EdgeInsets.all(8.0),
height: 40,
width: 40,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: backgroundColor,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
backgroundColor.mix(Colors.white, 0.2),
backgroundColor.mix(Colors.black, 0.1),
]),
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
blurRadius: 1,
color: backgroundColor.mix(Colors.white, 0.6),
color: Colors.grey[700],
offset: Offset(0, 1.0),
blurRadius: 0.5,
spreadRadius: 0,
),
BoxShadow(
blurRadius: 1,
color: backgroundColor.mix(Colors.black, 0.3),
)
color: Colors.white,
offset: Offset.zero,
blurRadius: 0.5,
spreadRadius: 0,
),
],
),
);