overlay_lottie 1.0.2 copy "overlay_lottie: ^1.0.2" to clipboard
overlay_lottie: ^1.0.2 copied to clipboard

A package that overlays a lottie animation over a widget, during the execution of long tasks

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Overlay Lottie Demo',
      home: LottieOverlayHome(),
    );
  }
}

class LottieOverlayHome extends StatefulWidget {
  const LottieOverlayHome({super.key});

  @override
  State<LottieOverlayHome> createState() => _LottieOverlayHomeState();
}

class _LottieOverlayHomeState extends State<LottieOverlayHome>
    with TickerProviderStateMixin, OverlayLottie {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: null,
      body: buildWithLottieOverlay(
          animationUrl:
              "https://assets6.lottiefiles.com/packages/lf20_fj8rlma5.json",
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                ElevatedButton(
                    onPressed: () => showLottieOverlay(repetitions: 3),
                    child: const Text("show Lottie")),
                ElevatedButton(
                    onPressed: () {
                      showLottieOverlayWhile(
                        () async {
                          await Future.delayed(const Duration(seconds: 3));
                        },
                        animationUrl:
                            "https://assets6.lottiefiles.com/packages/lf20_z3pnisgt.json",
                      ).then((value) {
                        showLottieOverlay(
                            animationUrl:
                                "https://assets8.lottiefiles.com/packages/lf20_slGFhN.json");
                      });
                    },
                    child: const Text("simulate login")),
              ],
            ),
          )),
    );
  }
}
1
likes
140
pub points
64%
popularity

Publisher

unverified uploader

A package that overlays a lottie animation over a widget, during the execution of long tasks

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, lottie

More

Packages that depend on overlay_lottie