A flag Flutter package for Android / iOS / Web.

Overview

Logo

flag

Pub Version Bless

A flag Flutter package for Android / iOS / Web. Mobile Based by https://github.com/dnfield/flutter_svg , Web Based by Image.network

Screenshot

Screenshot Screenshot

Svg sources

fetch data :python file is fetch_data/main.py

Update time: 2020-04-21 23:22:58

Marge from 2.0.X to 3

Replace Flags.getFlag(country: to Flag(. :)

Flag list

Flag List

Organisations

Disputed territories

  • hk Hong Kong. Special Administrative Region of China.
  • mo Macau. Special Administrative Region of China.
  • eh Western Sahara. Claimed by Morocco.
  • tw Taiwan. Claimed by China.

Undisputed territories which are non-UN state

  • va Vatican City. Govern by the Holy See.

How to use

Flag.fromCode(FlagsCode.COUNTRY_CODE, height: HEIGHT, width: WIDTH), Flag.fromString(COUNTRY_CODE, height: HEIGHT, width: WIDTH),

Such as

  • Flag.fromCode(FlagsCode.AD, height: 100, width: null)
  • Flag.fromString('AD', height: null, width: null)
  • Flag.fromString('AD', height: 10, width: 100, fit: BoxFit.fill)

Web Error

If you got an ImageCodecException issue on web, maybe this issue can solve your problem.

Bugs

  • brazilian (br) flag, you can see that the letters are still a bit abnormal.

Branch & version

switch Flutter SDK channel Flutter-build-release-channels

flutter channel
flutter channel 
   

   
  • develop --> develop
  • stable --> verison X.Y.Z (using latest stable channel Flutter SDK)
Channel stable, 2.0.0
  • master --> verison X.Y.Z-pre (using latest bate channel Flutter SDK)
Channel beta, 1.20.0-7.3.pre
Comments
  • flags have different sizes

    flags have different sizes

    Flags are returned with different sizes

    ListTile(
                        leading: Flags.getFullFlag('it', 20, null),
                        title:
                            Text(AppLocalizations.of(context).translate('italian')),
                      ),
                      ListTile(
                        leading: Flags.getFullFlag('gb', 20, null),
                        title:
                            Text(AppLocalizations.of(context).translate('english')),
                      ),
    
    image
    opened by enricobenedos 4
  • Cannot push to repo some small changes

    Cannot push to repo some small changes

    Hi, I wanted to push a fix because I've noticed that there are some problems with the countries like Scotland gb-sct, Wales gb-wls etc. there are not mapped and cannot address it with enum. Also, the files should be renamed with an underscore to list them in enum GB_SCT.

    When I want to push I'm getting:

    ERROR: Permission to LunaGao/flag_flutter.git denied to philiposD.
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    
    opened by philiposD 3
  • Error: Flutter version 1.20.0

    Error: Flutter version 1.20.0

    I have build errors on Flutter (Channel stable, 1.20.0)

    Error: Type 'DiagnosticableMixin' not found.
    Error: Type 'DiagnosticableMixin' not found
    Error: The type 'DiagnosticableMixin' can't be mixed in
    Error: Superclass has no method named 'debugFillProperties'
    Error: Superclass has no method named 'debugFillProperties'
    

    Those errors come from flutter_svg: ^0.17.4 when used with this version of Flutter

    I am using the following to fix this:

    dependency_overrides: flutter_svg: 0.18.0

    Solution:

    Upgrade flag package's flutter_svg dependency version to 0.18.0

    opened by bytestreme 3
  • Conflict with new version of flutter_svg

    Conflict with new version of flutter_svg

    Hi, Thanks for providing this package, here is my issue with the latest version of flutter:

    "Because flag 3.0.1 depends on flutter_svg ^0.17.4 and no versions of flag match >3.0.1 <4.0.0, flag ^3.0.1 requires flutter_svg ^0.17.4."

    bug 
    opened by alr2413 3
  • Error on trying to get brazilian flag

    Error on trying to get brazilian flag

    Error:

    ``════════ Exception caught by SVG ═══════════════════════════════════════════════ The following StateError was thrown resolving a single-frame picture stream: Bad state: Expected to find Drawable with id url(#O). Have ids: (url(#D), url(#E), url(#e), url(#G))

    When the exception was thrown, this was the stack #0 DrawableDefinitionServer.getDrawable package:flutter_svg/src/vector_drawable.dart:577 #1 _Elements.use package:flutter_svg/…/svg/parser_state.dart:184 #2 SvgParserState.parse package:flutter_svg/…/svg/parser_state.dart:776 #3 SvgParser.parse package:flutter_svg/parser.dart:14 ... Picture provider: ExactAssetPicture(name: "packages/flag/res/flag/br.svg", bundle: null, colorFilter: null) Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#12a7a(), name: "packages/flag/res/flag/br.svg", colorFilter: null) ════════════════════════════════════════════════════════════════════════════════´´

    I tried to add other flags (AB and US) and they work perfectly, but the brazilian flag isn't working

    bug 
    opened by bdlukaa 3
  • Countries with missing flags

    Countries with missing flags

    Please add these countries to your list:

    South Africa South Georgia and the South Sandwich Islands Nepal Oman Sri Lanka Isle of Man Serbia Cayman Islands Dominica, Commonwealth of Grenada Haiti American Samoa Argentina Brazil Falkland Islands (Malvinas) Peru

    Thanks! :)

    enhancement 
    opened by pytong 3
  • Flutter_flags: Bug fixing

    Flutter_flags: Bug fixing

    • #70 removed almost all clipPath-tags inside the defs-tag (Flags were cut off)
    • #77 #71 changed the pt values to pixel (1pt ~= 1.3333333px)
    • #69 #74 #67 Flutter svg goes through the ids from top to bottom. In some svg's there is first a href="url(#a)" link to an id which is set afterwards with id="a". I added the required svg elements to the defs tag for the flags where the error occurred. I did NOTHING to the flags themselves except the Korean flag because it was broken.
    • Added around 60 missing flags into the FlagsCode Enum
    • Updated flutter_svg to version 1.0.3
    • Updated the flags (6.6.3) provided by https://github.com/lipis/flag-icons

    All flags are working without any errors either on 4x3 or 1x1 format. & nearly all issues are resolved with this pr.

    This is the first pull request I have ever made. Be kind with me 😄

    opened by ByJerome 2
  • Proposal: Use the ISO 3166-1 alpha-2 specification for the list of flags

    Proposal: Use the ISO 3166-1 alpha-2 specification for the list of flags

    Currently, this library contains flags of states that are UN members, complemented by a couple of other flags which belong to disputed or undisputed territories. However, at this point, the addition of these territories seem arbitrary.

    To prevent any discussion that may arise in the future about the addition of a certain flag, and to add around 50 territories which are currently missing from this library, I propose the list of ISO 3166-1 alpha-2 country codes to be used to define the body of countries and territories included in this library.

    The ISO 3166-1 alpha-2 specification seems to be the de facto standard that defines countries and territories. It comprises all the countries which are currently included in the library and will add around 50 more, although some of them will not have associated flags.

    SPIKE 
    opened by markusgeert 2
  • Consider swapping strings for enum

    Consider swapping strings for enum

    So, I think enums are just safer because we are in a typed language so makes sense to use it. You could keep strings as is and mark them as deprecated so that in near future they can be removed without breaking changes. For those who still prefer literals you could provide a Flag.fromString, but it wouldn't harm to get rid of the strings, but that's just my opinion. Would like to know what you guys think.

    enhancement 
    opened by Ascenio 2
  • Capture from onError ImageCodecException

    Capture from onError ImageCodecException

    This Plugin is not working in flutter web.

    [debug] Capture from onError ImageCodecException: Failed to decode image data. Image source: http://localhost:63126/assets/packages/flag/res/flag/fr.svg

    opened by jayeshindianic 2
  • Added Vatican City flag

    Added Vatican City flag

    Vatican City govern by the Holy See is widely recognised as independent state, although it is not a UN member state. Flag taken from Wikimedia. Not sure how you'd want to update the description to fit an undisputed territory that is a non-UN state.

    opened by mdccxv 2
  • FormatException(

    FormatException("Invalid double", source)

    Greetings, I have an error of type FormatException("Invalid double", source) when I try to use the flag of Colombia code CO, it works for me with the one of Mexico and some others

    image image

    Thank you for the package it has been very useful for me

    opened by alejopulidor 5
  • CAUGHT AN EXCEPTION WHILE USING THE FLAG PACKAGE FOR FLUTTER APP

    CAUGHT AN EXCEPTION WHILE USING THE FLAG PACKAGE FOR FLUTTER APP

    while i was trying to show the flags of countries like brazil and afgansthan by using both the flagcodes and strings (flagcode.AF,"AF"). i got a svg realted exception. The exception is given below:- ----------------Exception------------------------- #6 SvgParserState.parse package:flutter_svg/…/svg/parser_state.dart:885 #7 SvgParser.parse package:flutter_svg/parser.dart:27 #8 Svg.fromSvgString package:flutter_svg/svg.dart:139 #9 Svg.svgPictureStringDecoder package:flutter_svg/svg.dart:90 Picture provider: ExactAssetPicture(name: "packages/flag/res/4x3/af.svg", bundle: null, colorFilter: null) Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#3ea37(), name: "packages/flag/res/4x3/af.svg", colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 14.0, xHeight: 7.0))

    opened by spellsuvam 3
  • FormatException with Malta 4x3 svg

    FormatException with Malta 4x3 svg

    Out of ~25 or so flags I use, one is cousing trouble - Malta:

    Web:

    ======== Exception caught by SVG ===================================================================
    The following FormatException was thrown resolving a single-frame picture stream:
    Invalid double
    1pt
    
    When the exception was thrown, this was the stack: 
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49  throw_
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 214:5             parse
    packages/flutter_svg/src/utilities/numbers.dart 23:17                                                                      parseDouble
    packages/flutter_svg/src/svg/parser_state.dart 1065:27                                                                     parseDoubleWithUnits
    packages/flutter_svg/src/svg/parser_state.dart 1357:13                                                                     parseStroke
    packages/flutter_svg/src/svg/parser_state.dart 1590:15                                                                     parseStyle
    packages/flutter_svg/src/svg/parser_state.dart 955:7                                                                       addShape
    packages/flutter_svg/src/svg/parser_state.dart 985:12                                                                      startElement
    packages/flutter_svg/src/svg/parser_state.dart 881:13                                                                      parse
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50            <fn>
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1685:54                                          runUnary
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 159:18                                    handleValue
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 766:44                                    handleValueCallback
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 795:13                                    _propagateToListeners
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 465:9                                     callback
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 40:11                              _microtaskLoop
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/schedule_microtask.dart 49:5                               _startMicrotaskLoop
    C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15           <fn>
    Picture provider: ExactAssetPicture(name: "packages/flag/res/4x3/mt.svg", bundle: null, colorFilter: null)
    Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#6e2bc(), name: "packages/flag/res/4x3/mt.svg", colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 14, xHeight: 7))
    ====================================================================================================
    
    

    Android:

    ======== Exception caught by SVG ===================================================================
    The following FormatException was thrown resolving a single-frame picture stream:
    Invalid double
    1pt
    
    When the exception was thrown, this was the stack: 
    #0      double.parse (dart:core-patch/double_patch.dart:111:28)
    #1      parseDouble (package:flutter_svg/src/utilities/numbers.dart:23:17)
    #2      SvgParserState.parseDoubleWithUnits (package:flutter_svg/src/svg/parser_state.dart:1065:27)
    #3      SvgParserState.parseStroke (package:flutter_svg/src/svg/parser_state.dart:1357:13)
    #4      SvgParserState.parseStyle (package:flutter_svg/src/svg/parser_state.dart:1590:15)
    #5      SvgParserState.addShape (package:flutter_svg/src/svg/parser_state.dart:955:7)
    #6      SvgParserState.startElement (package:flutter_svg/src/svg/parser_state.dart:985:12)
    #7      SvgParserState.parse (package:flutter_svg/src/svg/parser_state.dart:881:13)
    <asynchronous suspension>
    #8      SvgParser.parse (package:flutter_svg/parser.dart:27:12)
    <asynchronous suspension>
    #9      Svg.fromSvgString (package:flutter_svg/svg.dart:139:12)
    <asynchronous suspension>
    #10     Svg.svgPictureStringDecoder (package:flutter_svg/svg.dart:90:34)
    <asynchronous suspension>
    Picture provider: ExactAssetPicture(name: "packages/flag/res/4x3/mt.svg", bundle: null, colorFilter: null)
    Picture key: AssetBundlePictureKey(bundle: PlatformAssetBundle#7afac(), name: "packages/flag/res/4x3/mt.svg", colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 14.0, xHeight: 7.0))
    ====================================================================================================
    
    opened by Sedemicra 1
Releases(v6.0.0)
Flutter Web application having splash screen and providing Web view Using web view packege.

Webview with Splash Screen in Flutter Flutter Web View With Splash Screen. Subscribe Our YouTube Channel. Visit Website Demo OutPut ?? Links Getting S

Habib ullah 1 Dec 7, 2021
Hybrid App build on flutter SDK able to run on Android, IOS, web, desktop

Codeforces Visualizer APP Ready to use Flutter Application. Uses codeforces API. Useful for codeforces programmers. ScreenShots Single User Page Compa

vikas yadav 13 Dec 31, 2022
A Flutter 2D RPG Game Engine On Web & Android & IOS.

DevilF Engine A Flutter 2D RPG Game Engine On Web & Android & IOS. The Devilf Engine Is A Open Source 2D Game Engine. The Engine Is Development Using

zhaoqipeng 15 Oct 20, 2022
Video player-2.2.10 - A Flutter plugin for iOS, Android and Web for playing back video on a Widget surface

Video Player plugin for Flutter A Flutter plugin for iOS, Android and Web for pl

null 2 Sep 29, 2022
Flutter application that implements socket.io in Node.js Works in - Android, iOS and Web

Quick Chat - Flutter Flutter application that implements socket.io in Node.js Works in - Android, iOS and Web This repo only contains Flutter (fronten

Aayush Nikkon Subedi 22 Dec 23, 2022
Task List application developed in Dart language with SDK Flutter for Android, iOS and Web

Task List application developed in Dart language with SDK (Software Development Kit) Flutter for Android, iOS and Web.

João Bruno 2 Jun 2, 2022
Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

R-Team 5 Nov 15, 2022
Learn to build apps that work on Android, iOS, Web, and Desktop

Cross-Platform Development with Flutter Course Learn to build apps that work on Android, iOS, Web, and Desktop Go To Course Flutter is Google’s UI too

Mohamed Ibrahim 11 Oct 24, 2022
Decentralized SkyDB-based alternative to Twitter, YouTube and Instagram with a native iOS, Android and web app.

SkyFeed SkyFeed is a decentralized SkyDB-based alternative to Twitter, YouTube and Instagram with a native Android, web and (soon) iOS app. Use You ne

null 88 Oct 28, 2022
📱 CyBear Jinni App is the app to control CyBear Jinni Hub 💡 remotely from your Android, IOS and Web Browser

CyBear Jinni App Welcome This repository is in charge of the CyBear Jinni App and is part of the CyBear Jinni Smart Home system. The CyBear Jinni App

CyBear Jinni 104 Dec 1, 2022
Sharezone is a collaborative school organization app for iOS, Android, macOS and web.

Download Sharezone Android iOS macOS Web Sharezone is a collaborative school organization app for iOS, Android, macOS and web. With Sharezone pupils,

Sharezone 93 Dec 18, 2022
Web / Android app base on Flutter(2.5.2).

⚠️ Only accepting contributions made to Flutter app. Any other contributions wont be accepted ⚠️ Web and Android app build over Flutter. Here in this

Vivek Sonawane 41 Oct 31, 2022
Paystack SDK for iOS. Accept Payments on iOS

Paystack iOS SDK The Paystack iOS SDK make it easy to collect your users' credit card details inside your iOS app. By charging the card immediately on

Paystack 22 May 29, 2022
Best ever drawer in flutter for android and ios

Drawer in Flutter Best ever drawer in flutter to make precious application. This flutter app is made just to demonstrate how you we can make an animat

Asad Malik 22 Oct 16, 2022
A Flutter Starter Kit (Boilerplate) to kick-start your next Android and iOS app

Flutter Starter Kit (Boilerplate) using the BLoC Pattern A Flutter starter application that utilizes the BLoC Pattern. You can read more at this Mediu

AceLords 233 Dec 28, 2022
A Flutter plugin that supports Pangle SDK on Android and iOS.

Thanks for non-commercial open source development authorization by JetBrains. 穿山甲 Flutter SDK `pangle_flutter`是一款集成了字节跳动穿山甲 Android 和 iOS SDK的 Flutter

null 121 Dec 2, 2022
Caffodils - Download everything | Flutter app for Android and IOS. Download Video, Reels, Shorts, Music, Images, Files from Instagram, Facebook and Youtube

caffodils Caffodils - Download everything Flutter app for Android and IOS. Download Video, Reels, Shorts, Music, Images, Files from Instagram, Faceboo

Caffodils 11 Oct 24, 2022
A credit card scanner app made with flutter for both Android and IOS

credit_card_scanner A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

kosiso. O 1 Oct 16, 2021