animate_gradient 0.0.2 animate_gradient: ^0.0.2 copied to clipboard
This Package lets you make animated gradients without any hassle. Just pass the primary and secondary colors and you're done.
import 'package:animate_gradient/animate_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 const MaterialApp(
title: 'Animated Gradient',
home: App(),
);
}
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: AnimateGradient(
primaryBegin: Alignment.topLeft,
primaryEnd: Alignment.bottomLeft,
secondaryBegin: Alignment.bottomLeft,
secondaryEnd: Alignment.topRight,
primaryColors: const [
Colors.pink,
Colors.pinkAccent,
Colors.white,
],
secondaryColors: const [
Colors.white,
Colors.blueAccent,
Colors.blue,
],
child: const Center(
child: Text(
'Animated Gradient',
style: TextStyle(
fontSize: 36,
color: Colors.white,
),
),
),
),
);
}
}