feat:参照研听的基础工程

This commit is contained in:
jingyun
2026-06-18 15:02:28 +08:00
commit 364fc837b3
367 changed files with 16495 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
enum MetalType {
gold('gold', '黄金', '', Color(0xFFB5862A)),
platinum('platinum', '铂金', '', Color(0xFF7D8792)),
silver('silver', '白银', '', Color(0xFF9DA3AA));
const MetalType(this.id, this.label, this.shortLabel, this.color);
final String id;
final String label;
final String shortLabel;
final Color color;
}
+11
View File
@@ -0,0 +1,11 @@
String formatCny(num value) {
final fixed = value.toStringAsFixed(2);
final parts = fixed.split('.');
final whole = parts.first.replaceAllMapped(
RegExp(r'(\d)(?=(\d{3})+(?!\d))'),
(match) => '${match[1]},',
);
return '¥$whole.${parts.last}';
}
String formatGram(num value) => '${value.toStringAsFixed(2)}g';