90 lines
2.9 KiB
Dart
90 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../models/team_model.dart';
|
|
|
|
class StatsHeader extends StatelessWidget {
|
|
final Team team;
|
|
const StatsHeader({super.key, required this.team});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: double.infinity,
|
|
padding: const EdgeInsets.only(top: 50, left: 16, right: 16, bottom: 25),
|
|
decoration: const BoxDecoration(color: Color(0xFF2196F3)),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
IconButton(
|
|
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
|
onPressed: () => Navigator.pop(context),
|
|
),
|
|
Row(
|
|
children: [
|
|
_buildLogo(),
|
|
const SizedBox(width: 16),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(team.name, style: const TextStyle(color: Colors.white, fontSize: 24, fontWeight: FontWeight.bold)),
|
|
Text("Temporada ${team.season}", style: const TextStyle(color: Colors.white70, fontSize: 14)),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildLogo() {
|
|
return Container(
|
|
width: 60, height: 60,
|
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(12)),
|
|
child: Center(
|
|
child: team.imageUrl.startsWith('http')
|
|
? ClipRRect(borderRadius: BorderRadius.circular(12), child: Image.network(team.imageUrl))
|
|
: Text(team.imageUrl.isEmpty ? "🏀" : team.imageUrl, style: const TextStyle(fontSize: 30)),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class SummaryCard extends StatelessWidget {
|
|
const SummaryCard({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 20),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(15),
|
|
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
),
|
|
child: const Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
children: [
|
|
_StatItem(label: "Jogos", value: "0", color: Colors.black),
|
|
_StatItem(label: "Vitórias", value: "0", color: Colors.green),
|
|
_StatItem(label: "Derrotas", value: "0", color: Colors.red),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _StatItem extends StatelessWidget {
|
|
final String label, value;
|
|
final Color color;
|
|
const _StatItem({required this.label, required this.value, required this.color});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
children: [
|
|
Text(value, style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: color)),
|
|
Text(label, style: const TextStyle(color: Colors.grey, fontSize: 13)),
|
|
],
|
|
);
|
|
}
|
|
} |