搜索插件、代码仓与 APP 分类

插件详情v3.0.0

country_icons

一个包含许多国家旗帜图标的 Flutter 包,您可以通过 Image.asset 方法使用它们

AndroidiOSmacOSWindowsLinux
近 30 天下载
1.4万
喜欢数
103
Pub 分数
150

安装插件

flutter pub add country_icons

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,提供一组国家旗帜图标,可轻松通过 Image.asset 方法集成到应用中。设计简洁高效,支持 Android、iOS、macOS、Windows 和 Linux 等多个平台。图标以资源文件形式提供,实现快速渲染和最小开销。适用于需要国家视觉表示的应用程序,如国际化用户界面、旅行应用或语言选择功能。

适合场景

  • 在用户个人资料中显示国家旗帜
  • 实现语言或地区选择
  • 增强旅行或本地化功能
  • 创建多语言应用程序界面
  • 显示全局数据可视化中的源

主要特点

  • 众多国家的预构建旗帜资源
  • 通过 Image.asset 进行简单集成
  • 跨平台兼容性
  • 轻量且高效
  • 轻松更新新标志

适合对象

  • 面向国际用户的应用程序
  • 旅游和旅游平台
  • 语言或区域选择组件
  • 全球数据仪表板
  • 多语言用户界面

使用建议

  • 需要手动管理自定义旗帜的资源
  • 限制为静态图标集
  • 无内置动画或交互功能
  • 取决于正确的资产路径配置
  • 可能需要针对大型图标集进行额外的大小优化

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

country_icons

A dart package with many country flag icons

Getting Started

This package provides country icons as PNG and SVG to be used in dart code. You can simply access the files directly via an asset() method, or you can use the packages method getSvgFlag().

Icons as png

You can either use the PNG icons directly via new Image.asset('icons/flags/pngXXXXpx/yy.png', package: 'country_icons'); where XXXX is the size [100,250,1000] and yy is the country code.

Icons as SVG

Alternatively you can use SVG icons via new SvgPicture.asset('icons/flags/svg/xx.svg', package: 'country_icons'); For this to work you should require flutter_svg in your code directly.

dependencies:
flutter_svg: ^2.0.0
Packages Method for SVGs

You can use CountryIcons.getSvgFlag('de') for use in your code, if you do a

import 'package:country_icons/country_icons.dart';

Requests for new/updates flags

This package is simply a wrapper for the excellent flag collection of hjnilsson (see Credits below). Any requests for adding, updating or removing of flags do not make sense in this repo.

Credits

Flags are used from hjnilsson

Repo: https://github.com/hjnilsson/country-flags Homepage: http://hjnilsson.github.io/country-flags

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。