twinkling_stars 1.0.3 copy "twinkling_stars: ^1.0.3" to clipboard
twinkling_stars: ^1.0.3 copied to clipboard

A customizable twinkling star background for Flutter apps, supporting multi-color and multiple shapes.

🌟 Twinkling Stars #

A beautiful, customizable twinkling star background widget for Flutter apps.
Supports multiple star shapes, colors, and star sizes. Perfect to decorate your UI with starry backgrounds.


πŸ”§ Installation #

Add the package to your pubspec.yaml dependencies:

dependencies:
  twinkling_stars: ^1.0.3

Then run:

flutter pub get

βš™οΈ Features #

  • Customizable number of stars (starCount)
  • Option to include big stars (includeBigStars)
  • Supports multiple star colors (starColors)
  • Supports multiple star shapes (starShapes)
  • Custom star size multiplier (sizeMultiplier)
  • Can be used with multiple widgets/screens independently
  • Allows a child widget to be placed over the star background

πŸš€ Usage #

Wrap your widget with TwinklingStarsBackground:

TwinklingStarsBackground(
  starCount: 150,
  includeBigStars: true,
  sizeMultiplier: 1.5,
  starColors: [
    Colors.white,
    Colors.lightBlueAccent,
    Colors.amberAccent,
    Colors.pinkAccent,
  ],
  starShapes: [
    StarShape.star5,
    StarShape.diamond,
    StarShape.fivePoint,
    StarShape.sparkle4,
  ],
  child: Center(
    child: Container(
      padding: const EdgeInsets.all(24),
      decoration: BoxDecoration(
        color: Colors.black.withOpacity(0.6),
        borderRadius: BorderRadius.circular(16),
      ),
      child: const Text(
        'Twinkling Stars ✨',
        style: TextStyle(
          fontSize: 28,
          color: Colors.white,
          fontWeight: FontWeight.bold,
        ),
      ),
    ),
  ),
)

πŸ“š Properties #

Property Type Description
starCount int Total number of stars to display
includeBigStars bool Whether to include some larger stars
starColors List List of colors used randomly for the stars
starShapes List List of star shapes used randomly for the stars
sizeMultiplier double Multiplies the base size of all stars (default: 1.0)
child Widget Widget displayed on top of the star background

πŸ“Έ Preview #

Twinkling Stars


πŸ“‚ Example #

See the full example in the example/main.dart file.


3
likes
140
points
74
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable twinkling star background for Flutter apps, supporting multi-color and multiple shapes.

Repository (GitHub)
View/report issues

Topics

#background #animation #stars #flutter #ui

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on twinkling_stars