easy_locale 0.0.5 copy "easy_locale: ^0.0.5" to clipboard
easy_locale: ^0.0.5 copied to clipboard

Easy localization & internationalization (i18n) library.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
    lo.init();
  }

  @override
  Widget build(BuildContext context) {
    lo.set(key: 'home title', locale: 'ko', value: '다국어 설정');
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text('home title'.t),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
0
pub points
51%
popularity

Publisher

verified publishersonub.com

Easy localization & internationalization (i18n) library.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

devicelocale, flutter

More

Packages that depend on easy_locale