Make non-global constants have consistent naming (with just _ instead of _k) (#17584)
Our style guide says the k's are not necessary, and it seems like a good idea to make all the code be consistent on this. Only naming changes to private vars: no logic changes.
This commit is contained in:
@@ -94,17 +94,17 @@ class _ShrineGridLayout extends SliverGridLayout {
|
||||
}
|
||||
|
||||
class _ShrineGridDelegate extends SliverGridDelegate {
|
||||
static const double _kSpacing = 8.0;
|
||||
static const double _spacing = 8.0;
|
||||
|
||||
@override
|
||||
SliverGridLayout getLayout(SliverConstraints constraints) {
|
||||
final double tileWidth = (constraints.crossAxisExtent - _kSpacing) / 2.0;
|
||||
final double tileWidth = (constraints.crossAxisExtent - _spacing) / 2.0;
|
||||
const double tileHeight = 40.0 + 144.0 + 40.0;
|
||||
return new _ShrineGridLayout(
|
||||
tileWidth: tileWidth,
|
||||
tileHeight: tileHeight,
|
||||
rowStride: tileHeight + _kSpacing,
|
||||
columnStride: tileWidth + _kSpacing,
|
||||
rowStride: tileHeight + _spacing,
|
||||
columnStride: tileWidth + _spacing,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
||||
|
||||
SyntaxHighlighterStyle _style;
|
||||
|
||||
static const List<String> _kKeywords = const <String>[
|
||||
static const List<String> _keywords = const <String>[
|
||||
'abstract', 'as', 'assert', 'async', 'await', 'break', 'case', 'catch',
|
||||
'class', 'const', 'continue', 'default', 'deferred', 'do', 'dynamic', 'else',
|
||||
'enum', 'export', 'external', 'extends', 'factory', 'false', 'final',
|
||||
@@ -75,7 +75,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
||||
'void', 'while', 'with', 'yield'
|
||||
];
|
||||
|
||||
static const List<String> _kBuiltInTypes = const <String>[
|
||||
static const List<String> _builtInTypes = const <String>[
|
||||
'int', 'double', 'num', 'bool'
|
||||
];
|
||||
|
||||
@@ -263,9 +263,9 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
|
||||
if (word.startsWith('_'))
|
||||
word = word.substring(1);
|
||||
|
||||
if (_kKeywords.contains(word))
|
||||
if (_keywords.contains(word))
|
||||
type = _HighlightType.keyword;
|
||||
else if (_kBuiltInTypes.contains(word))
|
||||
else if (_builtInTypes.contains(word))
|
||||
type = _HighlightType.keyword;
|
||||
else if (_firstLetterIsUpperCase(word))
|
||||
type = _HighlightType.klass;
|
||||
|
||||
@@ -65,7 +65,7 @@ class StockData extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
static const int _kChunkCount = 30;
|
||||
static const int _chunkCount = 30;
|
||||
int _nextChunk = 0;
|
||||
|
||||
String _urlToFetch(int chunk) {
|
||||
@@ -86,7 +86,7 @@ class StockData extends ChangeNotifier {
|
||||
}
|
||||
const JsonDecoder decoder = const JsonDecoder();
|
||||
add(decoder.convert(json));
|
||||
if (_nextChunk < _kChunkCount) {
|
||||
if (_nextChunk < _chunkCount) {
|
||||
_fetchNextChunk();
|
||||
} else {
|
||||
_end();
|
||||
|
||||
Reference in New Issue
Block a user