Flutter FontAwesome 사용법

[Flutter] FontAwesome을 Flutter에서 적용하여 사용해보기
박찬혁's avatar
Mar 11, 2024
Flutter FontAwesome 사용법
Contents
pubspec.yaml

pubspec.yaml

notion image
추가 후 Pub get
import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'chat_screen.dart'; import 'friend_screen.dart'; import 'more_screen.dart'; class MainScreen extends StatefulWidget { @override _MainScreenState createState() => _MainScreenState(); } class _MainScreenState extends State<MainScreen> { int _selectedIndex = 0; @override Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: _selectedIndex, children: [ FriendScreen(), ChatScreen(), MoreScreen(), ], ), bottomNavigationBar: BottomNavigationBar( showSelectedLabels: false, showUnselectedLabels: false, currentIndex: _selectedIndex, backgroundColor: Colors.grey[100], selectedItemColor: Colors.black, unselectedItemColor: Colors.black54, onTap: (index) { setState(() { _selectedIndex = index; }); }, items: [ const BottomNavigationBarItem( icon: Icon(FontAwesomeIcons.user), label: "", ), const BottomNavigationBarItem( icon: Icon(FontAwesomeIcons.comment), label: "", ), const BottomNavigationBarItem( icon: Icon(FontAwesomeIcons.ellipsisH), label: "", ), ], ), ); } }
FontAwesomeIcons. 으로 불러오면 됨
notion image
 
Share article
RSSPowered by inblog