avatar_glow 1.0.0
avatar_glow: ^1.0.0 copied to clipboard
A Flutter package providing a Avatar Glow Widget with cool background glowing animation.
example/lib/main.dart
import 'package:avatar_glow/avatar_glow.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Avatar Glow"),
),
body: Container(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
Container(
width: double.infinity,
color: Color(0xff686de0),
child: AvatarGlow(
startDelay: Duration(milliseconds: 1000),
glowColor: Colors.white,
endRadius: 100.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
color: Colors.transparent,
child: CircleAvatar(
backgroundImage: AssetImage('assets/images/avatar.png'),
radius: 50.0,
),
),
),
),
SizedBox(
height: 16.0,
),
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
AvatarGlow(
glowColor: Colors.blue,
endRadius: 90.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/images/flutter.png',
height: 60,
),
radius: 40.0,
),
),
),
AvatarGlow(
glowColor: Colors.red,
endRadius: 90.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/images/love.png',
height: 60,
),
radius: 40.0,
),
),
),
],
),
AvatarGlow(
glowColor: Colors.cyan,
endRadius: 60.0,
duration: Duration(milliseconds: 2000),
repeat: true,
showTwoGlows: true,
repeatPauseDuration: Duration(milliseconds: 100),
child: Material(
elevation: 8.0,
shape: CircleBorder(),
child: CircleAvatar(
backgroundColor: Colors.grey[100],
child: Image.asset(
'assets/images/dart.png',
height: 50,
),
radius: 30.0,
),
),
),
],
),
),
),
);
}
}