mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 20:19:25 +00:00
987e6f21ee
* Redesigned bottom bar of main screen according Figma * used receiced_icon from figma instead of that present in asset/image folder * removed border colors for dark and light modes * removed fixed width and height
52 lines
No EOL
1.3 KiB
Dart
52 lines
No EOL
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ActionButton extends StatelessWidget {
|
|
ActionButton(
|
|
{@required this.image,
|
|
@required this.title,
|
|
this.route,
|
|
this.onClick,
|
|
this.alignment = Alignment.center});
|
|
|
|
final Image image;
|
|
final String title;
|
|
final String route;
|
|
final Alignment alignment;
|
|
final void Function() onClick;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
alignment: alignment,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: <Widget>[
|
|
GestureDetector(
|
|
onTap: () {
|
|
if (route?.isNotEmpty ?? false) {
|
|
Navigator.of(context, rootNavigator: true).pushNamed(route);
|
|
} else {
|
|
onClick?.call();
|
|
}
|
|
},
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle),
|
|
child: image,
|
|
),
|
|
),
|
|
SizedBox(height: 4),
|
|
Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: 10,
|
|
color: Theme.of(context).accentTextTheme.display3
|
|
.backgroundColor),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |