esta melhor des que comecei
This commit is contained in:
@@ -72,15 +72,17 @@ class TeamCard extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis, // Previne overflows em nomes longos
|
||||
),
|
||||
|
||||
// --- 3. SUBTÍTULO (Contagem + Época) ---
|
||||
// --- 3. SUBTÍTULO (Contagem + Época em TEMPO REAL) ---
|
||||
subtitle: Padding(
|
||||
padding: EdgeInsets.only(top: 6.0 * sf),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.groups_outlined, size: 16 * sf, color: Colors.grey),
|
||||
SizedBox(width: 4 * sf),
|
||||
FutureBuilder<int>(
|
||||
future: controller.getPlayerCount(team.id),
|
||||
|
||||
// 👇 A CORREÇÃO ESTÁ AQUI: StreamBuilder em vez de FutureBuilder 👇
|
||||
StreamBuilder<int>(
|
||||
stream: controller.getPlayerCountStream(team.id),
|
||||
initialData: 0,
|
||||
builder: (context, snapshot) {
|
||||
final count = snapshot.data ?? 0;
|
||||
@@ -94,6 +96,7 @@ class TeamCard extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(width: 8 * sf),
|
||||
Expanded( // Garante que a temporada se adapta se faltar espaço
|
||||
child: Text(
|
||||
@@ -107,7 +110,6 @@ class TeamCard extends StatelessWidget {
|
||||
),
|
||||
|
||||
// --- 4. BOTÕES (Estatísticas e Apagar) ---
|
||||
// Removido o SizedBox fixo! Agora é MainAxisSize.min
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min, // <-- ISTO RESOLVE O OVERFLOW DAS RISCAS AMARELAS
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user