Add card meta data

This commit is contained in:
Hillel Coren 2020-08-16 18:54:45 +03:00
parent adfec83ee3
commit 2ec6dfbee9
18 changed files with 32 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,22 @@
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/data/models/gateway_token_model.dart';
class TokenMeta extends StatelessWidget {
const TokenMeta({this.meta});
final GatewayTokenMetaEntity meta;
@override
Widget build(BuildContext context) {
return Row(
children: [
Image.asset(
'assets/images/payment_types/${meta.brand}.png',
height: 16,
),
SizedBox(width: 8),
Text('•••• ${meta.last4} ${meta.expMonth}/${meta.expYear}'),
],
);
}
}

View File

@ -14,6 +14,7 @@ import 'package:invoiceninja_flutter/redux/task/task_selectors.dart';
import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart'; import 'package:invoiceninja_flutter/ui/app/FieldGrid.dart';
import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart'; import 'package:invoiceninja_flutter/ui/app/entities/entity_list_tile.dart';
import 'package:invoiceninja_flutter/ui/app/entity_header.dart'; import 'package:invoiceninja_flutter/ui/app/entity_header.dart';
import 'package:invoiceninja_flutter/ui/app/gateways/token_meta.dart';
import 'package:invoiceninja_flutter/ui/app/icon_message.dart'; import 'package:invoiceninja_flutter/ui/app/icon_message.dart';
import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart'; import 'package:invoiceninja_flutter/ui/app/lists/list_divider.dart';
import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart'; import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart';
@ -129,7 +130,14 @@ class ClientOverview extends StatelessWidget {
ListTile( ListTile(
title: Text( title: Text(
'${localization.token} ${gatewayMap[customerReference].gateway.name}'), '${localization.token} ${gatewayMap[customerReference].gateway.name}'),
subtitle: Text(customerReference), subtitle: Column(
mainAxisSize: MainAxisSize.min,
children: tokenMap[customerReference]
.map((token) => TokenMeta(
meta: token.meta,
))
.toList(),
),
onTap: linkMap.containsKey(customerReference) onTap: linkMap.containsKey(customerReference)
? () => launch(linkMap[customerReference]) ? () => launch(linkMap[customerReference])
: null, : null,

View File

@ -68,6 +68,7 @@ flutter:
assets: assets:
- assets/images/logo.png - assets/images/logo.png
- assets/images/google-icon.png - assets/images/google-icon.png
- assets/images/payment_types/
fonts: fonts:
- family: Roboto - family: Roboto