polyglothq 1.1.4 copy "polyglothq: ^1.1.4" to clipboard
polyglothq: ^1.1.4 copied to clipboard

polyglothq is a Dart CLI to support using Polyglot for Flutter projects. polyglothq fetches translations from polyglothq.com, and converts them to a Flutter-suitable form.

example/lib/main.dart

import 'package:example/util/localization/strings.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Polyglot Demo',
      localizationsDelegates: AppLocalizations.localizationsDelegates,
      supportedLocales: AppLocalizations.supportedLocales,
      home: HomeScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Text(Strings.of(context).appName),
      ),
    );
  }
}
3
likes
130
pub points
0%
popularity

Publisher

verified publisherinfinum.com

polyglothq is a Dart CLI to support using Polyglot for Flutter projects. polyglothq fetches translations from polyglothq.com, and converts them to a Flutter-suitable form.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

args, console, dio, get_it, japx, json_annotation, recase, yaml

More

Packages that depend on polyglothq