material_design_icons_flutter 3.4.5045+1 copy "material_design_icons_flutter: ^3.4.5045+1" to clipboard
material_design_icons_flutter: ^3.4.5045+1 copied to clipboard

outdated

The Material Design Icons from the community for Flutter

material_design_icons_flutter #

The Material Design Icons Icon pack available as set of Flutter Icons.

Based on Material Design Icons 5.0.45, with removed and renamed icons from 4.9.95.

👍 Like us on pub.dev!

Installation #

In the dependencies: section of your pubspec.yaml, add the following line:

  material_design_icons_flutter: 3.4.5045+1

WARNING: MDI's version is based on their icons quantity, which does not strictly respect semver guide. They do try their best to keep icons in same name between minor releases but name changing may still appear. To not break your application, using a fix version in your pubspec.yaml is highly recommended.

Usage #

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'); }
     );
  }
}

Or, if you want to access the icon by a string name, you can use fromString method to create one.

This is not recomended because to make fromString work we need a map for all icon names. Using this method will not get the benifits of tree-shaking.

import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

class MyWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return new IconButton(
      // Use the string name to access icons.
      icon: new Icon(MdiIcons.fromString('sword')),
      onPressed: () { print('Using the sword'); }
     );
  }
}

Name Conversion #

Some icons' name is reversed keyword in Dart (and most other languages), so the names have been changed.

  • null -> nullIcon
  • switch -> switchIcon
  • sync -> syncIcon
  • factory -> factoryIcon
640
likes
30
pub points
99%
popularity

Publisher

verified publisherziofat.dev

The Material Design Icons from the community for Flutter

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on material_design_icons_flutter