iridescent_color 0.1.3 iridescent_color: ^0.1.3 copied to clipboard
Flutter package for exempting iridescent effect as color.
iridescent_color #
Is a package that uses device movements to calculate a change of customizable colors for flutter.
⭐ Features #
-
🛠️ Custom - It uses a customized color palette to simulate the effect.
-
🌈 Raimbow - It uses the entire color spectrum to simulate the effect.
⚙️ Getting started #
Install the package in your project via command
flutter pub add iridescent_color
Or, add to pubspec.yaml file
dependencies:
iridescent_color: ^0.1.3
⚡ Basic usage #
Import the package in your code
import 'package:iridescent_color/iridescent_color.dart';
Use it this way (Example)
/// Create the library instance
IridescentColor iridescentColor = IridescentColor();
Color iridescentColorRainbow = Colors.transparent; //Set default/initial color here
Color iridescentColorCustom = Colors.transparent; //Set default/initial color here
/// In initState
@override
void initState() {
super.initState();
iridescentColor.init(
() => setState(
() {
iridescentColorRainbow = iridescentColor.rainbow();
iridescentColorCustom = iridescentColor.custom(
colorList: [
Colors.white,
Colors.red,
Colors.green,
Colors.blue,
],
);
},
),
);
}
/// In dispose
@override
void dispose() {
super.dispose();
iridescentColor.dispose();
}