A Flutter widget that creates a star trails animation effect with circular motion, fading inner radii, and shorter trails near the center.
Depend on it
Run this command:
With Flutter:
$ flutter pub add star_trail
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
star_trail: ^1.0.0
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:star_trail/star_trail.dart';
Add the star_trail.dart
file to your project and use it as follows:
import 'package:flutter/material.dart';
import 'package:star_trail/star_trail.dart'; // Import the package
void main() {
runApp(MaterialApp(
home: Scaffold(
body: StarTrail(),
),
));
}
- Number of Stars: 250 (customizable via numberOfStars)
- Duration: 180 seconds for one full rotation
- Fading Effect: Inner 10% of stars fade in opacity and have shorter trails
- Package: star_trail ^1.0.0
- Pub.dev: https://pub.dev/packages/star_trail
By Lakshman Turlapati