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

outdated

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.testMessage.get(),
        ),
      ),
    );
  }
}
22
likes
0
points
212
downloads

Publisher

unverified uploader

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_localizations

More

Packages that depend on auto_localized