fazer camisola

This commit is contained in:
2026-04-23 10:43:21 +01:00
parent 59927521f1
commit 4075c56d44
2 changed files with 140 additions and 98 deletions

View File

@@ -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<Widget> 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<String>(
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<String>(
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 {