Skip to content

Instantly share code, notes, and snippets.

@JosephineAkello
Created May 24, 2024 13:01
Show Gist options
  • Save JosephineAkello/4e0c4c4975fc9cc264cec7b2eef54fa5 to your computer and use it in GitHub Desktop.
Save JosephineAkello/4e0c4c4975fc9cc264cec7b2eef54fa5 to your computer and use it in GitHub Desktop.
Basic splash screen with a lottie asset with animation json file
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class SplashScreen extends StatelessWidget {
const SplashScreen({super.key});
@override
Widget build(BuildContext context) {
return Center(
child: Lottie.asset(
"assets/animations/loginAanim.json",
// Can add other properties on how you would like the anim to display
fit: BoxFit.cover,
width: 300,
height: 300,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment