import 'package:flutter/material.dart';
import 'package:flyinsono/lab/color/lab_colors.dart';

class OutlinedProgressIndicator extends StatelessWidget {
  const OutlinedProgressIndicator({super.key, this.progress = 0.0})
      : assert(progress >= 0 && progress <= 1);

  final double progress; // 进度 0-1

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 10,
      padding: EdgeInsets.all(2),
      decoration: BoxDecoration(
        border: Border.all(
          color: LabColors.base500,
          width: 1,
        ),
        borderRadius: BorderRadius.circular(10),
      ),
      child: Align(
        alignment: Alignment.centerLeft,
        child: FractionallySizedBox(
          widthFactor: progress,
          child: Container(
            decoration: BoxDecoration(
              color: LabColors.base600,
              borderRadius: BorderRadius.circular(5),
            ),
          ),
        ),
      ),
    );
  }
}
