패키지, 저장소 및 앱 카테고리 검색

country_flags 표지
패키지 상세v4.1.2

country_flags

ISO 국가 코드에서 깃발 아이콘을 표시하는 Flutter 패키지입니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
21.7만
좋아요
177
Pub 점수
160

패키지 설치

flutter pub add country_flags

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

country_flags 패키지는 ISO 국가 코드를 사용하여 플래그 아이콘을 쉽게 표시할 수 있도록 해주는 Flutter 유틸리티입니다. 앱에 특정 국가의 플래그를 간단하고 효율적으로 통합할 수 있는 방법을 제공하며, 시각적 맥락을 통해 사용자 경험을 향상시킵니다. Android, iOS, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 장치 간 일관된 렌더링을 보장합니다. pub add 명령어를 통해 최소한의 설정으로 기존 Flutter 프로젝트에 원활하게 통합됩니다. 국제화, 사용자 위치, 지역 선택과 관련된 애플리케이션에 적합합니다.

사용 사례

  • 프로필에서 사용자 국가 표시
  • 앱에서 지역별 이용 가능성을 표시
  • 다국어 인터페이스 개선
  • 위치 데이터 시각화
  • 폼에서 국가 선택 지원
  • 여행 또는 소셜 앱에 플래그 통합하기

주요 기능

  • 간단한 ISO 코드 입력
  • 크로스 플랫폼 호환성
  • 경량이고 빠름
  • 사전 정의된 플래그 자산
  • pubspec.yaml과의 간편한 통합
  • 일관된 아이콘 스타일

적합한 대상

  • 국제화 앱
  • 사용자 프로필 기능
  • 여행 및 지도 앱
  • 다국어 플랫폼
  • 위치 기반 서비스
  • 국가 시각화가 필요한 UI

고려 사항

  • 유효한 ISO 국가 코드가 필요합니다
  • 사전 정의된 플래그 세트로 제한됨
  • 사용자 지정 플래그 지원 없음
  • 앱 크기가 약간 증가할 수 있습니다
  • 외부 자산 저장소에 의존합니다
  • 국가 외의 국기에는 적합하지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Country Flags

Pub GitHub Workflow Status (with branch) Pull Requests are welcome codecov Null safety

A Flutter package for displaying the SVG image or the emoji of a country's flag.

The flag can be generated using:

View the complete list of supported countries here.

For a list of supported languages, visit www.lingoes.net/en/translator/langcode.htm (please note that not all language codes on the list are supported).

Showcase

Image flags

Image flags

Emoji flags

Emoji flags

Installation

Simply add country_flags to your pubspec.yaml file.

dependencies:
  country_flags: ^4.0.0

Usage

Create a flag using a country code.

fromCountryCode supports 2 and 3 letter country code

CountryFlag.fromCountryCode('ES');

or

CountryFlag.fromCountryCode('ESP');
Create a flag from a language code
CountryFlag.fromLanguageCode('en');
Create a flag from a Currency code
CountryFlag.fromCurrencyCode('USD');
Create a flag from a phone prefix
CountryFlag.fromPhonePrefix('+34');
Tweak the size of the flag
CountryFlag.fromLanguageCode(
  'en',
  theme: const ImageTheme(
    width: 120,
    height: 80,
  ),
);
Create a circular flag
CountryFlag.fromCountryCode(
  'ES',
  theme: const ImageTheme(
    shape: Circle(),
  ),
);
Create a rectangular flag with rounded corners
CountryFlag.fromCountryCode(
  'ES',
  theme: const ImageTheme(
    shape: RoundedRectangle(6),
  ),
);
Use the emoji theme
CountryFlag.fromCountryCode(
  'ES',
  theme: EmojiTheme(size: 60),
)

Credits

Special thanks to jovial_svg which is utilized to render the SVG images from binary files. Many thanks to bgoncharuck for the implementation.

Acknowledgments to the flag-icons project for providing the necessary SVG flags.

Alternatives

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

순위