lottie_loader 0.0.3
lottie_loader: ^0.0.3 copied to clipboard
Flutter Pacakge that can allow you to use lottie animations as loader.
import 'package:flutter/material.dart';
import 'package:lottie_loader/lottie_loader.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Lottie Loader Example',
home: HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Lottie Loader Example')),
body: Center(
child: ElevatedButton(
onPressed: () async {
LoaderOverlay.show(
context,
lottieAnimationPath: 'assets/Animation - 1734834675750.json',
isNetwork: false,
width: 300,
height: 300,
overlayOpacity: 0.6,
overlayColor: Colors.black
);
await Future.delayed(const Duration(seconds: 3));
LoaderOverlay.hide();
},
child: const Text('Show Loader'),
),
),
);
}
}