import 'package:flutter/widgets.dart'; import 'constant.dart'; class BattleBackground extends StatelessWidget { const BattleBackground({super.key}); @override Widget build(BuildContext context) { return CustomPaint( painter: _BattleBackgroundPainter(), child: const SizedBox.expand(), ); } } class _BattleBackgroundPainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final paint = Paint() ..color = kBoardBackgroundColor ..style = PaintingStyle.fill; canvas.drawRRect(_getBoardRRect(size), paint); } RRect _getBoardRRect(Size size) { return RRect.fromRectAndRadius(Offset.zero & size, const Radius.circular(8)); } @override bool shouldRepaint(covariant CustomPainter oldDelegate) => false; }