1. 程式人生 > >Flutter中整合Font Awesome

Flutter中整合Font Awesome

1、新增引用

在 pubspec.yaml檔案中,加入 font awesome的引用

 

 1 dependencies:
 2   flutter:
 3     sdk: flutter
 4 
 5   # The following adds the Cupertino Icons font to your application.
 6   # Use with the CupertinoIcons class for iOS style icons.
 7   cupertino_icons: ^0.1.0
 8 
 9   #font awesome icon 這行是新加的
10 font_awesome_flutter: 8.2.0

點選該檔案上方的 Packages Get連結。

2、使用

import 'package:font_awesome_flutter/font_awesome_flutter.dart';

Icon(FontAwesomeIcons.solidCircle)