Skip to content
PriyoMukul edited this page Jun 18, 2019 · 2 revisions

Welcome to the icofont_flutter Docs!

  • Lets discuss how to use IcoFont as flutter package.

First of all we should add our package name with version ( icofont_flutter: ^1.0.0 ) in pubspec.yaml file. And run flutter packages get to load it in our project.

Then import like below:

import 'package:icofont_flutter/icofont_flutter.dart';

After importing the package you have access to IcoFontIcons class which provides IcoFont icons as IconData, similar to Flutters built in Icons class.

Example
class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new IconButton(
      // Use the IcoFontIcons class for the IconData
      icon: new Icon(IcoFontIcons.brandIcofont), 
      onPressed: () { print('Hey, there'); }
     );
  }
}

That's all

Thanks for being with us.

Clone this wiki locally