melhorar os icon de jogo

This commit is contained in:
2026-04-21 17:18:44 +01:00
parent cc753b395d
commit bc93bb748f
6 changed files with 281 additions and 192 deletions

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:playmaker/icons.dart/resaltosicon.dart';
import 'package:playmaker/widgets/placar_widgets.dart';
import 'dart:math' as math;
@@ -252,7 +253,7 @@ class _PlacarPageState extends State<PlacarPage> {
children: [
_buildCornerBtn(heroTag: 'btn_heatmap', icon: Icons.local_fire_department, color: Colors.orange.shade800, size: cornerBtnSize, onTap: () => _showHeatmap(context)),
SizedBox(height: 10 * sf),
_buildCornerBtn(heroTag: 'btn_boxscore', icon: Icons.table_chart, color: Colors.indigo, size: cornerBtnSize, onTap: () => showDialog(context: context, builder: (ctx) => BoxScoreDialog(controller: _controller, sf: sf))), ],
_buildCornerBtn(heroTag: 'btn_boxscore', icon: Icons.table_chart, color: Colors.indigo, size: cornerBtnSize, onTap: () => showDialog(context: context, builder: (ctx) => BoxScoreDialog(controller: _controller, sf: sf))), ],
),
),
@@ -694,7 +695,7 @@ class PlayerCourtCard extends StatelessWidget {
);
}
else if (action == "add_tov") {
showDialog(context: context, builder: (ctx) => ActionSubtypeDialog(
showDialog(context: context, builder: (ctx) => ActionSubtypeDialog(
title: "Escolha o tipo de turnover",
options: {
"add_3s": "3\nsegundos",
@@ -1349,11 +1350,9 @@ class BoxScoreDialog extends StatelessWidget {
borderRadius: BorderRadius.circular(12 * sf),
side: BorderSide(color: Colors.white24, width: 1 * sf),
),
// 👇 REDUZIMOS AS MARGENS PARA O POP-UP FICAR GIGANTE
insetPadding: EdgeInsets.all(8 * sf),
clipBehavior: Clip.antiAlias,
child: SizedBox(
// 👇 FORÇAMOS A LARGURA E ALTURA PARA 98% DO ECRÃ
width: MediaQuery.of(context).size.width * 0.98,
height: MediaQuery.of(context).size.height * 0.98,
child: DefaultTabController(
@@ -1395,11 +1394,18 @@ class BoxScoreDialog extends StatelessWidget {
child: Container(
width: double.infinity,
color: Colors.black12,
child: TabBarView(
children: [
_buildStatsTable(controller.myCourt + controller.myBench, controller, sf),
_buildStatsTable(controller.oppCourt + controller.oppBench, controller, sf),
],
// 👇 MÁGICA DE PERFORMANCE: Só a zona da tabela é que redesenha por segundo!
child: ValueListenableBuilder<Duration>(
valueListenable: controller.durationNotifier,
builder: (context, duration, _) {
return TabBarView(
physics: const NeverScrollableScrollPhysics(),
children: [
_buildStatsTable(controller.myCourt + controller.myBench, controller, sf),
_buildStatsTable(controller.oppCourt + controller.oppBench, controller, sf),
],
);
}
),
),
),
@@ -1412,18 +1418,15 @@ class BoxScoreDialog extends StatelessWidget {
);
}
Widget _buildStatsTable(List<String> teamPlayers, PlacarController ctrl, double sf) {
Widget _buildStatsTable(List<String> teamPlayers, PlacarController ctrl, double sf) {
return LayoutBuilder(
builder: (context, constraints) {
return SingleChildScrollView(
scrollDirection: Axis.vertical,
// 👇 O SEGREDO ESTÁ AQUI: Este BouncingScrollPhysics permite que o gesto de "swipe"
// passe para as abas quando chegas ao fim da tabela!
physics: const BouncingScrollPhysics(),
physics: const BouncingScrollPhysics(),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
// 👇 E AQUI TAMBÉM
physics: const BouncingScrollPhysics(),
physics: const ClampingScrollPhysics(),
child: ConstrainedBox(
constraints: BoxConstraints(minWidth: constraints.maxWidth),
child: DataTable(