-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavigation_button.dart
More file actions
54 lines (49 loc) · 1.5 KB
/
navigation_button.dart
File metadata and controls
54 lines (49 loc) · 1.5 KB
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
48
49
50
51
52
53
54
import 'package:flutter/material.dart';
import 'package:streakers_journal_beta/screens/welcome_screen.dart';
class MgavNavigationButton extends StatelessWidget {
MgavNavigationButton({
this.textNameOfRoute,
//this.routeAsCode,
this.buttonIcon,
@required this.onPressedFunction,
});
final edgeInsets = 10.5;
final sizedBoxButtonDividerWidth = 14.0;
final buttonTextSize = 12.0;
final buttonCornerRadius = 9.0;
final gapBetweenButtonIconAndText = 4.0;
IconData buttonIcon = Icons.youtube_searched_for;
String textNameOfRoute = 'textNameOfRoute';
//final routeAsCode = 'TasksScreen()';
final Function onPressedFunction; // what happens when the button gets pressed
@override
Widget build(BuildContext context) {
return RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(buttonCornerRadius)),
onPressed: onPressedFunction,
color: Colors.white,
padding: EdgeInsets.all(edgeInsets),
child: Column(
// Replace with a Row for horizontal icon + text
children: <Widget>[
Icon(
buttonIcon,
color: Colors.lightBlueAccent,
),
SizedBox(
height: gapBetweenButtonIconAndText,
),
Text(
textNameOfRoute,
style: TextStyle(
color: Colors.lightBlueAccent,
fontWeight: FontWeight.bold,
fontSize: buttonTextSize,
),
)
],
),
);
}
}