RemixRemix
Feedback

Spinner

An animated loading spinner component for indicating ongoing processes

Open catalog
Starting Flutter example…
Live Flutter from this checkout’s component catalog. Examples include Fortal styling; the source tab shows the catalog code, not a standalone application.

An animated loading spinner component for indicating ongoing processes.

When to use this

  • Loading states: Show that content or data is being loaded
  • Processing: Indicate that a background process is running
  • Async operations: Display during API calls or file uploads
  • Indeterminate progress: When the completion time is unknown

Basic implementation

Basic implementation

import 'package:flutter/material.dart';
import 'package:remix/remix.dart';

class SpinnerExample extends StatelessWidget {
  const SpinnerExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      spacing: 16,
      children: [
        RemixSpinner(style: styleDefault),
        RemixSpinner(style: styleWithTrack),
        RemixSpinner(style: styleCustomColors),
      ],
    );
  }

  SpinnerStyler get styleDefault {
    return SpinnerStyler().indicatorColor(Colors.blue);
  }

  SpinnerStyler get styleWithTrack {
    return SpinnerStyler()
        .indicatorColor(Colors.green)
        .trackColor(Colors.green.withValues(alpha: 0.2));
  }

  SpinnerStyler get styleCustomColors {
    return SpinnerStyler()
        .indicatorColor(Colors.redAccent)
        .trackColor(Colors.red.withValues(alpha: 0.15))
        .duration(2.s);
  }
}

Fortal widgets

The application-owned Fortal preset provides a themed widget for this component:

Fortal widget

import 'package:flutter/material.dart';
import 'ui/ui.dart';

class FortalSpinnerExample extends StatelessWidget {
  const FortalSpinnerExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Row(
      spacing: 16,
      children: [
        FortalSpinner(size: FortalSpinnerSize.size2),
        FortalSpinner(size: FortalSpinnerSize.size3),
      ],
    );
  }
}

See the fortalSpinnerStyle source code for all available options.

Constructor

Constructor

import 'package:flutter/material.dart';
import 'package:remix/remix.dart';

RemixSpinner remixSpinnerConstructor({
  Key? key,
  String? semanticsLabel,
  String? semanticsValue,
  SpinnerStyler style = const SpinnerStyler.create(),
  SpinnerSpec? styleSpec,
}) => throw UnimplementedError();

Properties

Widget Properties

style → SpinnerStyler

Optional. The style configuration for the spinner. Customize colors, sizing, stroke, and animation duration.

styleSpec → SpinnerSpec?

Optional. A pre-resolved style spec that bypasses style resolution. Useful for performance when sharing resolved styles across multiple instances.

key → Key?

Optional. Controls how one widget replaces another widget in the tree.

semanticsLabel → String?

Optional. The accessible name for a non-decorative loading spinner. When omitted, the spinner remains decorative.

semanticsValue → String?

Optional. Status text announced with semanticsLabel.

Style Methods

size(double value)

Sets the spinner size (width and height).

indicatorColor(Color value)

Sets the color of the spinning indicator.

trackColor(Color value)

Sets the color of the track (background ring).

strokeWidth(double value)

Sets the stroke width of the indicator.

trackStrokeWidth(double value)

Sets the stroke width of the track.

duration(Duration value)

Sets the duration of one full rotation.

animate(AnimationConfig value)

Configures implicit animation for style transitions.

wrap(WidgetModifierConfig value)

Applies widget modifiers such as clipping, opacity, or scaling.

call({Key? key, String? semanticsLabel, String? semanticsValue})

Creates a RemixSpinner widget with this style applied.

View page source on GitHub

On this page