Git Product home page Git Product logo

line_icons's Introduction

LineIcons 2.0.3

Just another bunch of beautiful icons to use

I love Material icons. I really do. But, somehow, I suddenly felt tired of them. So I took a look around and found a wonderful set of icons by Icons8. And best of all... for free! (See the Good Boy Licence).

Yeah, what a wonderful world and so on, but, writing down all those nasty codes into Dart constants? No way!

And FlutterIcon just came out of the blue! It made all the dirty work for me.

I started to use this library in my projects, and they really seemed nice. So I asked to myself: why not publishing it for others to enjoy? After all, in all this process, I was indeed assisted by many people who decided not keeping the icons for themselves and helping others with a piece of software they had no need to share with me or anyone else.

So, thank you Icons8 and FlutterIcon!

(And, sure, why not: thank you Microsoft Excel! xD)

Null safety

Here we are. Starting at version 2.0.0, LineIcons will be null-safe, as suggested by the Dart team.

Just in case you might be interested: Null-safety.

Features

  • Null-safe package (SDK >= 2.12.0)
  • Const constructors (const icon = const LineIcon.tablet(); vs final icon = LineIcon.tablet())
  • Flutterish icon names (camelCase names instead of snake_case ones)
  • values property is provided in LineIcons class to access IconData as a map. I.e., Icon(LineIcons.values['code']).
  • byName getter is also available to access the IconData related to the icon name passed as parameter. I.e., Icon(LineIcons.byName('desktop')).
  • LineIcon (singular) class is provided along LineIcons (plural), so you can spare some code using LineIcon.tablet() instead of Icon(LineIcons.tablet).
  • LineIcon constructor parameters are the same as Icon's, so you may customize a LineIcon instance the same way. I.e., Icon(LineIcons.px500, color: Colors.red) is equivalent to LineIcon.px500(color: Colors.red) (or Icon(LineIcons.values['px500'], color: Colors.red)).

Warning

In a few cases, names don't exactly match those in Icons8; i.e., 500px became px500 instead. Icons should be easily recognized, anyway.

Please, be aware: version 2.0.0 and above will be null-safe

Documentation

The font (v1.3.0)

From the font to the class

From the class to the package

Line, clean, icons

Imagine a cross-over: Windows10 style and Awesome inspiration. Well, stop dreaming! You got plenty of beautiful icons to choose from for your Android app (not tested in iOS yet, sorry). I'd rather like this set over Material, and I find much easier to find the icon I'm looking for in Icons8 than in the Material Icons page.

Let's give it a try

Installing

Include line_icons in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  line_icons: ^2.0.2

If your IDE doesn't do it automatically, type:

flutter packages get

Using

Import the package in your Flutter file and use Icon to get the actual icon widget:

import 'package:line_icons/line_icons.dart';
...
Icon _icon = Icon(LineIcons.code);
...

Or choose a suitable constructor:

import 'package:line_icons/line_icon.dart';
...
const Icon _icon = const LineIcon.code();
...

Or go the ugly way ;P:

import 'package:line_icons/line_icons.dart';
...
Icon _icon = Icon(LineIcons.values['code']);
...

Or even a fancy nasty way:

import 'package:line_icons/line_icons.dart';
...
Icon _icon = Icon(LineIcons.byName('code'));
...

Sample

import 'package:flutter/material.dart';
import 'package:line_icons/line_icon.dart';
import 'package:line_icons/line_icons.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: MyHomePage(title: 'Line Icons Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({
    required this.title,
  });
  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text(
              'Awesome Line Icons are great!',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
            Text(
              'Version 2.0.2 constructors are const now!',
              style: Theme.of(context).textTheme.headlineSmall,
            ),
            SizedBox(
              height: 48.0,
            ),
            // Using LineIcon (no 's') for concision. It returns an Icon object
            const LineIcon.tablet(
              size: 48.0,
              color: Colors.red,
            ),
            Text(
              'const LineIcon.tablet(size: 48.0, color: Colors.red,)',
            ),
            SizedBox(
              height: 24.0,
            ),
            // Using LineIcons the standard way: injecting the IconData into the Icon object
            const Icon(
              LineIcons.desktop,
              size: 48.0,
              color: Colors.blue,
            ),
            Text(
              'const Icon(LineIcons.desktop, size: 48.0, color: Colors.blue,)',
            ),
            SizedBox(
              height: 24.0,
            ),
            // Using LineIcons the nasty way: passing the IconData via the values map
            Icon(
              LineIcons.values['mobilePhone'],
              size: 48.0,
              color: Colors.amber,
            ),
            Text(
              'Icon(LineIcons.values[\'mobilePhone\'], size: 48.0, color: Colors.amber,)',
            ),
          ],
        ),
      ),
    );
  }
}

GitHub source code

If you're interested on the code (feel free to modify it anyway you want), you can find it here: https://github.com/galonsos/line_icons

line_icons's People

Contributors

galonsos 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

Watchers

 avatar  avatar  avatar

line_icons's Issues

Null-safety version

Any plan to support Flutter 2.0 and null safety?

Thanks for adopting Icon8 for flutter.
Marko

(line_icons: ^1.1.0) not available - not published

When i try to use the icons as a dependency, i get the error:

 line_icons ^1.1.0 which doesn't match any versions, version solving failed.

Seems like it is not updated/published yet in the official website.
(Also please include the satellite icon if possible, i really love and need it :) )

Maintaining

Hi,

are you planing to maintain this? LineIcons have been updated and added. Will put out a new version with the new LineIcons?

inconsistent naming and no longer exists icon

For example, per Icons8:

  • inconsistent naming
    • store-alt -> alternateStore
    • hospital-alt -> hospitalAlt
  • no longer exists
    • buildingAlt (building-1 no longer exists)

There are more than I shown here.

I think latest version of this package should always has the current icons set, and icon(s) removed should not be supported by adding @Deprecated tag.

Icons called with complex names not working

I am having a problem calling the icons by name.
For example:
Icon(LineIcons.byName('home')); works
Icon(LineIcons.byName('info-circle')); does not works

It seems to be related to the name having more than one word in the string.

Any suggestions?

Missing Facebook icons

Thanks for the plugin!

All the Facebook Icons are the same: facebook, facebook_square, facebook_official, all of them are like this:

image

Package on pub.dev outdated

The last version on pub.dev was published on Jan 14, 2019 and is missing lots of newer icons, which you included in your last commit.

License question

Hi,

thanks for his great library, however I have a concern regarding choice of license.

Currently, the license is GPL-3.0, which is very infectious, although font itself has a very permissive license. Any plans on maybe changing the license?

X Icon

Could you update the new X icon formaly twitter?

How to use filled icons instead of outlined?

Well the title basically says it all, but let me explain, on the Icons8 page where all the Line Awesome icons and their names are shown, when you put over one with the mouse cursor it shows you that you have another design of the same icon but filled, since for example I am trying to use the LineIcons.divide but it only shows outlined and I would like all padding inside, I would like to know how I can use them with your package or if they are not implemented suggest that you add them as well because it would be very good to have them.

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.