twinkling_stars 1.0.3

SDKflutter
Platformandroidioswindowslinuxmacosweb

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

PropertyTypeDescription
starCountintTotal number of stars to display
includeBigStarsboolWhether to include some larger stars
starColorsListList of colors used randomly for the stars
starShapesListList of star shapes used randomly for the stars
sizeMultiplierdoubleMultiplies the base size of all stars (default: 1.0)
childWidgetWidget displayed on top of the star background

📸 Preview

Twinkling Stars


📂 Example

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