diff --git a/lib/icons.dart/resaltosicon.dart b/lib/icons.dart/resaltosicon.dart index 57d3128..f45865f 100644 --- a/lib/icons.dart/resaltosicon.dart +++ b/lib/icons.dart/resaltosicon.dart @@ -18,44 +18,42 @@ class ActionButtonsPanel extends StatelessWidget { final double gap = 5 * sf; return Padding( - // πŸ‘‡ AJUSTA ESTE VALOR (ex: 30, 50, 80) PARA SUBIR MAIS OU MENOS - padding: EdgeInsets.only(bottom: 12 * sf), + padding: EdgeInsets.only(bottom: 12 * sf), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.end, children: [ _columnBtn([ - _dragAndTargetBtn("M1", AppTheme.actionMiss, "miss_1", baseSize, feedSize, sf), - _dragAndTargetBtn("1", AppTheme.actionPoints, "add_pts_1", baseSize, feedSize, sf), - _dragAndTargetBtn("1", AppTheme.actionPoints, "sub_pts_1", baseSize, feedSize, sf, isX: true), - _dragAndTargetBtn("STL", AppTheme.actionSteal, "add_stl", baseSize, feedSize, sf), + _dragAndTargetBtn("-1", AppTheme.actionMiss, "miss_1", baseSize, feedSize, sf, badge: ""), + _dragAndTargetBtn("1", AppTheme.actionPoints, "add_pts_1", baseSize, feedSize, sf, badge: "FTM"), + _dragAndTargetBtn("1", AppTheme.actionPoints, "sub_pts_1", baseSize, feedSize, sf, badge: "FTA", isX: true), + _dragAndTargetBtn("STL", AppTheme.actionSteal, "add_stl", baseSize, feedSize, sf, badge: "STL"), ], gap), SizedBox(width: gap), _columnBtn([ - _dragAndTargetBtn("M2", AppTheme.actionMiss, "miss_2", baseSize, feedSize, sf), - _dragAndTargetBtn("2", AppTheme.actionPoints, "add_pts_2", baseSize, feedSize, sf), - _dragAndTargetBtn("2", AppTheme.actionPoints, "sub_pts_2", baseSize, feedSize, sf, isX: true), - _dragAndTargetBtn("AST", AppTheme.actionAssist, "add_ast", baseSize, feedSize, sf), + _dragAndTargetBtn("-2", AppTheme.actionMiss, "miss_2", baseSize, feedSize, sf, badge: ""), + _dragAndTargetBtn("2", AppTheme.actionPoints, "add_pts_2", baseSize, feedSize, sf, badge: "2PM"), + _dragAndTargetBtn("2", AppTheme.actionPoints, "sub_pts_2", baseSize, feedSize, sf, badge: "2PA", isX: true), + _dragAndTargetBtn("AST", AppTheme.actionAssist, "add_ast", baseSize, feedSize, sf, badge: "AST"), ], gap), SizedBox(width: gap), _columnBtn([ - _dragAndTargetBtn("M3", AppTheme.actionMiss, "miss_3", baseSize, feedSize, sf), - _dragAndTargetBtn("3", AppTheme.actionPoints, "add_pts_3", baseSize, feedSize, sf), - _dragAndTargetBtn("3", AppTheme.actionPoints, "sub_pts_3", baseSize, feedSize, sf, isX: true), - _dragAndTargetBtn("TOV", AppTheme.actionMiss, "add_tov", baseSize, feedSize, sf), + _dragAndTargetBtn("-3", AppTheme.actionMiss, "miss_3", baseSize, feedSize, sf, badge: ""), + _dragAndTargetBtn("3", AppTheme.actionPoints, "add_pts_3", baseSize, feedSize, sf, badge: "3PM"), + _dragAndTargetBtn("3", AppTheme.actionPoints, "sub_pts_3", baseSize, feedSize, sf, badge: "3PA", isX: true), + _dragAndTargetBtn("TOV", AppTheme.actionMiss, "add_tov", baseSize, feedSize, sf, badge: "TOV"), ], gap), SizedBox(width: gap), _columnBtn([ - _dragAndTargetBtn("O", AppTheme.actionRebound, "add_orb", baseSize, feedSize, sf), - _dragAndTargetBtn("D", AppTheme.actionRebound, "add_drb", baseSize, feedSize, sf), - _dragAndTargetBtn("BLK", AppTheme.actionBlock, "add_blk", baseSize, feedSize, sf), + _dragAndTargetBtn("O", AppTheme.actionRebound, "add_orb", baseSize, feedSize, sf, badge: "OREB"), + _dragAndTargetBtn("D", AppTheme.actionRebound, "add_drb", baseSize, feedSize, sf, badge: "DREB"), + _dragAndTargetBtn("BLK", AppTheme.actionBlock, "add_blk", baseSize, feedSize, sf, badge: "BLK"), ], gap), ], ), ); } - // ... (o resto dos teus mΓ©todos como _columnBtn, _dragAndTargetBtn, etc., mantΓͺm-se iguais) Widget _columnBtn(List children, double gap) { return Column( mainAxisSize: MainAxisSize.min, @@ -63,13 +61,13 @@ class ActionButtonsPanel extends StatelessWidget { } Widget _dragAndTargetBtn(String label, Color color, String actionData, double baseSize, double feedSize, double sf, - {IconData? icon, bool isX = false}) { + {IconData? icon, bool isX = false, String badge = ""}) { return Draggable( data: actionData, - feedback: _circle(label, color, icon, true, baseSize, feedSize, sf, isX: isX), + feedback: _circle(label, color, icon, true, baseSize, feedSize, sf, isX: isX, badge: badge), childWhenDragging: Opacity( opacity: 0.5, - child: _circle(label, color, icon, false, baseSize, feedSize, sf, isX: isX), + child: _circle(label, color, icon, false, baseSize, feedSize, sf, isX: isX, badge: badge), ), child: DragTarget( onAcceptWithDetails: (details) {}, @@ -83,7 +81,7 @@ class ActionButtonsPanel extends StatelessWidget { shape: BoxShape.circle, boxShadow: [BoxShadow(color: Colors.white, blurRadius: 10 * sf, spreadRadius: 3 * sf)]) : null, - child: _circle(label, color, icon, false, baseSize, feedSize, sf, isX: isX), + child: _circle(label, color, icon, false, baseSize, feedSize, sf, isX: isX, badge: badge), ), ); }), @@ -105,15 +103,15 @@ class ActionButtonsPanel extends StatelessWidget { } Widget _circle(String label, Color color, IconData? icon, bool isFeed, double baseSize, double feedSize, double sf, - {bool isX = false}) { + {bool isX = false, String badge = ""}) { double size = isFeed ? feedSize : baseSize; Widget content; - bool isPointBtn = label == "1" || label == "2" || label == "3" || label == "M1" || label == "M2" || label == "M3"; - bool isRebBtn = label == "O" || label == "D"; - bool isBlkBtn = label == "BLK"; - bool isStlBtn = label == "STL"; - bool isAstBtn = label == "AST"; - bool isTovBtn = label == "TOV"; + bool isPointBtn = label == "1" || label == "2" || label == "3" || label == "-1" || label == "-2" || label == "-3"; + bool isRebBtn = label == "O" || label == "D"; + bool isBlkBtn = label == "BLK"; + bool isStlBtn = label == "STL"; + bool isAstBtn = label == "AST"; + bool isTovBtn = label == "TOV"; if (isPointBtn) { content = Stack( @@ -177,32 +175,7 @@ class ActionButtonsPanel extends StatelessWidget { ], ); } else if (isBlkBtn) { - content = Stack( - alignment: Alignment.center, - children: [ - Icon(Icons.front_hand, color: color, size: size * 0.75), - Stack( - alignment: Alignment.center, - children: [ - Text(label, - style: TextStyle( - fontSize: size * 0.28, - fontWeight: FontWeight.w900, - foreground: Paint() - ..style = PaintingStyle.stroke - ..strokeWidth = size * 0.05 - ..color = Colors.black, - decoration: TextDecoration.none)), - Text(label, - style: TextStyle( - fontSize: size * 0.28, - fontWeight: FontWeight.w900, - color: Colors.white, - decoration: TextDecoration.none)), - ], - ), - ], - ); + content = Icon(Icons.front_hand, color: const Color.fromARGB(207, 56, 52, 52), size: size * 0.75); } else if (isStlBtn) { content = Stack( alignment: Alignment.center, @@ -248,7 +221,7 @@ class ActionButtonsPanel extends StatelessWidget { return Stack( clipBehavior: Clip.none, - alignment: Alignment.bottomRight, + alignment: Alignment.bottomLeft, children: [ Container( width: size, @@ -258,34 +231,34 @@ class ActionButtonsPanel extends StatelessWidget { : BoxDecoration( gradient: RadialGradient(colors: [color.withOpacity(0.7), color], radius: 0.8), shape: BoxShape.circle, - boxShadow: [ - BoxShadow(color: Colors.black38, blurRadius: 6 * sf, offset: Offset(0, 3 * sf)) - ]), + boxShadow: [BoxShadow(color: Colors.black38, blurRadius: 6 * sf, offset: Offset(0, 3 * sf))]), alignment: Alignment.center, child: content, ), - Positioned( - bottom: size * -0.04, - left: size * -0.04, - child: Container( - padding: EdgeInsets.symmetric(horizontal: size * 0.09, vertical: size * 0.02), - decoration: BoxDecoration( - color: Colors.grey.shade600, - borderRadius: BorderRadius.circular(size * 0.07), - boxShadow: [BoxShadow(color: Colors.black45, blurRadius: 2, offset: const Offset(0, 1))], - ), - child: Text( - _badgeLabel(label), - style: TextStyle( - color: Colors.white, - fontSize: size * 0.16, - fontWeight: FontWeight.w900, - decoration: TextDecoration.none, - letterSpacing: 0.2, + // Badge sΓ³ aparece se nΓ£o for vazio + if (badge.isNotEmpty) + Positioned( + bottom: size * -0.04, + left: size * -0.04, + child: Container( + padding: EdgeInsets.symmetric(horizontal: size * 0.09, vertical: size * 0.02), + decoration: BoxDecoration( + color: Colors.grey.shade600, + borderRadius: BorderRadius.circular(size * 0.07), + boxShadow: [BoxShadow(color: Colors.black45, blurRadius: 2, offset: const Offset(0, 1))], + ), + child: Text( + badge, + style: TextStyle( + color: Colors.white, + fontSize: size * 0.16, + fontWeight: FontWeight.w900, + decoration: TextDecoration.none, + letterSpacing: 0.2, + ), ), ), ), - ), if (isX) Positioned( top: 0, @@ -296,20 +269,6 @@ class ActionButtonsPanel extends StatelessWidget { ], ); } - - String _badgeLabel(String label) { - switch (label) { - case "1": return "FTM"; - case "M1": return "FTA"; - case "2": return "2PM"; - case "M2": return "2PA"; - case "3": return "3PM"; - case "M3": return "3PA"; - case "O": return "OREB"; - case "D": return "DREB"; - default: return label; - } - } } class HoopIconPainter extends CustomPainter { diff --git a/lib/widgets/placar_widgets.dart b/lib/widgets/placar_widgets.dart index 4faeebc..9caf43a 100644 --- a/lib/widgets/placar_widgets.dart +++ b/lib/widgets/placar_widgets.dart @@ -214,6 +214,49 @@ class BenchPopup extends StatelessWidget { } } +// ============================================================================ +// SHIRT PAINTER β€” camisola desenhada com CustomPainter +// ============================================================================ +class ShirtPainter extends CustomPainter { + final Color color; + final bool isFouledOut; + const ShirtPainter({required this.color, this.isFouledOut = false}); + + @override + void paint(Canvas canvas, Size size) { + final double w = size.width; + final double h = size.height; + final Color shirtColor = isFouledOut ? Colors.grey.shade700 : color; + + final paint = Paint()..color = shirtColor..style = PaintingStyle.fill; + final strokePaint = Paint() + ..color = Colors.white.withOpacity(0.25) + ..style = PaintingStyle.stroke + ..strokeWidth = w * 0.04; + + final path = Path(); + // Mangas + path.moveTo(w * 0.18, h * 0.18); + path.lineTo(w * 0.00, h * 0.42); + path.lineTo(w * 0.20, h * 0.52); + path.lineTo(w * 0.20, h * 0.95); + path.lineTo(w * 0.80, h * 0.95); + path.lineTo(w * 0.80, h * 0.52); + path.lineTo(w * 1.00, h * 0.42); + path.lineTo(w * 0.82, h * 0.18); + // Gola em V + path.quadraticBezierTo(w * 0.68, h * 0.32, w * 0.50, h * 0.30); + path.quadraticBezierTo(w * 0.32, h * 0.32, w * 0.18, h * 0.18); + path.close(); + + canvas.drawPath(path, paint); + canvas.drawPath(path, strokePaint); + } + + @override + bool shouldRepaint(ShirtPainter old) => old.color != color || old.isFouledOut != isFouledOut; +} + class PlayerCourtCard extends StatelessWidget { final PlacarController controller; final String playerId; @@ -296,22 +339,62 @@ class PlayerCourtCard extends StatelessWidget { String fgPercent = fga > 0 ? ((fgm / fga) * 100).toStringAsFixed(0) : "0"; String displayName = displayNameStr.length > 12 ? "${displayNameStr.substring(0, 10)}..." : displayNameStr; + // Tamanho da camisola + final double shirtSize = 38 * sf; + return Container( padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4), - decoration: BoxDecoration(color: bgColor, borderRadius: BorderRadius.circular(8), border: Border.all(color: borderColor, width: 1.5), boxShadow: const [BoxShadow(color: Colors.black26, blurRadius: 4, offset: Offset(0, 2))]), + decoration: BoxDecoration( + color: bgColor, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: borderColor, width: 1.5), + boxShadow: const [BoxShadow(color: Colors.black26, blurRadius: 4, offset: Offset(0, 2))], + ), child: ClipRRect( borderRadius: BorderRadius.circular(6 * sf), - child: IntrinsicHeight( + child: IntrinsicHeight( child: Row( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: CrossAxisAlignment.stretch, children: [ + // ── Camisola com nΓΊmero ────────────────────────────── Container( - padding: EdgeInsets.symmetric(horizontal: 10 * sf), - color: isFouledOut ? Colors.grey[700] : teamColor, + padding: EdgeInsets.symmetric(horizontal: 6 * sf, vertical: 4 * sf), + color: isFouledOut ? Colors.grey.shade200 : teamColor.withOpacity(0.12), alignment: Alignment.center, - child: Text(number, style: TextStyle(color: Colors.white, fontSize: 18 * sf, fontWeight: FontWeight.bold)), + child: SizedBox( + width: shirtSize, + height: shirtSize * 1.1, + child: Stack( + alignment: Alignment.center, + children: [ + // Camisola desenhada + CustomPaint( + size: Size(shirtSize, shirtSize * 1.1), + painter: ShirtPainter( + color: isFouledOut ? Colors.grey.shade600 : teamColor, + isFouledOut: isFouledOut, + ), + ), + // NΓΊmero por cima + Padding( + padding: EdgeInsets.only(top: shirtSize * 0.15), + child: Text( + number, + style: TextStyle( + color: Colors.white, + fontSize: shirtSize * 0.42, + fontWeight: FontWeight.w900, + decoration: isFouledOut ? TextDecoration.lineThrough : TextDecoration.none, + shadows: const [Shadow(color: Colors.black45, blurRadius: 3)], + ), + ), + ), + ], + ), + ), ), + // ── EstatΓ­sticas ───────────────────────────────────── Padding( padding: EdgeInsets.symmetric(horizontal: 8 * sf, vertical: 4 * sf), child: Column(