I'm using Custom flutter icons which is generated from fluttericons.com .But here the problem is my icons are not appeared as it. It shows rectangular box with strikeout symbol in preview like this. (Refer the image below )
Here is my code snippet for my Custom icon button widget.
import 'package:flutter/material.dart';
import 'package:show_up_animation/show_up_animation.dart';
import 'social_media_icons.dart';
import 'constants.dart';
class AnimativeIcons extends StatefulWidget {
@override
_AnimativeIconsState createState() => _AnimativeIconsState();
}
class _AnimativeIconsState extends State<AnimativeIcons> {
@override
Widget build(BuildContext context) {
return ResponsiveWidget(
largeScreen: Wrap(
direction: Axis.horizontal,
alignment: WrapAlignment.spaceBetween,
spacing: 20.0,
children: <Widget>[
AnimatedButton(
hoverIconData: SocialMediaIcons.github,
delay: 200,
url: "https://www.google.com"),
AnimatedButton(
hoverIconData: SocialMediaIcons.linkedin,
delay: 400,
url: "https://www.google.com"),
AnimatedButton(
hoverIconData: SocialMediaIcons.hackerrank,
delay: 600,
url: "https://www.google.com"),
AnimatedButton(
hoverIconData: SocialMediaIcons.twitter,
delay: 800,
url: "https://www.google.com"),
AnimatedButton(
hoverIconData: SocialMediaIcons.instagram,
delay: 1000,
url: "http://www.google.com"),
AnimatedButton(
hoverIconData: SocialMediaIcons.gmail,
delay: 1200,
url: "www.google.com"),
],
),
);
}
}
class AnimatedButton extends StatefulWidget {
final Color animationColor;
final IconData hoverIconData;
final int delay;
final String url;
AnimatedButton(
{this.animationColor, this.hoverIconData, this.delay, this.url});
@override
_AnimatedButtonState createState() => _AnimatedButtonState();
}
class _AnimatedButtonState extends State<AnimatedButton>
with SingleTickerProviderStateMixin {
_launchURL(String goToUrl) async {
String url = goToUrl;
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Color iconColor;
@override
void initState() {
super.initState();
iconColor = ButtonColor.hoverColor;
}
@override
Widget build(BuildContext context) {
return ShowUpAnimation(
animationDuration: Duration(seconds: 1),
delayStart: Duration(milliseconds: widget.delay),
curve: Curves.easeIn,
direction: Direction.vertical,
offset: 1.0,
child: InkWell(
onTap: () {
_launchURL(widget.url);
print('pressed');
},
onHover: (value) {
if (value) {
setState(() {
iconColor = widget.animationColor;
});
} else {
setState(() {
iconColor = ButtonColor.hoverColor;
});
}
},
child: Icon(widget.hoverIconData, size: 50, color: iconColor),
),
);
}
}
If want to make a hover icon button.I tried with IconButton and failed ..Is there any way to do it..or please any one help me to get out from this.