| 1 | import 'package:flutter/material.dart'; |
| 2 | |
| 3 | class YatPageIndicator extends StatelessWidget { |
| 4 | YatPageIndicator({required this.filled}); |
| 5 | |
| 6 | final int filled; |
| 7 | |
| 8 | @override |
| 9 | Widget build(BuildContext context) { |
| 10 | return Container( |
| 11 | width: 44, |
| 12 | child: Row( |
| 13 | mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 14 | children: List.generate(3, (index) { |
| 15 | final size = 8.0; |
| 16 | final isFilled = index == filled; |
| 17 | |
| 18 | return Container( |
| 19 | height: size, |
| 20 | width: size, |
| 21 | decoration: BoxDecoration( |
| 22 | shape: BoxShape.circle, |
| 23 | color: isFilled |
| 24 | ? Theme.of(context).colorScheme.primary |
| 25 | : Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.1))); |
| 26 | }))); |
| 27 | } |
| 28 | } |