linear method

void linear({
  1. double? progress,
  2. int? progressReserve,
  3. ProgressType? progressType,
  4. Color? foreground,
  5. Color? background,
  6. bool? isTextInner,
  7. bool? isTextFollowed,
  8. bool? isProgressOpacityAnim,
  9. TextStyle? textStyle,
  10. String? prefix,
  11. TextStyle? prefixStyle,
  12. String? suffix,
  13. TextStyle? suffixStyle,
  14. double? height,
  15. BorderRadius? borderRadius,
  16. double? width,
  17. double? padding,
  18. double? indicatorRatio,
  19. bool? reverse,
  20. BorderSide? borderSide,
  21. Gradient? foregroundGradient,
  22. Gradient? backgroundGradient,
  23. List<BoxShadow>? shadows,
})

改变线性进度条属性

Implementation

void linear({
  double? progress,
  int? progressReserve,
  ProgressType? progressType,
  Color? foreground,
  Color? background,
  bool? isTextInner,
  bool? isTextFollowed,
  bool? isProgressOpacityAnim,
  TextStyle? textStyle,
  String? prefix,
  TextStyle? prefixStyle,
  String? suffix,
  TextStyle? suffixStyle,
  double? height,
  BorderRadius? borderRadius,
  double? width,
  double? padding,
  double? indicatorRatio,
  bool? reverse,
  BorderSide? borderSide,
  Gradient? foregroundGradient,
  Gradient? backgroundGradient,
  List<BoxShadow>? shadows
}){
  if(_isDisposed){
    return;
  }
  LinearProgress? linearProgress;
  if(_buttonProgress is LinearProgress){
    linearProgress = _buttonProgress as LinearProgress;
  }
  _buttonProgress = LinearProgress(
    progress: progress??_buttonProgress.progress,
    progressReserve: progressReserve??_buttonProgress.progressReserve,
    progressType: progressType??_buttonProgress.progressType,
    foreground: foreground??_buttonProgress.foreground,
    background: background??_buttonProgress.background,
    isProgressOpacityAnim: isProgressOpacityAnim??_buttonProgress.isProgressOpacityAnim,
    textStyle: textStyle??_buttonProgress.textStyle,
    prefix: prefix??_buttonProgress.prefix,
    prefixStyle: prefixStyle??_buttonProgress.prefixStyle,
    suffix: suffix??_buttonProgress.suffix,
    suffixStyle: suffixStyle??_buttonProgress.suffixStyle,
    height: height??linearProgress?.height??10,
    borderRadius: borderRadius??linearProgress?.borderRadius,
    width: width??linearProgress?.width,
    padding: padding??linearProgress?.padding??5,
    indicatorRatio: indicatorRatio??linearProgress?.indicatorRatio??5,
    reverse: reverse??linearProgress?.reverse??false,
    isTextInner: isTextInner??linearProgress?.isTextInner??true,
    isTextFollowed: isTextFollowed??linearProgress?.isTextFollowed??true,
    borderSide: borderSide??_buttonProgress.borderSide,
    foregroundGradient: foregroundGradient??_buttonProgress.foregroundGradient,
    backgroundGradient: backgroundGradient??_buttonProgress.backgroundGradient,
    shadows: shadows??_buttonProgress.shadows,
  );
  notifyListeners();
}