game_status_text.dart 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. import 'package:get/get.dart';
  4. import 'package:gobang/controllers/game_controller.dart';
  5. import 'package:gobang/themes/app_colors.dart';
  6. /// 对局阶段提示文案
  7. class GameStatusText extends StatelessWidget {
  8. const GameStatusText({super.key});
  9. @override
  10. Widget build(BuildContext context) {
  11. final c = Get.find<GameController>();
  12. return Obx(
  13. () => Container(
  14. width: double.infinity,
  15. padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
  16. decoration: BoxDecoration(
  17. color: Colors.white.withValues(alpha: 0.16),
  18. borderRadius: BorderRadius.circular(16.r),
  19. border: Border.all(color: Colors.white.withValues(alpha: 0.22)),
  20. ),
  21. child: Row(
  22. children: [
  23. Container(
  24. width: 8.w,
  25. height: 8.w,
  26. decoration: const BoxDecoration(
  27. color: AppColors.pumpkin,
  28. shape: BoxShape.circle,
  29. ),
  30. ),
  31. SizedBox(width: 10.w),
  32. Expanded(
  33. child: Text(
  34. c.statusText.value,
  35. style: TextStyle(
  36. color: AppColors.ivory,
  37. fontSize: 13.sp,
  38. fontWeight: FontWeight.w500,
  39. height: 1.35,
  40. ),
  41. ),
  42. ),
  43. ],
  44. ),
  45. ),
  46. );
  47. }
  48. }