fix: tag color with dark theme
This commit is contained in:
parent
3d21b6c226
commit
ad44495236
|
@ -1,5 +1,5 @@
|
|||
import 'package:antd_mobile/antd_mobile.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:from_css_color/from_css_color.dart';
|
||||
|
||||
class HexColorTag extends StatelessWidget {
|
||||
|
@ -14,7 +14,6 @@ class HexColorTag extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final c = fromCssColor('#$color');
|
||||
final theme = AntTheme.of(context);
|
||||
|
||||
return AntTag(
|
||||
round: true,
|
||||
|
@ -23,8 +22,8 @@ class HexColorTag extends StatelessWidget {
|
|||
name,
|
||||
style: TextStyle(
|
||||
color: c.computeLuminance() > 0.5
|
||||
? theme.colorText
|
||||
: theme.colorBackground,
|
||||
? CupertinoColors.black
|
||||
: CupertinoColors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue