GSProgress

The GSProgress widget is designed to display the progress of a task that involves multiple steps and takes some time to complete. It helps users stay informed about the current status of a lengthy process.
API Reference
This is an illustration of a Themed GSProgress widget with default configuration.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSProgress(
      value: 0.4,
      size: GSSizes.$md,
    )


API Reference

Import

To use this widget in your project, include the following import statement in your file.
import "package:gluestack_ui/gluestack_ui.dart"

Widget Parameters

This section provides a comprehensive reference list for the widget parameters, detailing descriptions, properties, types, and default behavior for easy project integration.

GSProgress

It inherits all the properties of Flutter's LinearProgressIndicator widget.
Parameters
Type
Default
Description
value
double
-
It is used to set the progress of the progress bar
Descendants Styling properties
Props to style child components.
Parameters
Description
style
Parameter to style GSProgress widget

Accessibility

We have outlined the various features that ensure the GSProgress widget is accessible to all users, including those with disabilities. These features help ensure that your application is inclusive and meets accessibility standards.

Keyboard

  • Tab: Moves focus to the next focusable widget.

Screen Reader

  • VoiceOver: When the Progress is focused, the screen reader will announce it's a progress and it's current progress indicator.

Parameters

GSProgress widget is created using LinearProgressIndicator widget from flutter. It extends all the arguments supported by Flutter LinearProgressIndicator and additionally the properties mentioned below.

GSProgress

Name
Value
Default
size
xs | sm | md | lg | xl | 2xl
md
Note: These properties are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.

Examples

The Examples section provides visual representations of the different variants of the widget, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

Value

GSProgress widget with value

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSVStack(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        GSText(text: "Downloading 55%"),
        SizedBox(
          height: 5,
        ),
        GSProgress(
          value: 0.55,
        ),
      ],
    )

Color

You can add track color to progress bar as per our needs.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSVStack(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        GSProgress(
          value: 0.55,
          style: GSStyle(progressValueColor: $GSColors.rose400),
        ),
        const SizedBox(
          height: 20,
        ),
        GSProgress(
          value: 0.55,
          style: GSStyle(progressValueColor: $GSColors.blue500),
        ),
        const SizedBox(
          height: 20,
        ),
        GSProgress(
          value: 0.55,
          style: GSStyle(progressValueColor: $GSColors.green500),
        ),
        const SizedBox(
          height: 20,
        ),
        GSProgress(
          value: 0.55,
          style: GSStyle(progressValueColor: $GSColors.orange500),
        ),
      ],
    )

Custom

You can customize the progress bar. Below is the example where we have change the theme of progress bar.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSVStack(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        const GSHeading(text: "Internal Storage"),
        const SizedBox(
          height: 5,
        ),
        GSProgress(
          value: 0.55,
          style: GSStyle(
            progressValueColor: $GSColors.green500,
            bg: $GSColors.green50,
          ),
        ),
        const SizedBox(
          height: 5,
        ),
        const GSText(text: "14GB"),
      ],
    )


Edit this page on GitHub