telereso_generator 0.0.5-alpha copy "telereso_generator: ^0.0.5-alpha" to clipboard
telereso_generator: ^0.0.5-alpha copied to clipboard

outdated

Genrate wrapper for your Intl implemntation .

telereso_generator #

Builder for Telereso to support l10n localization

Pub

Usage #

  1. Add telereso_generator to your pubspec.yaml as dev_dependency. Make sure build_runner is also listed as development dependency.

     dev_dependencies:
       build_runner: ^1.0.0
       telereso_generator: ^0.0.5-alpha
    
  2. Run flutter pub get.

  3. Add build.yaml in your project's root (next to l10n.yaml)

    targets:
      $default:
        builders:
          telereso_generator|telereso:
            enabled: true
            options:
              template-arb-file: intl_en.arb
              output-localization-file: app_localizations.dart
              output-class: AppLocalizations
              output-class-remote: RemoteLocalizations
    
  • Notice that first 3 options are the same as your l10n.yaml file, these flags has to be the same and required
  • output-class-remote is the name of your new wrapper class, if not set it will be RemoteLocalizationsDefault
  1. Build!
    flutter pub run build_runner build --delete-conflicting-outputs
    
    Or watch for auto update
    flutter pub run build_runner watch --delete-conflicting-outputs
    
  2. A file will be generated with the same structure as your old localization class, you just have to use the new one in your app.