locale_observer 1.0.0 copy "locale_observer: ^1.0.0" to clipboard
locale_observer: ^1.0.0 copied to clipboard

outdated

Utility for detecting when the system tells the app that the user's locale has changed.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return LocaleObserver(
      didChangeLocales: (BuildContext context, List<Locale> locales) {
        print("locales = ${locales}");
      },
      child: MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Center(
            child: Text(''),
          ),
        ),
      ),
    );
  }
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Utility for detecting when the system tells the app that the user's locale has changed.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on locale_observer