Giter Site home page Giter Site logo

heroicons's Introduction

HeroIcons

heroicons port to Flutter. This package renders the icons as SVG images.

This package was last updated to use heroicons version 2.1.1 (on February 21st, 2024). If there's a newer version of HeroIcons available, please create an issue or pull request.

Usage

class MyExampleWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return HeroIcon(
      HeroIcons.calendar,
      style: HeroIconStyle.outline, // Outlined icons are used by default.
      color: Colors.red,
      size: 30,
    );
  }
}

You can also use HeroIconTheme to set the default style (e.g., outline or solid) for all icons in your app. (You'll still be able to override the style for individual icons.)

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // ...
      home: HeroIconTheme(
        style: HeroIconStyle.solid,
        child: MyHomePage(),
      ),
    );
  }
}

Install

Add heroicons package into your pubspec.yaml.

dependencies:
  heroicons: # Latest version

You can also run flutter pub add heroicons to quickly add latest version from your CLI.

Development

Fetch new icons and automatically generate source code for heroicons.dart (runs both of the below steps)

dart tool/update.dart

Extra Commands

If, for any reason, you need to run the steps separately, you can do so as follows:

  • Fetch new icons, organize into assets/ and update the README.

    dart tool/fetch_icons.dart

    Optionally, a branch may be specified to fetch icons from. For example, to fetch icons from the dev branch:

    dart tool/fetch_icons.dart dev

    Note that older branches (i.e., v1) won't work yet as the SVGs are organized differently and not all styles are available.

  • Run source code generation to create heroicons.dart file with an enum entry for every icon.

    dart tool/generator.dart

heroicons's People

Contributors

samjakob avatar timcreatedit avatar vaetas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

heroicons's Issues

Error after install `pub finished with exit code 65`

Hi,

An error occurs during installation:

$ flutter pub add heroicons

Because heroicons <0.2.0 depends on flutter_svg ^0.21.0-nullsafety.0 and heroicons >=0.2.0 <0.2.1 depends on flutter_svg ^0.21.0+1, heroicons <0.2.1 requires flutter_svg ^0.21.0-nullsafety.0.

And because heroicons >=0.2.1 depends on flutter_svg ^0.22.0, every version of heroicons requires flutter_svg ^0.21.0-nullsafety.0 or ^0.22.0.

So, because flutter_komentory depends on both flutter_svg ^0.23.0+1 and heroicons any, version solving failed.

pub finished with exit code 65

My config:

$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6.1 20G224 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.62.1)
[✓] Connected device (2 available)

• No issues found!

update dependencies

Because heroicons <0.2.0 depends on flutter_svg ^0.21.0-nullsafety.0 and heroicons >=0.2.0 <0.2.1 depends on flutter_svg ^0.21.0+1, heroicons <0.2.1 requires flutter_svg ^0.21.0-nullsafety.0.
And because heroicons >=0.2.1 <0.4.0 depends on flutter_svg ^0.22.0 and heroicons >=0.4.0 depends on flutter_svg ^0.23.0+1, every version of heroicons requires flutter_svg ^0.21.0-nullsafety.0 or ^0.22.0 or ^0.23.0+1.

Icon Size Nothing Change

Icon size nothing changes.
The icon gets bigger when I want to enlarge it, but when I want to reduce the size by default, nothing changes.

Don't know how to use the generator

Hello, running dart tool/generator.dart doesn't generate the files as it is said in the documentation. Instead I get Error when reading 'tool/generator.dart': No such file or directory. What I'm I doing wrong? I run it in the root of the application.

Incompatible with flutter_test

Since 0.6.0 there is a dependency conflict with flutter_test

Because every version of flutter_test from sdk depends on path 1.8.1 and heroicons >=0.6.0 depends on path ^1.8.2, flutter_test from sdk is incompatible with heroicons >=0.6.0.
So, because [app name] depends on both heroicons ^0.6.0 and flutter_test from sdk, version solving failed.
pub get failed (1; So, because [app name] depends on both heroicons ^0.6.0 and flutter_test from sdk, version solving failed.)

Update dependencies

Because every version of integration_test from sdk depends on path 1.8.0 and heroicons >=0.5.0 depends on path ^1.8.1, integration_test from sdk is incompatible with heroicons >=0.5.0.
So, because float_admin depends on both heroicons ^0.5.0 and integration_test from sdk, version solving failed.
pub get failed (1; So, because float_admin depends on both heroicons ^0.5.0 and integration_test from sdk, version solving failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.