flutter_translate 5.0.0-dev.1 copy "flutter_translate: ^5.0.0-dev.1" to clipboard
flutter_translate: ^5.0.0-dev.1 copied to clipboard

Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.

example/lib/main.dart

import 'package:example/home/home_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_translate/flutter_translate.dart';

void main() async {
  await FlutterTranslate.initialize(FlutterTranslateOptions(
    initial: 'en',
    fallback: 'en',
    supported: ['en', 'es', 'ru', 'ar'],
    autoSave: true,
    missingKeyStrategy: MissingKeyStrategy.key,
    loader: AssetsLoaderOptions(),
  ));

  runApp(const LocalizedApp(MyApp()));
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Translate',
      locale: context.locale,
      supportedLocales: context.supportedLocales,
      localizationsDelegates: context.localizationDelegates,
      theme: ThemeData(primarySwatch: Colors.blue),
      home: const HomePage(),
    );
  }
}
256
likes
50
pub points
97%
popularity

Publisher

verified publisherjesway.com

Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter.

Homepage
Repository (GitHub)
View/report issues

Topics

#localization #i18n #translation #globalization

License

MIT (license)

Dependencies

collection, flutter, flutter_localizations, intl, path, shared_preferences

More

Packages that depend on flutter_translate