chore: give neutral construct uses a neutral color (#2513)

This commit is contained in:
ggurdin 2025-04-21 08:54:09 -04:00 committed by GitHub
parent 33c2024f80
commit 6df7b25af2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -1,9 +1,11 @@
import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:matrix/matrix.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/analytics_misc/construct_use_type_enum.dart';
import 'package:fluffychat/pangea/common/utils/error_handler.dart';
import 'package:fluffychat/pangea/constructs/construct_identifier.dart';
@ -196,6 +198,11 @@ class OneConstructUse {
int get pointValue => useType.pointValue;
Color pointValueColor(BuildContext context) {
if (pointValue == 0) return Theme.of(context).colorScheme.primary;
return pointValue > 0 ? AppConfig.gold : Colors.red;
}
ConstructIdentifier get identifier => ConstructIdentifier(
lemma: lemma,
type: constructType,

View file

@ -160,9 +160,7 @@ class LevelBarPopup extends StatelessWidget {
fontWeight: FontWeight.w900,
fontSize: 14,
height: 1,
color: use.pointValue > 0
? AppConfig.gold
: Colors.red,
color: use.pointValueColor(context),
),
),
// const SizedBox(width: 5),