ziofat / material_design_icons_flutter

The Material Design Icons (https://materialdesignicons.com/) Icon pack available as set of Flutter Icons.
MIT License
166 stars 33 forks source link

Error with MdiIcons.fromString #14

Closed ItsJimi closed 4 years ago

ItsJimi commented 4 years ago

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. https://github.com/ziofat/material_design_icons_flutter/pull/15

Thanks

ziofat commented 4 years ago

The PR looks good to me. I will publish it soon.

ziofat commented 4 years ago

Published in 3.3.4595, thanks for your contribution.