icofont_flutter 1.5.0
icofont_flutter: ^1.5.0 copied to clipboard
The IcoFont Icon Pack available as Flutter Icon Pack. We are here to elevate your designs with thousands of free icons with smart technologies for smoother usage.
import 'package:flutter/material.dart';
import 'package:icofont_flutter/icofont_flutter.dart';
void main() => runApp(IcoFontExampleApp());
class IcoFontExampleApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(
primaryColor: Color(0xFF494949),
secondaryHeaderColor: Color(0xFF44678c)),
home: IcoFontHome(),
);
}
}
class IcoFontHome extends StatefulWidget {
@override
_IcoFontHomeState createState() => _IcoFontHomeState();
}
class _IcoFontHomeState extends State<IcoFontHome>
with SingleTickerProviderStateMixin {
double abacusSize = 50.0;
bool isTaped = false;
bool isPlayed = false;
late AnimationController _controller;
@override
void initState() {
super.initState();
isTaped = false;
_controller = AnimationController(
duration: const Duration(seconds: 100),
vsync: this,
)..repeat();
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('IcoFont Flutter Example'),
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 5.0, vertical: 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
// direction: Axis.horizontal,
children: <Widget>[
InkWell(
onTap: () {
setState(() {
isTaped = !isTaped;
});
},
child: Container(
color: Colors.red,
padding: EdgeInsets.all(15.0),
child: AnimatedBuilder(
animation: _controller,
child: Icon(IcoFontIcons.abacus),
builder: (BuildContext context, Widget? child) {
return Transform.scale(
scale: isTaped ? _controller.value : 1,
child: child,
);
},
),
),
),
InkWell(
onTap: () {
setState(() {
isTaped = !isTaped;
});
},
child: Container(
color: Colors.red,
padding: EdgeInsets.all(15.0),
child: AnimatedBuilder(
animation: _controller,
child: Icon(IcoFontIcons.abacusAlt),
builder: (BuildContext context, Widget? child) {
return Transform.scale(
scale: isTaped ? _controller.value : 1,
child: child,
);
},
),
),
),
],
),
));
}
}