language_code 0.5.5 copy "language_code: ^0.5.5" to clipboard
language_code: ^0.5.5 copied to clipboard

Get the current language code and Locale of the device. Also includes almost the language codes with English names and native names.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            children: [
              Text('Raw Locale: ${LanguageCode.rawLocale}'),
              Text('Code: ${LanguageCode.code}'),
              Text('Locale: ${LanguageCode.locale}'),
            ],
          ),
        ),
      ),
    );
  }
}
14
likes
160
points
7.41k
downloads

Publisher

verified publisherlamnhan.dev

Weekly Downloads

Get the current language code and Locale of the device. Also includes almost the language codes with English names and native names.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on language_code