localize_and_translate 5.0.7-dev copy "localize_and_translate: ^5.0.7-dev" to clipboard
localize_and_translate: ^5.0.7-dev copied to clipboard

Flutter localization in easy steps, simple ways to localize and translate your app

example/lib/main.dart

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await LocalizeAndTranslate.ensureInitialized(
    assetLoader: AssetLoaderRootBundleJson(
      'assets/lang',
    ),
  );

  runApp(
    LocalizeAndTranslateApp(
      child: const MyApp(),
    ),
  );
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      localizationsDelegates: context.delegates,
      supportedLocales: context.supportedLocales,
      locale: context.locale,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(''.tr()),
      ),
    );
  }
}
132
likes
0
pub points
94%
popularity

Publisher

verified publishermsayed.net

Flutter localization in easy steps, simple ways to localize and translate your app

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_localizations, hive, hive_flutter, intl

More

Packages that depend on localize_and_translate