outline_material_icons icon indicating copy to clipboard operation
outline_material_icons copied to clipboard

Please, remove privacy statement of method `_OMIconData()`, like the `IconData()`.

Open chinnonsantos opened this issue 4 years ago • 0 comments

https://github.com/lucaslcode/outline_material_icons/blob/1df0d40e4de2856d6b35c54ae54cb9ec5fa70418/lib/outline_material_icons.dart#L3041

Using out-of-class OMIconData() allows you to work dynamically with icons, for example:

  • With IconData
    // This can come from a remote JSON (HTTP)!!!
    List<Map<String, dynamic>> _userButtonList = [
      {
        'icon': 0xe5ca, // Icons.check
        'txt': 'Button 1',
      },
      {
        'icon': 0xe169, // Icons.unarchive
        'txt': 'Button 2',
      },
    ];

    List _buttonListWidgets = <Widget>[];

    // Builder buttons for ListView
    Widget _buildButtonList(int icon, String txt) {
      return Container(
        height: 30,
        child: Column(
          children: <Widget>[
            Icon(IconData(icon, fontFamily: 'MaterialIcons')),
            Text(txt),
          ],
        ),
      );
    }

    // Builder the Widgets ListView
    _userButtonList.map((item) {
      _buttonListWidgets
          .add(_buildButtonList(item['icon'], item['txt']));
    }).toList();
  • How I would like to have with OMIcons
    // This can come from a remote JSON (HTTP)!!!
    List<Map<String, dynamic>> _userButtonList = [
      {
        'icon': 0xe9d0, // OMIcons.check
        'txt': 'Button 1',
      },
      {
        'icon': 0xecef, // OMIcons.unsubscribe
        'txt': 'Button 2',
      },
    ];

    // ...

    // Builder buttons for ListView
    Widget _buildButtonList(int icon, String txt) {
      return Container(
        height: 30,
        child: Column(
          children: <Widget>[
            Icon(OMIconData(icon)),
            Text(txt),
          ],
        ),
      );
    }

    // ...

I'm using Material Design Icons this way, but I like the 'Outlined' icons based on the Material Design you created.

If you think this is good, I will send a PR for change this, so what do you think?

chinnonsantos avatar Dec 05 '19 14:12 chinnonsantos