민프
[Flutter] Flutter에서 Font_Awesome 사용하기 본문
Font Awesome
The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome.
fontawesome.com
플러터에서 UI 아이콘을 간단하게 사용할 때 무료 아이콘만 해도 어느정도는 개발할 수 있을 것이다.
물론 Flutter에도 Material, Cupertino, Google, IOS 몇몇 아이콘이 포함되어있긴한데
평소에 Font Awesome을 사용해서 Flutter에서도 사용해보려고 한다.
https://pub.dev/packages/font_awesome_flutter
font_awesome_flutter | Flutter Package
The Font Awesome Icon pack available as Flutter Icons. Provides 1600 additional icons to use in your apps.
pub.dev
위 패키지를 설치하면 된다.
dependencies:의 섹션 에 pubspec.yaml다음 줄을 추가합니다.
dependencies:
font_awesome_flutter: <latest_version>
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyWidget extends StatelessWidget {
Widget build(BuildContext context) {
return IconButton(
// Use the FaIcon Widget + FontAwesomeIcons class for the IconData
icon: FaIcon(FontAwesomeIcons.gamepad),
onPressed: () { print("Pressed"); }
);
}
}
'Frontend > [Flutter]' 카테고리의 다른 글
[Flutter] GestureDetector를 이용해서 화면을 넘기는 Swipe 감지를 해보자 [기록] (0) | 2023.08.10 |
---|---|
[Flutter] Stack과 Align 같이 사용하기 [기록] (0) | 2023.08.09 |
[Flutter] StatefulWidget의 생명주기(lifecycle)를 알아보자 (0) | 2023.08.08 |
[Flutter] BuildContext란 무엇일까? (0) | 2023.08.08 |
[Flutter] use const with the constructor to improve performance... 는 왜 나오는걸까? (VSCODE 설정 변경하기) (0) | 2023.08.08 |
Comments