progress function

Component progress(
  1. List<Component> children, {
  2. double? value,
  3. double? max,
  4. Key? key,
  5. String? id,
  6. String? classes,
  7. Styles? styles,
  8. Map<String, String>? attributes,
  9. Map<String, EventCallback>? events,
})

The <progress> HTML element displays an indicator showing the completion progress of a task, typically displayed as a progress bar.

  • value: This attribute specifies how much of the task that has been completed. It must be a valid floating point number between 0 and max, or between 0 and 1 if max is omitted. If there is no value attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take.
  • max: This attribute describes how much work the task indicated by the progress element requires. The max attribute, if present, must have a value greater than 0 and be a valid floating point number. The default value is 1.

Implementation

Component progress(List<Component> children,
    {double? value,
    double? max,
    Key? key,
    String? id,
    String? classes,
    Styles? styles,
    Map<String, String>? attributes,
    Map<String, EventCallback>? events}) {
  return DomComponent(
    tag: 'progress',
    key: key,
    id: id,
    classes: classes,
    styles: styles,
    attributes: {
      ...attributes ?? {},
      if (value != null) 'value': '$value',
      if (max != null) 'max': '$max',
    },
    events: events,
    children: children,
  );
}