animated_gradient_background 0.0.1 copy "animated_gradient_background: ^0.0.1" to clipboard
animated_gradient_background: ^0.0.1 copied to clipboard

A Flutter package for creating animated gradient backgrounds.

Animated Gradient Background #

A Flutter library for creating animated gradient backgrounds.

Description #

This package allows you to create animated gradient backgrounds with customizable colors, stops, alignments, and animation duration.

Demo #

Features #

  • Animate the hue of gradient colors over time.
  • Customize the gradient with multiple colors, stops, and alignments.
  • Control the animation duration.

Getting Started #

To use this package, add animated_gradient_background as a dependency in your pubspec.yaml file.

dependencies:
  animated_gradient_background: 0.0.1

Usage #

Import the package in your Dart file:

import 'package:animated_gradient_background/animated_gradient_background.dart';

Wrap your widget with AnimatedGradientBackground:

AnimatedGradientBackground(
  colors: [Colors.red, Colors.blue, Colors.green],
  child: YourWidget(),
)

Parameters #

Parameter Type Description
child Widget The widget to display on top of the gradient background.
colors List<Color> The list of colors to use in the gradient.
stops List<double>? The list of stops for the gradient.
begin Alignment The beginning alignment of the gradient.
end Alignment The ending alignment of the gradient.
duration Duration The duration of the gradient animation.

Example #

import 'package:flutter/material.dart';
import 'package:animated_gradient_background/animated_gradient_background.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: AnimatedGradientBackground(
          colors: [Colors.red, Colors.blue, Colors.green],
          child: Center(
            child: Text(
              'Hello, World!',
              style: TextStyle(fontSize: 24, color: Colors.white),
            ),
          ),
        ),
      ),
    );
  }
}

License #

This project is licensed under the MIT License - see the LICENSE file for details.

Author #

Developed by Huss Russ. Connect with me on LinkedIn.

3
likes
160
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for creating animated gradient backgrounds.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on animated_gradient_background