Page 1 of 1

Blackbox in UI Flutter

Posted: 15 Jan 2025, 15:20
by Guest
Ich bin ziemlich neu bei Flutter.
Plötzlich erscheint auf meinem Bildschirm aus dem Nichts ein schwarzes Kästchen hinter einem Text.
Ich habe es mit einer einen Monat alten Version verglichen meiner App auch, aber überraschenderweise ist es auch in der älteren Version vorhanden.
Kann mir jemand helfen, dieses Problem zu lösen? Vielen Dank :pray:
Ich habe versucht, meine einen Monat alte Version der App auszuführen, aber sie wird plötzlich auch dort angezeigt.
Dies ist der Code, der das obige Widget anzeigt.

Code: Select all

@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),
),
],
),
);
}
}