-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathmyflatButton.dart
More file actions
35 lines (30 loc) · 885 Bytes
/
myflatButton.dart
File metadata and controls
35 lines (30 loc) · 885 Bytes
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
import 'package:flutter/material.dart';
class MyFlatButton extends StatelessWidget {
String text;
Widget widget;
MyFlatButton(String text, Widget widget) {
this.text = text;
this.widget = widget;
}
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: FlatButton(
padding: EdgeInsets.all(15.0),
onPressed: () async {
Navigator.of(context)
.push(MaterialPageRoute(builder: (context) => widget));
},
child: Text(
text,
style:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold,letterSpacing: 1,fontSize: 16),
),
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.green, width: 3.0),
borderRadius: BorderRadius.circular(10.0)),
),
);
}
}