language_code 0.5.1 copy "language_code: ^0.5.1" to clipboard
language_code: ^0.5.1 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 Code: ${LanguageCode.rawCode}'),
              Text('Raw Locale: ${LanguageCode.rawCode}'),
              Text('Code: ${LanguageCode.code}'),
              Text('Locale: ${LanguageCode.locale}'),
            ],
          ),
        ),
      ),
    );
  }
}
13
likes
0
pub points
92%
popularity

Publisher

verified publisherlamnhan.dev

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

License

unknown (license)

Dependencies

flutter

More

Packages that depend on language_code