-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrounded_button.dart
47 lines (41 loc) · 1.21 KB
/
rounded_button.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class RoundedButton extends StatelessWidget {
RoundedButton({this.title,this.color1,this.color2,@required this.onPressed}) ;
final String title;
final Color color1;
final Function onPressed;
final Color color2;
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 16.0),
child: Material(
shadowColor: Colors.white,
elevation: 15.0,
// color: color,
borderRadius: BorderRadius.circular(40.0),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
gradient: LinearGradient(
colors: [color1,color2],
)
),
child: MaterialButton(
//padding: EdgeInsets.only(left: 15,right: 15),
onPressed: onPressed,
minWidth: 200,
height: 42.0,
child: Text(
title,
style: TextStyle(
color: Colors.white,
),
),
),
),
),
);
}
}