glitters 0.1.4
glitters: ^0.1.4 copied to clipboard
A glittering widget for Flutter, handy for making part of your app a little shiny.
Glitters #
A glittering widget for Flutter.
What it does #
This package provides two types of widgets:
- Glitters
- The main widget of this package that fades in and out glitter-like shapes one by one inside itself. This will be useful when you want some part of your app to look shiny.
- SingleGlitter
- Just an extra widget to draw a single static glitter-like shape.
Code examples #
Simplest
const ColoredBox(
color: Colors.black,
body: Glitters(),
)
Multiple glitters
SizedBox(
width: 200.0,
height: 200.0,
child: Stack(
children: const <Widget>[
SizedBox.expand(
child: ColoredBox(color: Colors.black),
),
Glitters(
interval: Duration(milliseconds: 300),
maxOpacity: 0.7,
color: Colors.orange,
),
Glitters(
duration: Duration(milliseconds: 200),
outDuration: Duration(milliseconds: 500),
interval: Duration.zero,
color: Colors.white,
maxOpacity: 0.5,
),
],
),
)
A single static glitter
const ColoredBox(
color: Colors.black,
child: SingleGlitter(size: 100.0),
)
Note #
Glitters uses LayoutBuilder for obtaining the constraints to decide on drawing positions. Make sure that it is not unconstrained to avoid related errors.