mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
92 lines
3.5 KiB
Dart
92 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:cw_core/transaction_direction.dart';
|
|
|
|
class TransactionRow extends StatelessWidget {
|
|
TransactionRow(
|
|
{required this.direction,
|
|
required this.formattedDate,
|
|
required this.formattedAmount,
|
|
required this.formattedFiatAmount,
|
|
required this.isPending,
|
|
required this.title,
|
|
required this.onTap});
|
|
|
|
final VoidCallback onTap;
|
|
final TransactionDirection direction;
|
|
final String formattedDate;
|
|
final String formattedAmount;
|
|
final String formattedFiatAmount;
|
|
final bool isPending;
|
|
final String title;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
child: Container(
|
|
padding: EdgeInsets.fromLTRB(24, 8, 24, 8),
|
|
color: Colors.transparent,
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
height: 36,
|
|
width: 36,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: Theme.of(context).textTheme!.overline!.decorationColor!
|
|
),
|
|
child: Image.asset(
|
|
direction == TransactionDirection.incoming
|
|
? 'assets/images/down_arrow.png'
|
|
: 'assets/images/up_arrow.png'),
|
|
),
|
|
SizedBox(width: 12),
|
|
Expanded(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: <Widget>[
|
|
Text(title,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: Theme.of(context).accentTextTheme!
|
|
.headline2!.backgroundColor!)),
|
|
Text(formattedAmount,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
color: Theme.of(context).accentTextTheme!
|
|
.headline2!.backgroundColor!))
|
|
]),
|
|
SizedBox(height: 5),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: <Widget>[
|
|
Text(formattedDate,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Theme.of(context)
|
|
.textTheme!
|
|
.overline!
|
|
.backgroundColor!)),
|
|
Text(formattedFiatAmount,
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Theme.of(context)
|
|
.textTheme!
|
|
.overline!
|
|
.backgroundColor!))
|
|
])
|
|
],
|
|
)
|
|
)
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|