gradient_background_generator 0.0.2 copy "gradient_background_generator: ^0.0.2" to clipboard
gradient_background_generator: ^0.0.2 copied to clipboard

A Flutter package to generate gradient backgrounds with various patterns and styles.

example/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Column(
          children: [
            SizedBox(
              height: MediaQuery.sizeOf(context).height * .25,
              child: const AnimatedGradientBackground(
                angle: 0.4,
                style: GradientStyle.linear,
                colorSets: [GradientPreset.levi, GradientPreset.azureLane],
                duration: Duration(seconds: 2),
                direction: GradientDirection.leftToRight,
              ),
            ),
            SizedBox(
              height: MediaQuery.sizeOf(context).height * .25,
              child: const GradientBackground(
                angle: 1,
                style: GradientStyle.sweep,
                colors: GradientPreset.boogieWonderland,
                direction: GradientDirection.leftToRight,
              ),
            ),
            SizedBox(
              height: MediaQuery.sizeOf(context).height * .25,
              child: const GradientBackground(
                style: GradientStyle.radial,
                colors: GradientPreset.diesel,
                direction: GradientDirection.leftToRight,
              ),
            ),
            SizedBox(
              height: MediaQuery.sizeOf(context).height * .25,
              child: const AnimatedGradientBackground(
                angle: 0.9,
                style: GradientStyle.sweep,
                colorSets: [
                  GradientPreset.diesel,
                  GradientPreset.frozen,
                ],
                duration: Duration(seconds: 2),
                direction: GradientDirection.rightToLeft,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
3
likes
130
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to generate gradient backgrounds with various patterns and styles.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on gradient_background_generator