animated_gradient 0.0.3 copy "animated_gradient: ^0.0.3" to clipboard
animated_gradient: ^0.0.3 copied to clipboard

plugin to create animated gradient background with muliple color in flutter project

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AnimatedGradient Demo',
      theme: ThemeData(useMaterial3: true, primarySwatch: Colors.blueGrey),
      home: const MyHomePage(title: 'AnimatedGradient Demo Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: AnimatedGradient(
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
                style: Theme.of(context).textTheme.headline6,
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.headline3,
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
15
likes
160
pub points
81%
popularity

Publisher

unverified uploader

plugin to create animated gradient background with muliple color in flutter project

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

flutter

More

Packages that depend on animated_gradient