part of '../../core_app.dart';

/// 顶部进度条组件。
class TopProgressBar extends StatelessWidget {
  /// 创建顶部进度条组件。
  const TopProgressBar({
    required this.progress,
    required this.hasMeasuredProgress,
    super.key,
  });

  /// 当前加载进度。
  final int progress;

  /// 当前进度值是否由 WebView 实际回传。
  final bool hasMeasuredProgress;

  @override
  Widget build(BuildContext context) {
    return LinearProgressIndicator(
      minHeight: 3,
      value: hasMeasuredProgress ? progress / 100 : null,
      backgroundColor: Colors.white.withValues(alpha: 0.8),
      valueColor: AlwaysStoppedAnimation<Color>(_shellAccentColor),
    );
  }
}
