MLStringExtractor class
REGEX-based string extractor for Dart/Flutter code.
This implementation uses pattern matching to detect translatable strings in Dart code. It identifies user-facing text in common Flutter widgets and filters out technical strings, URLs, debug messages, etc.
The extractor performs:
- Pattern-based extraction from string literals
- Context analysis for common Flutter widgets
- Filtering of technical strings, URLs, debug messages
- Validation of string content
Usage:
final extractor = MLStringExtractor();
await extractor.initialize();
final strings = await extractor.extractStrings(sourceCode);
extractor.dispose();
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInitialized → bool
-
Check if the extractor is initialized
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void - Dispose resources
-
extractStrings(
String sourceCode) → Future< List< String> > - Extract translatable strings using REGEX patterns.
-
initialize(
) → Future< void> - Initialize the string extractor.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited