Skip to main content

Flutter animation example

Flutter Onboarding Animation: Animated Intro Pager

Onboarding has a few seconds to explain your app. This pager gives each page a simple animated illustration whose shapes morph into the next page's as you swipe, so the three screens feel like one story. The page dots stretch toward the active page and the Next button turns into Get started on the last one.

  • 4.5 KB file
  • 4 live inputs
  • Flutter runtime
Live, try it

How this onboarding pager works

  • Page position is continuous during a swipe, and the illustration interpolates shape, size and color by it.
  • The active dot's width is 1 - distance, which produces the stretching indicator.
  • Finishing the last page fires "finish"; page changes fire "page".

Add it to your Flutter app

Install exodeui_flutter, download the file below, and paste this. The code updates as you customize. Other runtimes are in the other tabs.

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:exodeui_flutter/exodeui_flutter.dart';

// Add assets/flutter-onboarding-animation.exode to pubspec.yaml (download it below).
class FlutterOnboardingAnimation extends StatefulWidget {
  const FlutterOnboardingAnimation({super.key});
  @override
  State<FlutterOnboardingAnimation> createState() => _FlutterOnboardingAnimationState();
}

class _FlutterOnboardingAnimationState extends State<FlutterOnboardingAnimation> {
  final _canvas = GlobalKey<ExodeUICanvasState>();
  late final Future<String> _json = rootBundle.loadString('assets/flutter-onboarding-animation.exode');

  @override
  Widget build(BuildContext context) {
    return FutureBuilder<String>(
      future: _json,
      builder: (context, snap) => snap.hasData
          ? ExodeUICanvas(
              key: _canvas,
              artboardJson: snap.data!,
              fit: 'Layout',
              onReady: () { },
              onTrigger: (name, _) {
                // fires: 'page', 'finish'
              },
            )
          : const SizedBox.shrink(),
    );
  }
}

Inputs

InputTypeDefaultRange
titlesTextDesign in motion|Logic without code|Ship to every app—
accentText#6366f1hex colour
inkText#1e1b4bhex colour
bgText#eef2ffhex colour

Events: pagefinish

More Flutter animations