linearProgress method

Widget linearProgress(
  1. BoxConstraints constraints,
  2. double value,
  3. TTheme theme
)

Implementation

Widget linearProgress(
  BoxConstraints constraints,
  double value,
  TTheme theme,
) {
  return ConstrainedBox(
    constraints: BoxConstraints(minHeight: 6.0, maxHeight: 6.0),
    child: Stack(
      alignment: AlignmentDirectional.centerStart,
      children: [
        Container(
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8),
            color: backgroundColor ?? theme.border,
          ),
          width: constraints.maxWidth,
        ),
        AnimatedContainer(
          curve: Curves.ease,
          duration: const Duration(milliseconds: 500),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8),
            color: color ?? theme.primary,
          ),
          width: value * constraints.maxWidth,
        ),
      ],
    ),
  );
}