enable lint prefer_interpolation_to_compose_strings (#83407)
This commit is contained in:
committed by
GitHub
parent
71e711547f
commit
34059eec2c
@@ -36,9 +36,9 @@ class FloatToken extends NumberToken {
|
||||
static double _parse(String stringRep) {
|
||||
String toParse = stringRep;
|
||||
if (toParse.startsWith('.'))
|
||||
toParse = '0' + toParse;
|
||||
toParse = '0$toParse';
|
||||
if (toParse.endsWith('.'))
|
||||
toParse = toParse + '0';
|
||||
toParse = '${toParse}0';
|
||||
return double.parse(toParse);
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,8 @@ class CalcExpression {
|
||||
case ExpressionState.LeadingNeg:
|
||||
case ExpressionState.Number:
|
||||
final ExpressionToken last = outList.removeLast()!;
|
||||
newToken = FloatToken(last.stringRep! + '.');
|
||||
final String value = last.stringRep!;
|
||||
newToken = FloatToken('$value.');
|
||||
break;
|
||||
case ExpressionState.Point:
|
||||
case ExpressionState.NumberWithPoint:
|
||||
|
||||
@@ -220,7 +220,8 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
if (_selectedAction.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
return _capitalize(_results[_selectedAction]!) + '!';
|
||||
final String value = _capitalize(_results[_selectedAction]!);
|
||||
return '$value!';
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -317,17 +317,20 @@ class _UsNumberTextInputFormatter extends TextInputFormatter {
|
||||
selectionIndex++;
|
||||
}
|
||||
if (newTextLength >= 4) {
|
||||
newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') ');
|
||||
final String value = newValue.text.substring(0, usedSubstringIndex = 3);
|
||||
newText.write('$value) ');
|
||||
if (newValue.selection.end >= 3)
|
||||
selectionIndex += 2;
|
||||
}
|
||||
if (newTextLength >= 7) {
|
||||
newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-');
|
||||
final String value = newValue.text.substring(3, usedSubstringIndex = 6);
|
||||
newText.write('$value-');
|
||||
if (newValue.selection.end >= 6)
|
||||
selectionIndex++;
|
||||
}
|
||||
if (newTextLength >= 11) {
|
||||
newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' ');
|
||||
final String value = newValue.text.substring(6, usedSubstringIndex = 10);
|
||||
newText.write('$value ');
|
||||
if (newValue.selection.end >= 10)
|
||||
selectionIndex++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user