auto_strings 1.0.3
auto_strings: ^1.0.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 'dart:io';
import 'lib/app_strings.dart';
void main() {
stdout.writeln('=== Auto Strings Example ===\n');
// Using the generated string constants
stdout.writeln('🎉 ${AppStrings.welcomeToAutoStrings}');
stdout.writeln('');
// Example: Login form strings
stdout.writeln('📝 Login Form Strings:');
stdout.writeln(' - ${AppStrings.pleaseEnterYourEmailAddress}');
stdout.writeln(' - ${AppStrings.pleaseEnterYourPassword}');
stdout.writeln(' - ${AppStrings.forgotPassword}');
stdout.writeln('');
// Example: Success/Error messages
stdout.writeln('✅ Messages:');
stdout.writeln(' - ${AppStrings.loginSuccessful}');
stdout.writeln(' - ${AppStrings.invalidCredentialsPleaseTryAgain}');
stdout.writeln(' - ${AppStrings.profileUpdatedSuccessfully}');
stdout.writeln('');
// Example: Other UI strings
stdout.writeln('📄 Other Strings:');
stdout.writeln(' - ${AppStrings.termsAndConditionsApply}');
stdout.writeln(' - ${AppStrings.privacyPolicy}');
stdout.writeln(' - ${AppStrings.contactSupportForHelp}');
stdout.writeln('');
stdout.writeln('✨ All strings are type-safe and autocomplete-friendly!');
stdout.writeln('💡 No more typos in string literals!');
}