Contents
Coding With Dhrumil

HomeArticles

Flutter Spinkit: Custom Loading Indicators Done Right

By Dhrumil PatelPublished 3 min read

Loading indicators are the unglamorous widgets that decide whether your app feels responsive or broken. Flutter Spinkit gives you a set of ready-made animated spinners, but dropping one in without understanding frame budgets and rebuild cost can quietly hurt performance.

This article walks through the practical side: installing the package, choosing the right spinner, keeping animations cheap, and knowing when a custom widget beats a dependency. Expect concrete numbers you can use during code review.

What Flutter Spinkit Actually Gives You

Spinkit is a collection of animated loading widgets ported from the CSS library of the same name. You get roughly a dozen spinners—rotating planes, a chasing dot, a folding cube, a pulse ring—each implemented as a StatefulWidget driven by an AnimationController. They are small, dependency-free beyond Flutter itself, and drop into any screen.

The appeal is speed: instead of hand-tuning a rotation curve for a 30-minute task, you import the package and pick a widget. Under the hood each spinner runs a repeating animation, typically between 800 ms and 2 seconds per cycle. That is the number that matters for performance, because every frame of that animation triggers a rebuild of the widget subtree it owns.

  • Around 12 spinner styles, from Plane to Wave.
  • Pure Dart, no native platform channels.
  • Configurable color, size, and animation duration.
  • Works with Material, Cupertino, or custom themes.

Installing and Wiring It Up

Add the dependency in pubspec.yaml under dependencies, then run pub get. Spinkit does not require platform setup. Import the package in the file where you need the spinner and return the widget from your build method, usually inside a Center or a SizedBox to constrain its size.

A common mistake is placing the spinner inside a widget that rebuilds often, such as a parent listening to a stream. Each rebuild restarts or reconfigures the animation controller, which can cause visible stutter. Wrap the spinner in a const constructor where possible; that alone can cut rebuild work by a noticeable margin on mid-range devices.

Performance: Frames, Rebuilds, and What to Measure

A single Spinkit spinner animating at 60 fps costs roughly 16.6 ms per frame of budget on the UI thread. On a 120 Hz display that drops to about 8.3 ms. Most spinners are cheap—a few transforms and a paint—but if you stack three of them plus a shimmer effect, you can push frame times past 16 ms on older hardware.

Measure with the Flutter DevTools performance overlay. A healthy spinner screen should sit well under 8 ms of raster time. If you see jank, the fix is rarely the spinner itself; it is usually an expensive parent rebuilding every frame. For animation timing fundamentals, see Flutter Animation Controllers Explained With Timing Numbers.

  • Use const constructors for static spinner instances.
  • Avoid nesting more than two animated widgets in one subtree.
  • Profile on a real mid-range device, not only the simulator.
  • Prefer RepaintBoundary around spinners that sit over complex backgrounds.

Choosing the Right Spinner for the Job

Short waits—under 300 ms—should not show a spinner at all; it reads as a flicker. For 300 ms to 2 seconds, a simple rotating indicator or a pulse works well. Beyond 2 seconds, users need feedback that something is progressing, so a determinate progress bar or a skeleton screen often beats an indeterminate spinner.

Spinkit's more elaborate spinners (FoldingCube, Wave) are visually loud. Reserve them for splash screens or full-screen blocking states. Inline in a list or a button, use a small, quiet spinner at 16–24 logical pixels. Consistency matters more than variety: pick one or two styles and reuse them.

The Real Cost of Adding an Animation Package

Every dependency is a maintenance contract. Spinkit is small and stable, but it still adds to pubspec, affects build times slightly, and must be updated when Flutter changes. For teams shipping on a budget, weigh that against writing a 40-line rotation widget yourself. For early-stage apps, the time saved is usually worth it.

If you are estimating a project, loading states are part of the UI polish that clients notice. A realistic Flutter build in 2026 runs from about $8,000 for a simple app to $60,000+ for a complex one; animation polish is a small but real slice. Our breakdown in What Does a Flutter App Cost to Build in 2026? covers where those hours go.

3Single Spinkit9Spinkit + shimmer14Three spinners6Skeleton screen4Determinate bar
Approximate frame budget used by common loading UIs (ms per frame) (ms)
Spinkit spinner styles compared by typical use case
SpinnerCycle time (approx.)Visual weightBest for
Plane1.2 sLowInline loading in lists
ChasingDots1.5 sMediumButtons and cards
FoldingCube2.0 sHighSplash and full-screen
Pulse1.0 sLowSmall inline indicators
Wave1.6 sMediumEmpty states
RotatingPlain0.9 sLowDefault app-wide spinner

When to Skip Spinkit and Build Your Own

If you need a spinner that matches a brand motion spec, a custom widget is often faster than fighting a package. A basic rotating container with an AnimationController and a Transform.rotate is about 30 lines. You control the curve, the duration, and the semantics label, and you avoid a dependency.

Also build your own when you need determinate progress tied to real work, such as a file upload or a database migration. Spinkit is indeterminate by design. For state management around loading, decide early whether the spinner lives in a StatelessWidget or StatefulWidget; our guide on StatelessWidget vs StatefulWidget: Which One Should You Pick? walks through that decision.

  • Custom widget: ~30 lines, full control over curve and timing.
  • Package: faster to start, consistent across screens.
  • Determinate progress needs a custom or Material solution.
  • Accessibility: add a Semantics label either way.

Key points

  • Spinkit is a quick win for indeterminate loading states, but keep spinners small and few.
  • Profile frame times on real hardware; a single spinner should stay well under 8 ms.
  • Skip the spinner for waits under 300 ms and use determinate progress beyond 2 seconds.
  • Build a custom widget when you need brand motion or determinate progress.

Flutter Screen Widget and Cost Estimator

Estimate the number of widgets in a screen and a rough development-hour figure from your component counts. Adjust the fields to see how each UI area affects the total effort.

Calculate

Dhrumil Patel

Editor and Flutter contributor

Writes practical Flutter tutorials focused on widgets, layout and animation. Enjoys breaking large UI problems into small, testable pieces and explaining them clearly to beginners.

Related articles

Scrolling Widgets Compared: ListView, GridView and CustomScrollView

Matches each scrollable widget to the layout problem it solves with practical examples.

Flutter Installation Checklist for Windows and macOS

A numbered setup checklist covering SDK, editor plugins and emulator verification.

How to Size a RecyclerView Adapter for Smooth Lists

Explains view holder counts, diffing and binding work that affect scroll smoothness.