//Variáveis cor e texto criadas para tarefa
var cor = Colors.lightBlue[700];
String texto = ' ';
return Padding( padding: const EdgeInsets.all(8.0), child: Container(color:Colors.white, child: Stack( children: [
//Aplicação da variável cor
Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(4), color:cor,),height:140,),
Column( children: [
Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(4), color:Colors.white,),height:100, child:Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(4), color: Colors.grey[400],), height: 72, width: 100, child: ClipRRect(borderRadius: BorderRadius.circular(6), child: Image.asset(widget.foto, fit: BoxFit.cover, ), ), ), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(width: 200, child:Text(widget.nome,style:const TextStyle(fontSize:20,),overflow: TextOverflow.ellipsis,), ), Difficulty(difficultyLevel: widget.dificuldade) ], ), SizedBox(width: 78, height: 55, child: ElevatedButton(onPressed: (){setState(() {nivel++; // ignore: avoid_print }); print(nivel);
//Incluido condiçoes para variaveis declaradas no Botão LVL UP!!
if (nivel>= 10) {
print(cor = Colors.green[600] );
print(texto ='UP!!');
}
if (nivel>=20) {
print(cor = Colors.yellow[700] );
print(texto ='GOD!!');
}
if (nivel>=30) {
print(cor = Colors.red[600] );
print(texto ='VERY GOD!!');
}
if (nivel>=40) {
print(cor = Colors.brown[900]);
print(texto ='GREAT!!');
}
if (nivel>=50) {
print(cor = Colors.grey);
print(texto ='EXCEPTIONAL');
}},
child: const Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Icon(Icons.arrow_drop_up),
Text('LVL UP',style: TextStyle(fontSize: 9),),
],
),
),
),
], ), ), Row( mainAxisAlignment:MainAxisAlignment.spaceBetween, children: [ Padding(padding: const EdgeInsets.all(8), child: SizedBox( width: 200, child:LinearProgressIndicator(color: Colors.white,value:(widget.dificuldade>0)? (nivel/widget.dificuldade)/10 : 1,), ), ), Padding(padding: const EdgeInsets.all(11),
//Aplicação da variavel texto
child: Text('$texto Nivel: $nivel',style:const TextStyle(color: Colors.white),),
),
],
),
], ) ], ), ) );