zo_animated_border 0.0.5
zo_animated_border: ^0.0.5 copied to clipboard
A package that provides a modern way to create gradient borders with animation in Flutter
import 'package:flutter/material.dart';
import 'package:zo_animated_border/zo_animated_border.dart';
import 'dart:ui' as ui;
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: MyHomePage(title: 'Zo Animated Borders'),
// const AnimatedGradientBorderScreen(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(horizontal: 20),
child: Container(
alignment: Alignment.centerLeft,
child: Text("Breathing Border",
style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold))),
),
SizedBox(
height: 20,
),
SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ZoBreathingBorder(
borderWidth: 3.0,
borderRadius: BorderRadius.circular(16),
colors: [
Colors.blue,
Colors.purple,
Colors.red,
Colors.orange
],
duration: const Duration(seconds: 4),
child: Container(
width: 150,
height: 150,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
alignment: Alignment.center,
child: const Text(
'Breathing Border',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
),
ZoBreathingBorder(
borderWidth: 3.0,
borderRadius: BorderRadius.circular(75),
colors: [
Colors.blue,
Colors.purple,
Colors.red,
Colors.orange
],
duration: const Duration(seconds: 4),
child: Container(
width: 150,
height: 150,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(75),
),
alignment: Alignment.center,
child: const Text(
'Breathing Border',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16, fontWeight: FontWeight.bold),
),
),
),
]))
],
),
),
// This trailing comma makes auto-formatting nicer for build methods.
);
}
}