Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Created March 1, 2019 09:57
Show Gist options
  • Save nguyenvanduocit/75b70b089733799103774d0c800f6966 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/75b70b089733799103774d0c800f6966 to your computer and use it in GitHub Desktop.
class GradientButton extends StatelessWidget {
static const Color loginGradientStart = const Color(0xFFfbab66);
static const Color loginGradientEnd = const Color(0xFFf7418c);
static const LinearGradient primaryGradient = const LinearGradient(
colors: [loginGradientStart, loginGradientEnd],
stops: [0.0, 1.0],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 170.0),
decoration: new BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.0)),
boxShadow: <BoxShadow>[
BoxShadow(
color: loginGradientStart,
offset: Offset(1.0, 6.0),
blurRadius: 20.0,
),
BoxShadow(
color: loginGradientEnd,
offset: Offset(1.0, 6.0),
blurRadius: 20.0,
),
],
gradient: new LinearGradient(
colors: [loginGradientEnd, loginGradientStart],
begin: const FractionalOffset(0.2, 0.2),
end: const FractionalOffset(1.0, 1.0),
stops: [0.0, 1.0],
tileMode: TileMode.clamp),
),
child: MaterialButton(
highlightColor: Colors.transparent,
splashColor: loginGradientEnd,
//shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(5.0))),
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 42.0),
child: Text(
"LOGIN",
style: TextStyle(
color: Colors.white,
fontSize: 25.0,
fontFamily: "WorkSansBold"),
),
),
onPressed: () {}),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment