Code Monkey home page Code Monkey logo

material_design_icons_flutter's People

Contributors

bambinoua avatar davidmartos96 avatar guyluz11 avatar harsimranmaan avatar itsjimi avatar maskys avatar viliusp avatar ziofat avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

material_design_icons_flutter's Issues

Icon Request: Share variant off

Hey there,
you already provide a share-off icon.
I'd like to use this on the share variant icon.
Would you create that icon?
Thank you very much!

Error with MdiIcons.fromString

Hi,
I'm trying to dynamically add an icon but it can be wrong and when i use MdiIcons.fromString() with a wrong icon, i got this error:

The method 'toRadixString' was called on null.
Receiver: null
Tried calling: toRadixString(16)

I think it could be nice to return something like null if the icon doesn't exist.
I made a simple pull request to handle error, i don't know if it's the right way.
#15

Thanks

It would be nice to get the icon by string for late binding

Hello, thank you for this great package.
I using late binding and would like to define Icons by there name like MdiIcons('sword').
That would allow me to define the icons in the domain without the reference of the package and I could create the UI dynamically in run-time.

Add Support for Flutter 2.0 with Null Safety

Most of the users were started updating to Flutter 2.0 with Null Safety, unfortunately this package not yet reached null safety version. Please have us null safety version of this package as soon as possible.

Thanks for contributing!

Missing cross

I noticed this looking for some icons, one of which is cross. While it is present in the official site:

image

I couldn't find it in the flutter release. I also tried the web demo you make available and it is not present also there.

Any idea why that happens? Thanks a ton!

const Map/List of all IconData

As it looks to me the package is auto generated based on the MDI font.
(Or that is how i've done it with the simple icons package)

Please consider adding a static list, where one can get all the icons at one.
Example:

static const List<IconData> all = [
    MdiIcons.abTesting,
  ];

Every user of the library could implement this themself, but with so many icons this would take a lot of time.
Under the premise that the mdi.dart is autogenerated, this might be just one line of code for you 🙏 .

Example Use Case:
There is the icon_picker which takes a Map<String, IconData> of icons. For performance improvements an already existing const List or Map of IconData might be beneficial.

The icons are all a little de-centered

If you put an icon from the material "Icons" inside a coloured Container, you'll notice it is perfectly centered. If you do so with any of the "MdiIcons" (even if you pick an icon that is also on the standard material library) you'll see it has a bit of a top padding and that breaks most of the buttons that use this library because seeing a FloatingActionButton with a non centered icon in it is not that pretty.

Is there even a solution to this?

Wrong Icons presented.

I have no idea why but when I call:

                                icon: const Icon(
                                  MdiIcons.arrowSplitHorizontal,
                                ),

I get:
image

All icons are wrong, I even tried by name same effect. Any idea why ?

Missing icons

This library is missing some of the official material design icons.

For example, "fast rewind"

Are there any plans to add these at some point?

Breaking changes in 3.4.5045

This commit broke our app: d1899c9

Lots of icons have different identifiers, for example settingsOutline is now cog. In my opinion this should be a major version bump to 4.x.

Mdi-blank not implemented

Why is mdi-blank not implemented?
It has been with MDI since version 1.7.
Please include it as there are some good use cases for it.
Thanks.

tree shake not working correctly

Hi,

I am using Flutter 3.10.4 and version 7.0.7296 of this library.
I noticed that somehow the tree shaking does not work correctly.

Maybe it has something to do with the changes in Flutter 3.10 (tree shake does now work for web as well)?

In my project I only use MdiIcons.XXX. Nothing dynamic. I use around 125 icons.
In an older version the tree shaken materialdesignicons-webfont.ttf was 18KB. Now its size is 1MB.
The Flutter build says:
Font asset "materialdesignicons-webfont.ttf" was tree-shaken, reducing it from 1279992 to 1034252 bytes (19.2% reduction).
Something is shaken off but not all of it. I looked into the ttf file with an online font viewer and there I see a lot of icons that are not used in my project.

Any idea where the problem comes from? Is there a bug?

Regards,
Florian

Add icon in comments to be able to preview it

Would be cool, if we could use the same logic that the inbuilt material icons use to display the icon in the autocomplete feature of the IDE.

/// <i class="material-icons-round md-36">timer_off</i> &#x2014; material icon named "timer off" (round).
static const IconData timer_off_rounded = IconData(0xf023b, fontFamily: 'MaterialIcons');

/// <i class="material-icons-outlined md-36">timer_off</i> &#x2014; material icon named "timer off" (outlined).
static const IconData timer_off_outlined = IconData(0xf449, fontFamily: 'MaterialIcons');

/// <i class="material-icons md-36">tips_and_updates</i> &#x2014; material icon named "tips and updates".
static const IconData tips_and_updates = IconData(0xf058d, fontFamily: 'MaterialIcons');

Like this:

image

Update to 6.6.96

Current version is based on Material Design Icons 6.5.95.
Latest Material Design Icons version is 6.6.96.

Could you update this package to the latest version?

[web] Incorrect trimming result

Only the Web. This example uses the same code with the same icon in MDI and in the native implementation. In this case, the icon is shifted in the MDI:

import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';

void main() async {
  runApp(App());
}

class App extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.light(),
      home: AppCore(),
    );
  }
}

class AppCore extends StatefulWidget {
  @override
  _AppCoreState createState() => _AppCoreState();
}
class _AppCoreState extends State<AppCore> {

  
  @override
  Widget build(BuildContext context) {
    return Row( crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          child: Icon(Icons.check_box_outline_blank, size: 68),
          // child: Icon(MdiIcons.checkboxBlankOutline, size: 68),
          decoration: BoxDecoration( color: Colors.red ),
          clipBehavior: Clip.antiAlias,
        )
      ],
    );
  }
}

Native:

Screenshot 2020-10-19 at 11 04 37

MDI:

Screenshot 2020-10-19 at 11 05 41

"This application cannot tree shake icons fonts" error occurs after upgrading flutter to 1.22.0, breaking build

After upgrading flutter to 1.22.0, the following error occurred when trying to build the Android App bundle

This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:
  - file:///C:/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/material_design_icons_flutter-4.0.5655/lib/material_design_icons_flutter.dart:5680:12
                                                                        
                                                                        
FAILURE: Build failed with an exception.

* Where:
Script 'C:\Dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\Dev\flutter\bin\flutter.bat'' finished with non-zero exit value 1

Pass static analysis

This package can get more points in pub.dev by formating all the code with
flutter format .

image

Strange version number

Why does this package version is "5.0.6595"?.

It will be more professional to just increase the version to 5.1.0 wouldn't it?

Each new release changes the values stored in icon_map.dart

Is there a way to preserve the values for the icon keys that you store in icon_map.dart ? It seems that each new release of this plugin - keys change values which will result in misleading and incorrect icons being displayed in apps that use this plugin.

Use case :

  • Sometimes it is necessary to store the value for an icon in (say) firebase.
  • When you are dealing with thousands of users, its more cost effective to store the icon value as an int rather than the keyname

Thus, if the unicode integer value is stored and you then give a completely different value to a key that an app has previously persisted you end up with incorrect icons being shown.

A code solution
I appreciate that one can store the keyname but doing so in this way will 1) prevent tree shaking and 2) incur more in terms of cloud costs since strings incur more overhead than ints in cloud firestore.

image

To insulate against this problem, when you use one of the 3rd party apps/websites that creates a TTF from an SVG - one can specify a starting offset position as the basis for creating a unique unicode value. All we need to do is ensure that the unicode offset position is 1 more than the last icon unicode value in icon_map.

This assumes that values in icon_map are sequential.

Performance issues: Delayed startup and application crashes

What happened to me:

  • In the last week, my app's startup time has become super long, 45 seconds or more, every time I debug it.
  • After the app successfully runs and displays the ui, a few random swipes and the whole app gets stuck and freezes for upwards of 110 seconds.
  • With luck, the app goes back to normal, with bad luck, the whole app crashes and exits.

I used a process of elimination to remove, one by one, packages that I thought might be affecting performance, such as firebase suite, admob, unityads, etc. After about 8 hours, I really never expected that it would be material_design_icons_flutter, and it was because I really couldn't suspect it that I ranked it to the last.

In DevTools-Memory, you can see what it did, and yes, it loaded all the resources into memory, which obviously can't be done instantly.

Snipaste_2024-04-29_00-30-37

After removing this package, there are no more delayed starts and app crashes.

My environment:
Device • Google Pixel 7
Flutter 3.19.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 54e66469a9 (11 days ago) • 2024-04-17 13:08:03 -0700
Engine • revision c4cd48e186
Tools • Dart 3.3.4 • DevTools 2.31.1

Import not working - Target of URI doesn't exist

Hello,

When trying to import the library package:material_design_icons_flutter/material_design_icons_flutter.dart into my dart file it says that the "Target of URI doesn't exist".

  • I added the material_design_icons_flutter: 2.7.94 dependency in my pubspec.yaml
  • Ran "flutter packages get" and had an exit code 0
  • Currently have Flutter v0.8.2

Thanks in advanced!

Unsupported icon package: Package always displays blank icon previews.

Hi, I want to be able to see MdiIcons on the gutter of Android Studio.

When I set up Preferences > Languages & Frameworks > Flutter Font Packages value to material_design_icons_flutter, it shows this popup at the bottom right:

image

Also the pull request for this feature (flutter/flutter-intellij#5595) explicitly states that the icons are blank:
image
(image from that pull request)

As you can see, line 18 with MdiIcons icon has no gutter preview.

Can you please fix this?

Null safety migration

Please can you please migrate to null safety as its difficult to use this package with a project already using null safety

cannot tree shake when build web

Hello, I come across a question about this package cannot tree shake when build web.
The error is
`
This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

  • file:///Users/suchengyu/.pub-cache/hosted/pub.flutter-io.cn/material_design_icons_flutter-6.0.7096/lib/material_design_icons_flutter.dart:7124:12
  • file:///Users/suchengyu/.pub-cache/hosted/pub.flutter-io.cn/material_design_icons_flutter-6.0.7096/lib/material_design_icons_flutter.dart:7130:12
    Target web_release_bundle failed: Exception: Avoid non-constant invocations of IconData or try to build again with --no-tree-shake-icons.
    `
    However, I dont find fromString method and [] method in my code. Is there any possibility we ignored?

The package version I use is 6.0.7096.

flutter doctor information:

[✓] Flutter (Channel master, 3.8.0-14.0.pre.6, on macOS 13.2.1 22D68 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.75.1)
[✓] Connected device (4 available)

Wish for your reply!

Missing and wrong icons?

Hi, any plans to address missing and wrong icons? For example, the GROUP icon is supposed to show to people but shows a "select" icon, the construction and handyman icons are missing, and so on.

Material Design Icons cannot be used with Dart SDK 2.1.0

I get the following error:

Because *app_name depends on material_design_icons_flutter >=2.3.50 which requires SDK version >=1.19.0 <2.0.0, version solving failed.
pub upgrade failed (1)

Could you kindly update the dependencies so that it can work with the following?

Flutter 0.6.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 9299c02cf7 (2 weeks ago) • 2018-08-16 00:35:12 +0200
Engine • revision e3687f70c7
Tools • Dart 2.1.0-dev.0.0.flutter-be6309690f

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.