Reputation: 375
The icons I selected appear to be undefined even though they are in the class. What is the reason for this?
Icon(
Icons.password,
color: iconColor,
)
Upvotes: 0
Views: 1422
Reputation: 1343
You can use material_design_icons_flutter package.
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
class MyWidget extends StatelessWidget {
Widget build(BuildContext context) {
return new IconButton(
// Use the MdiIcons class for the IconData
icon: new Icon(MdiIcons.sword),
onPressed: () { print('Using the sword'); }
);
}
}
Upvotes: 0
Reputation: 1463
Check if in your pubspec.yaml
the section uses-material-design
is set to true.
After seeing your flutter doctor
output: try upgrading your version by using flutter upgrade
. Then, run flutter clean
and then flutter run
in terminal.
Upvotes: 0
Reputation: 599
Open your cmd or android studio terminal and type[flutter doctor, then flutter doctor --android-licenses] and accept all of the licenses that terminal suggest you.
Upvotes: 1