glitters 0.3.4
glitters: ^0.3.4 copied to clipboard
A glittering widget for Flutter, handy for making part of your app a little shiny.
A glittering widget for Flutter.
What it does #
This package provides three widgets:
- Glitters
- The main widget of this package that fades in and out glitter-like shapes one by one inside itself. This is useful when you want some part of your app to look shiny.
- GlitterStack
- A widget used to show multiple glitters by stacking them.
- SingleGlitter
- A widget to show a single static glitter-like shape.
Code examples #
Simplest
Container(
width: 200.0,
height: 200.0,
color: Colors.black,
child: const Glitters(),
)
Multiple glitters
With Stack
:
SizedBox(
width: 200.0,
height: 200.0,
child: ColoredBox(
color: Colors.black,
child: Stack(
children: const [
Glitters(
duration: Duration(milliseconds: 200),
interval: Duration.zero,
color: Colors.orange,
maxOpacity: 0.7,
),
Glitters(
duration: Duration(milliseconds: 200),
interval: Duration.zero,
delay: Duration(milliseconds: 100),
color: Colors.white,
maxOpacity: 0.7,
),
],
),
),
)
With GlitterStack
:
const GlitterStack(
width: 200.0,
height: 200.0,
backgroundColor: Colors.black,
// You can set common settings for multiple glitters.
duration: Duration(milliseconds: 200),
interval: Duration.zero,
color: Colors.white,
maxOpacity: 0.7,
children: [
Glitters(
color: Colors.orange,
),
Glitters(
delay: Duration(milliseconds: 100),
),
],
)
A single static glitter
const ColoredBox(
color: Colors.black,
child: SingleGlitter(
maxWidth: 100.0,
maxHeight: 100.0,
aspectRatio: 0.8,
),
)