flutter_localizations_plus 0.3.0 copy "flutter_localizations_plus: ^0.3.0" to clipboard
flutter_localizations_plus: ^0.3.0 copied to clipboard

An enhanced Flutter localization one-stop solution that streamlines multilingual integration for seamless app development.

example/lib/main.dart

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_localizations_plus/localization.dart';
import 'package:flutter_localizations_plus/flutter_localizations_plus.dart';

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

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

  List<Map<String, dynamic>> formatted = Translations.support([
    Localization.en_US,
    Localization.zh_Hans,
    Localization.fr_CA,
    Localization.pt_BR
  ], selected: Platform.localeName, fallback: Localization.zh_Hans);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      supportedLocales: Translations.supportedLocales,
      localizationsDelegates: [
        LocalizationsPlusDelegate(),
        FallbackCupertinoLocalizationsDelegate()
        // ... more localization delegates
      ],
      home: Home(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          Center(
            child: Text(Translations.of(context).text("flight_broadcast_test",
                ["flutter_localizations_plus", "pub.dev"])),
          ),
          Text(Translations.of(context).text("welcome_tips")),
          Text(Translations.of(context)
              .text("local_time_caption", DateTime.now())),
        ],
      ),
    );
  }
}
1
likes
150
points
249
downloads

Publisher

unverified uploader

Weekly Downloads

An enhanced Flutter localization one-stop solution that streamlines multilingual integration for seamless app development.

Repository (GitHub)
View/report issues

Topics

#localizations #locale #l10n #i18n

Documentation

API reference

License

MIT (license)

Dependencies

flutter, sprintf

More

Packages that depend on flutter_localizations_plus