docs: add long string guidance to Dart style guide (#1970)
This commit is contained in:
@@ -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.'''
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user