svg_flag 1.5.1 copy "svg_flag: ^1.5.1" to clipboard
svg_flag: ^1.5.1 copied to clipboard

A curated collection of all country flags in SVG format for easier integration.

example/lib/main.dart

import 'package:svg_flag/svg_flag.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(home: MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int? value = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
            title: const Text("Countries Flag"),
            centerTitle: true,
            elevation: 0),
        body: Center(
            child: DropdownButton<int>(
                value: value,
                items: List.generate(
                    FlagData.values.length,
                    (index) => DropdownMenuItem(
                        value: index,
                        child: Row(mainAxisSize: MainAxisSize.min, children: [
                          SvgFlag(FlagData.values[index]),
                          const SizedBox(width: 5.0),
                          Text(FlagData.values[index].source
                              .replaceAll(RegExp(r'packages.*/|.svg'), "")
                              .toUpperCase())
                        ]))),
                onChanged: (value) => setState(() => this.value = value))));
  }
}
11
likes
160
pub points
79%
popularity
screenshot

Publisher

verified publisherinidia.app

A curated collection of all country flags in SVG format for easier integration.

Homepage
Repository (GitHub)
View/report issues

Topics

#flag #svg #icon #asset

Documentation

API reference

Funding

Consider supporting this project:

ko-fi.com

License

MIT (LICENSE)

Dependencies

flutter, flutter_svg

More

Packages that depend on svg_flag