skip to Main Content

I changed version , I did this steps ;

  1. Stopping the app
  2. Running flutter clean in your app directory
  3. Deleting the app from your simulator / emulator / device
  4. Rebuild & Deploy the app.

I tried everything but my font awesome package for flutter doesn’t work.

pubspec.yaml file

This is pubspec.yaml

Widget file

This is the line which i use command

3

Answers


  1. Use This Code

    EX:

    import 'package:font_awesome_flutter/font_awesome_flutter.dart';
    
     FaIcon(FontAwesomeIcons.venus,size: 50.0,),  
    


    Login or Signup to reply.
  2. Your code is correct.

    Try following steps:

    1. run flutter pub get in your terminal
    2. Stop your App
    3. Restart your app and see the result output

    pubspec.yaml file

    dependencies:
      flutter:
        sdk: flutter
      font_awesome_flutter: ^9.2.0
    

    Widget:

         Padding(
                  padding: const EdgeInsets.all(8.0),
                  child: FaIcon(
                    FontAwesomeIcons.venus,
                  ),
                ),
    

    Your result: image

    Login or Signup to reply.
  3. For anyone who is here for another FontAwesome icons issue – some icons does not work on Flutter when entered exact name. Naming convention is different for long 2-3 words named icons on Flutter package of FontAwesome. For example, solar-panel icon should be entered as solarPanel on Flutter. It is same for all long 2-3 words named icons.

    From package specification on pub.dev:

    Icon names # Icon names equal those on the official website, but are
    written in lower camel case. If more than one icon style is available
    for an icon, the style name is used as prefix, except for "regular".
    Due to restrictions in dart, icons starting with numbers have those
    numbers written out.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search