我正在使用从fluttericons.com生成的自定义颤振图标。但这里的问题是我的图标没有出现。它在预览中显示带有删除符号的矩形框,如下所示。(参考下图)

这是我的自定义图标按钮小部件的代码片段。
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),
),
);
}
}
如果想制作一个悬停图标按钮。我尝试使用 IconButton 并失败了..有没有办法做到这一点..或者请任何人帮助我摆脱困境。