flutter_localized_locales 2.0.4 copy "flutter_localized_locales: ^2.0.4" to clipboard
flutter_localized_locales: ^2.0.4 copied to clipboard

Flutter package which provides locale code to name mappings for 563 locales.

example/lib/main.dart

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      localizationsDelegates: [
        LocaleNamesLocalizationsDelegate(),
        // ... more localization delegates
      ],
      home: Home(),
    );
  }
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Text(LocaleNames.of(context)!.nameOf('zzzz').toString()),
          Text(LocaleNames.of(context)!.nameOf('fr_CA').toString()),
        ],
      ),
    );
  }
}
58
likes
160
points
366k
downloads

Publisher

verified publisherguidez.pl

Weekly Downloads

Flutter package which provides locale code to name mappings for 563 locales.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on flutter_localized_locales