You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

3 years ago
import 'package:flutter/material.dart';
class RaisedGradientButton extends StatelessWidget {
final Widget child;
final Gradient? gradient;
3 years ago
final double width;
final double height;
final Function? onPressed;
3 years ago
const RaisedGradientButton({
Key? key,
required this.child,
3 years ago
this.gradient,
this.width = double.infinity,
this.height = 50.0,
this.onPressed,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
child: Container(
width: width,
height: 40.0,
decoration: BoxDecoration(gradient: gradient, boxShadow: [
BoxShadow(
color: Colors.grey[500]!,
3 years ago
offset: Offset(0.0, 1.5),
blurRadius: 1.5,
),
]),
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(25.0),
),
),
color: Colors.transparent,
child: InkWell(
onTap: onPressed as void Function()?,
3 years ago
child: Center(
child: child,
)),
),
),
);
}
}