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.

87 lines
2.3 KiB

3 years ago
import 'package:flutter/material.dart';
class CustomLoginButton extends StatelessWidget {
final Widget child;
final double width;
final double height;
final Function? onPressed;
final String? icon;
final Color? color;
3 years ago
const CustomLoginButton({
Key? key,
required this.child,
3 years ago
this.width = double.infinity,
this.height = 50.0,
this.onPressed,
this.icon,
this.color,
}) : 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(
color: color,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
boxShadow: [
BoxShadow(
color: Colors.grey,
offset: Offset(0.0, 1.5),
blurRadius: 1.5,
),
],
),
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(25.0),
),
),
color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0),
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
border: Border.all(
color: Colors.grey,
width: 0.5,
),
),
child: InkWell(
onTap: onPressed as void Function()?,
3 years ago
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Image(
image: AssetImage(icon!),
3 years ago
height: 20,
),
child
],
)),
),
),
),
);
}
}