auto_localized_generator 0.5.0 copy "auto_localized_generator: ^0.5.0" to clipboard
auto_localized_generator: ^0.5.0 copied to clipboard

outdated

Code generator for auto_localized, runtime-safe Flutter localization.

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(),
        ),
      ),
    );
  }
}
2
likes
0
pub points
46%
popularity

Publisher

unverified uploader

Code generator for auto_localized, runtime-safe Flutter localization.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, auto_localized, build, recase, source_gen, yaml

More

Packages that depend on auto_localized_generator