@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: masteryColors[mastery - 1],
),
height: 140,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.white,
),
height: 100,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.black12,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(4),
child: Image.asset(
widget.foto,
height: 100,
width: 72,
fit: BoxFit.cover,
),
),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 200,
child: Text(
widget.nome,
style: const TextStyle(
fontSize: 24, overflow: TextOverflow.ellipsis),
),
),
Difficulty(widget.dificuldade),
// vai ser um novo componente.
],
),
Padding(
padding: const EdgeInsets.all(16.0),
child: SizedBox(
height: 55,
width: 65,
child: IgnorePointer(
ignoring: blockButton(),
child: ElevatedButton(
onPressed: levelUp,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
const Icon(Icons.arrow_drop_up),
Text(
'UP',
style: TextStyle(
fontSize: 12,
color: blockButton() == true
? Colors.grey
: Colors.black),
),
],
),
),
),
),
)
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(
left: 8,
),
child: SizedBox(
width: 200,
child: LinearProgressIndicator(
color: Colors.white,
value: widget.dificuldade > 0
? ((level / widget.dificuldade) / 10)
: 1,
),
),
),
Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
'Nivel: $level',
style: const TextStyle(color: Colors.white, fontSize: 16),
),
),
],
)
],
),
],
),
);
}
}