feat: add payment card grouping and analysis
This commit is contained in:
41
lib/utils/payment_card_utils.dart
Normal file
41
lib/utils/payment_card_utils.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 결제수단 관련 공통 유틸리티
|
||||
class PaymentCardUtils {
|
||||
static const List<String> colorPalette = [
|
||||
'#FF6B6B',
|
||||
'#F97316',
|
||||
'#F59E0B',
|
||||
'#10B981',
|
||||
'#06B6D4',
|
||||
'#3B82F6',
|
||||
'#6366F1',
|
||||
'#8B5CF6',
|
||||
'#EC4899',
|
||||
'#14B8A6',
|
||||
'#0EA5E9',
|
||||
'#94A3B8',
|
||||
];
|
||||
|
||||
static const Map<String, IconData> iconMap = {
|
||||
'credit_card': Icons.credit_card_rounded,
|
||||
'payments': Icons.payments_rounded,
|
||||
'wallet': Icons.account_balance_wallet_rounded,
|
||||
'bank': Icons.account_balance_rounded,
|
||||
'shopping': Icons.shopping_bag_rounded,
|
||||
'subscriptions': Icons.subscriptions_rounded,
|
||||
'bolt': Icons.bolt_rounded,
|
||||
};
|
||||
|
||||
static IconData iconForName(String name) {
|
||||
return iconMap[name] ?? Icons.credit_card_rounded;
|
||||
}
|
||||
|
||||
static Color colorFromHex(String hex) {
|
||||
var value = hex.replaceAll('#', '');
|
||||
if (value.length == 6) {
|
||||
value = 'ff$value';
|
||||
}
|
||||
return Color(int.parse(value, radix: 16));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user