flutter_icons 0.3.0

English | 简体中文

flutter_icons #

pub package

Customizable Icons for Flutter,Inspired by react-native-vector-icons

Bundled Icon Sets #

Browse all.

Usage #

To use this plugin, add flutter_icons as a dependency in your pubspec.yaml file.

Widget #

IconToggle #

PropDescription
selectedIconDataIcon is displayed when value is true
unselectedIconDataIcon is displayed when value is false
activeColorWhen value is true, the icon color is displayed
inactiveColorWhen value is false, the icon color is displayed
valueWhether this IconToggle is selected.
onChangedCalled when the value of the IconToggle should change.
durationThe duration of the transition from selected Icon to unselected Icon
reverseDurationhe duration of the transition from unselected Icon to selected Icon
transitionBuilderTransition animation function between the selected Icon and the unselected Icon

Static Methods #

PropDescription
getIconDataReturns the IconData object,eg : IconData iconData = AntDesign.getIconData("stepforward")
hasIconDataChecks if the name is valid in current icon set.eg: bool isNameValid = AntDesign.hasIconData("stepforward")

IconExplorer #

Try to run the example project Or download apk, there you can also search for any icon.

图片名称

Example #

// Import package
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter/material.dart';

Icon(Ionicons.getIconData("ios-search"));
Icon(AntDesign.getIconData("stepforward"));
Icon(FontAwesome.getIconData("glass"));
Icon(MaterialIcons.getIconData("ac-unit"));
Icon(FontAwesome5.getIconData("address-book"));
Icon(FontAwesome5.getIconData("address-book",weight: IconWeight.Solid));
Icon(FontAwesome5.getIconData("500px", weight: IconWeight.Brand));

Special thanks to react native vector ICONS library and its authors #

0.3.0 #

  • WeatherIcons added

0.2.5 #

  • IconToggle added

0.2.0 #

  • FontAwesome5_Free added

0.1.5 #

  • Update MaterialCommunityIcons to version 4.0.96

0.1.4 #

  • Add hasIconData method

0.1.3 #

  • Foundation added

0.1.0 #

  • This library contains several icon libraries, including the well-known ant-design icon library, material icon library, and so on

example/README.md

example #

A new Flutter application.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_icons: ^0.3.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_icons/flutter_icons.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
95
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
97
Learn more about scoring.

We analyzed this package on Sep 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.76 points)

122 out of 123 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/ionicons.dart. (-0.50 points)

Analysis of lib/ionicons.dart reported 1 hint:

line 2 col 8: Unused import: 'package:flutter/material.dart'.

Format lib/ant_design.dart.

Run flutter format to format lib/ant_design.dart.

Format lib/entypo.dart.

Run flutter format to format lib/entypo.dart.

Fix additional 11 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/evil_icons.dart (Run flutter format to format lib/evil_icons.dart.)
  • lib/feather.dart (Run flutter format to format lib/feather.dart.)
  • lib/flutter_icon_data.dart (Run flutter format to format lib/flutter_icon_data.dart.)
  • lib/font_awesome.dart (Run flutter format to format lib/font_awesome.dart.)
  • lib/foundation.dart (Run flutter format to format lib/foundation.dart.)
  • lib/icon_toggle.dart (Run flutter format to format lib/icon_toggle.dart.)
  • lib/material_community_icons.dart (Run flutter format to format lib/material_community_icons.dart.)
  • lib/material_icons.dart (Run flutter format to format lib/material_icons.dart.)
  • lib/octicons.dart (Run flutter format to format lib/octicons.dart.)
  • lib/simple_line_icons.dart (Run flutter format to format lib/simple_line_icons.dart.)
  • lib/zocial.dart (Run flutter format to format lib/zocial.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test