A graphical icon widget drawn with a glyph from a font described in an IconData such as material's predefined IconDatas in Icons.
Icons are not interactive. For an interactive icon, consider material's IconButton.
There must be an ambient Directionality widget when using Icon. Typically this is introduced automatically by the WidgetsApp or MaterialApp.
This widget assumes that the rendered icon is squared. Non-squared icons may render incorrectly.
const Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
Icons.favorite,
color: Colors.pink,
size: 24.0,
semanticLabel: 'Text to announce in accessibility modes',
),
Icon(
Icons.audiotrack,
color: Colors.green,
size: 30.0,
),
Icon(
Icons.beach_access,
color: Colors.blue,
size: 36.0,
),
],
)
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
class MyFlutterWidget extends StatelessWidget {
Widget build(BuildContext context) {
return IconButton(
// Use the FluentIcons + name of the icon you want
icon: Icon(FluentIcons.access_time_24_regular),
onPressed: () { print("Button pressed"); }
);
}
}