auto_strings 1.0.2+3 copy "auto_strings: ^1.0.2+3" to clipboard
auto_strings: ^1.0.2+3 copied to clipboard

A simple Dart/Flutter code generator that converts plain text into static const String fields.

example/main.dart

// Example demonstrating how to use auto_strings generated constants
//
// Before running this file, generate the strings using:
// dart run auto_strings strings.txt lib/app_strings.dart AppStrings

import 'lib/app_strings.dart';

void main() {
  print('=== Auto Strings Example ===\n');

  // Using the generated string constants
  print('🎉 ${AppStrings.welcomeToAutoStrings}');
  print('');

  // Example: Login form strings
  print('📝 Login Form Strings:');
  print('   - ${AppStrings.pleaseEnterYourEmailAddress}');
  print('   - ${AppStrings.pleaseEnterYourPassword}');
  print('   - ${AppStrings.forgotPassword}');
  print('');

  // Example: Success/Error messages
  print('✅ Messages:');
  print('   - ${AppStrings.loginSuccessful}');
  print('   - ${AppStrings.invalidCredentialsPleaseTryAgain}');
  print('   - ${AppStrings.profileUpdatedSuccessfully}');
  print('');

  // Example: Other UI strings
  print('📄 Other Strings:');
  print('   - ${AppStrings.termsAndConditionsApply}');
  print('   - ${AppStrings.privacyPolicy}');
  print('   - ${AppStrings.contactSupportForHelp}');
  print('');

  print('✨ All strings are type-safe and autocomplete-friendly!');
  print('💡 No more typos in string literals!');
}
3
likes
150
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

A simple Dart/Flutter code generator that converts plain text into static const String fields.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path

More

Packages that depend on auto_strings