Внезапно из ниоткуда на моем экране появляется черный квадрат позади текста.
Я сверился с версией месячной давности. моего приложения, но на удивление оно присутствует и в более старой версии.
Может ли кто-нибудь помочь мне решить эту проблему? Большое спасибо
Я попробовал запустить свою месячную версию приложения, но она внезапно появилась и там.
Это это код, который отображает вышеуказанный виджет.
@override
Widget build(BuildContext context) {
double progressPercentage = (_nutriPoints / _dailyGoal).clamp(0.0, 1.0);
Color progressColor = Color(0xFF1731B8); // New color #1731B8
return SizedBox(
width: widget.size ?? MediaQuery.of(context).size.width * 0.8,
height: widget.size ?? MediaQuery.of(context).size.width * 0.8,
child: _errorMessage.isNotEmpty
? Center(
child: Text(
_errorMessage,
style: TextStyle(color: Colors.red),
),
)
: Stack(
alignment: Alignment.center,
children: [
MultiCircularSlider(
size: widget.size ?? MediaQuery.of(context).size.width * 0.8,
progressBarType: MultiCircularSliderType.circular,
values: [progressPercentage],
colors: [progressColor],
showTotalPercentage: false,
animationDuration: const Duration(milliseconds: 1000),
animationCurve: Curves.easeInOutCirc,
trackColor: progressColor.withOpacity(0.1),
progressBarWidth: 20.0,
trackWidth: 20.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'${_nutriPoints.toInt()}',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: progressColor,
),
),
SizedBox(height: 5), // Add a small space between the number and text
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16,
color: Colors.black,
fontFamily: 'Popins',
),
children: [
TextSpan(
text: 'NUTRI',
style: TextStyle(
fontWeight: FontWeight.normal,
letterSpacing: 3,
),
),
TextSpan(
text: 'POINTS',
style: TextStyle(
fontWeight: FontWeight.bold,
letterSpacing: 3,
),
),
],
),
),
],
),
// This empty container pushes the content up
Align(
alignment: Alignment.bottomCenter,
child: Container(height: 20),
),
],
),
);
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ui-flutter
Мобильная версия