google_fonts
패키지를 사용했는데 fontWeight이 원하는대로 적용되지 않았다. 어떤 weight를 적용하던 w400, w600 둘 중 하나로만 나타나는...😵
구글링 해보니 구글폰트가 weight를 정확하게 찾지 못하는게 이유인 것 같았다.
프로젝트에 폰트 파일 추가
🔽Google Fonts
→ pubspec.yaml에 assets에 font, weight 추가
→ main.dart
에 fontFamily 설정 (물론 개별 설정도 가능)
→ 결과
google_fonts_flutter
설치
🔽google_fonts_flutter
→ main.dart
에 fontFamily 설정
.
.
.
fontFamily: GoogleFonts.montserrat().fontFamily,
.
.
→ fontweight 변경 원하는 text는 아래와 같이 style 입력
style: GoogleFonts.montserrat(
fontWeight: FontWeight.w600,
fontSize: Sizes.size16,
),
텍스트가 정말 몇 개 없고, fontweight는 normal, bold면 충분하다! 하면 모르겠는데 웬만하면 방법1로 하는게 나을 것 같다.