auto_localized 1.3.3 copy "auto_localized: ^1.3.3" to clipboard
auto_localized: ^1.3.3 copied to clipboard

Easy to use runtime-safe Flutter app localization tool using code generation.

example/lib/main.dart

import 'package:auto_localized/auto_localized.dart';
import 'package:example/localization.al.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AutoLocalizedApp(
      child: MaterialApp(
        title: 'Auto Localized Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        supportedLocales: context.supportedLocales,
        localizationsDelegates: context.localizationsDelegates,
        home: HomePage(),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          Strings.welcomeName.get('Marcin', ':D'),
        ),
      ),
      body: Center(
        child: Text(
          Strings.getTestMessage(),
        ),
      ),
    );
  }
}
22
likes
150
pub points
73%
popularity

Publisher

unverified uploader

Easy to use runtime-safe Flutter app localization tool using code generation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_localizations

More

Packages that depend on auto_localized