docs: add long string guidance to Dart style guide (#1970)

This commit is contained in:
Bryan Oltman
2024-04-25 12:57:12 -04:00
committed by GitHub
parent 955c8ba87f
commit c78f3dc44a
+14
View File
@@ -53,3 +53,17 @@ group('myFunction', () {
});
});
```
## PREFER to use multiline string literals for long strings
This makes the string easier to read, and reduces the chance of accidentally
including too few or too many spaces in the string.
```dart
// BAD
final longString = 'This is a string longer than the eighty character '
'limit that our lint rules enforce.';
// GOOD
final longString = '''This is a string longer than the eighty character limit that our lint rules enforce.'''
```