VolkanUstekidag
VolkanUstekidag

Reputation: 375

The getter 'password' isn't defined for the type 'Icons'

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,
    )

enter image description here

Upvotes: 0

Views: 1422

Answers (3)

Timur
Timur

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

Dani3le_
Dani3le_

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

Saiful Islam
Saiful Islam

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

Related Questions