count_second.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import 'package:flutter/material.dart';
  2. class CountSecond extends StatelessWidget {
  3. final int second;
  4. const CountSecond({
  5. super.key,
  6. required this.second,
  7. });
  8. @override
  9. Widget build(BuildContext context) {
  10. return Container(
  11. padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
  12. decoration: BoxDecoration(
  13. borderRadius: BorderRadius.circular(40),
  14. color: Theme.of(context).colorScheme.secondary,
  15. ),
  16. child: Row(
  17. mainAxisSize: MainAxisSize.min,
  18. children: [
  19. const SizedBox(width: 8),
  20. Column(
  21. crossAxisAlignment: CrossAxisAlignment.end,
  22. children: [
  23. SizedBox(
  24. width: 34,
  25. child: Text(
  26. '$second',
  27. textAlign: TextAlign.end,
  28. style: Theme.of(context).textTheme.titleLarge?.copyWith(
  29. color: Theme.of(context).colorScheme.onSecondary,
  30. fontSize: 24,
  31. fontWeight: FontWeight.w600,
  32. ),
  33. ),
  34. ),
  35. Text(
  36. '秒',
  37. style: Theme.of(context).textTheme.titleSmall?.copyWith(
  38. color: Theme.of(context).colorScheme.onSecondary,
  39. ),
  40. ),
  41. ],
  42. ),
  43. const SizedBox(width: 8),
  44. Icon(
  45. Icons.timer,
  46. size: 48,
  47. color: Theme.of(context).colorScheme.onSecondary,
  48. ),
  49. ],
  50. ),
  51. );
  52. }
  53. }