TF-4171 Display tag in mailbox list

This commit is contained in:
dab246
2025-11-25 14:02:50 +07:00
committed by Dat H. Pham
parent f4302e06e8
commit 31ed2feae4
19 changed files with 1865 additions and 38 deletions
@@ -0,0 +1,18 @@
import 'package:flutter/material.dart';
extension HexColorExtension on String {
Color toColor({Color fallback = Colors.transparent}) {
try {
final hex = replaceAll('#', '');
if (hex.length != 6 && hex.length != 8) {
return fallback;
}
final fullHex = hex.length == 6 ? 'FF$hex' : hex;
return Color(int.parse(fullHex, radix: 16));
} catch (_) {
return fallback;
}
}
}