mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 18:07:44 +00:00
55 lines
1.4 KiB
Dart
55 lines
1.4 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
import 'package:cake_wallet/palette.dart';
|
||
|
|
||
|
class ActionButton extends StatelessWidget{
|
||
|
ActionButton({
|
||
|
@required this.image,
|
||
|
@required this.title,
|
||
|
@required this.route,
|
||
|
this.alignment = Alignment.center
|
||
|
});
|
||
|
|
||
|
final Image image;
|
||
|
final String title;
|
||
|
final String route;
|
||
|
final Alignment alignment;
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return Container(
|
||
|
width: double.infinity,
|
||
|
height: 93,
|
||
|
alignment: alignment,
|
||
|
child: Column(
|
||
|
mainAxisSize: MainAxisSize.max,
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
children: <Widget>[
|
||
|
GestureDetector(
|
||
|
onTap: () {
|
||
|
if (route.isNotEmpty) {
|
||
|
Navigator.of(context, rootNavigator: true).pushNamed(route);
|
||
|
}
|
||
|
},
|
||
|
child: Container(
|
||
|
height: 60,
|
||
|
width: 60,
|
||
|
alignment: Alignment.center,
|
||
|
decoration: BoxDecoration(
|
||
|
color: PaletteDark.nightBlue,
|
||
|
shape: BoxShape.circle),
|
||
|
child: image,
|
||
|
),
|
||
|
),
|
||
|
Text(
|
||
|
title,
|
||
|
style: TextStyle(
|
||
|
fontSize: 14,
|
||
|
color: Colors.white
|
||
|
),
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|