GSSpinner

GSSpinner are designed to give visual cues to users that an action is being processed or that a change or result is expected. They are useful for improving the user experience by reducing frustration and uncertainty.
API Reference
This is an illustration of a Themed GSSpinner widget with default configuration.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSSpinner(
      strokeWidth: 4,
      style: GSStyle(
        bg: $GSColors.blueGray300,
        width: 30,
        height: 30,
      ),
    )


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.

GSSpinner

Contains all Spinner related layout style properties and actions. It inherits all the properties and methods of Flutter's CircularProgressIndicator widget.

Accessibility

We have outlined the various features that ensure the GSSpinner 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 GSSpinner is focused, the screen reader will announce it's loading indicator.

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.

GSSpinner with Label

A GSSpinner widget with a label provides informative text or a label alongside the spinner, offering descriptive context and improving user understanding and interaction with the spinner widget within a user interface.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSHStack(
      children: [
        GSSpinner(
          strokeWidth: 2,
          style: GSStyle(
            bg: $GSColors.blueGray300,
            width: 20,
            height: 20,
          ),
        ),
        const SizedBox(
          width: 10,
        ),
        const GSText(text: "Please wait..."),
      ],
    )

Color Scheme

A GSSpinner widget with a color scheme enhances visual appeal by incorporating distinct colors, adding a touch of customization and style to the spinner widget within a user interface.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSVStack(
      children: [
        GSSpinner(
          strokeWidth: 3,
          style: GSStyle(
            bg: $GSColors.blueGray700,
            color: $GSColors.red400,
            width: 30,
            height: 30,
          ),
        ),
        const SizedBox(
          height: 10,
        ),
        GSSpinner(
          strokeWidth: 3,
          style: GSStyle(
            bg: $GSColors.blueGray700,
            color: $GSColors.orange400,
            width: 30,
            height: 30,
          ),
        ),
        const SizedBox(
          height: 10,
        ),
        GSSpinner(
          strokeWidth: 3,
          style: GSStyle(
            bg: $GSColors.blueGray700,
            color: $GSColors.green400,
            width: 30,
            height: 30,
          ),
        ),
        const SizedBox(
          height: 10,
        ),
        GSSpinner(
          strokeWidth: 3,
          style: GSStyle(
            bg: $GSColors.blueGray700,
            width: 30,
            height: 30,
          ),
        ),
      ],
    )


Edit this page on GitHub