mirror of
https://github.com/flutter/flutter
synced 2024-10-12 11:12:54 +00:00
enable unnecessary_late (#96417)
This commit is contained in:
parent
7aaa87b5b6
commit
40a2689b9c
|
@ -215,7 +215,7 @@ linter:
|
|||
# - unnecessary_final # conflicts with prefer_final_locals
|
||||
- unnecessary_getters_setters
|
||||
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
|
||||
# - unnecessary_late # not yet tested
|
||||
- unnecessary_late
|
||||
- unnecessary_new
|
||||
- unnecessary_null_aware_assignments
|
||||
- unnecessary_null_checks
|
||||
|
|
|
@ -387,7 +387,7 @@ class LogicalKeyData {
|
|||
}
|
||||
|
||||
// Map Web key to the pair of key names
|
||||
static late final Map<String, _ModifierPair> _chromeModifiers = () {
|
||||
static final Map<String, _ModifierPair> _chromeModifiers = () {
|
||||
final String rawJson = File(path.join(dataRoot, 'chromium_modifiers.json',)).readAsStringSync();
|
||||
return (json.decode(rawJson) as Map<String, dynamic>).map((String key, dynamic value) {
|
||||
final List<dynamic> pair = value as List<dynamic>;
|
||||
|
@ -396,7 +396,7 @@ class LogicalKeyData {
|
|||
}();
|
||||
|
||||
/// Returns the static map of printable representations.
|
||||
static late final Map<String, String> printable = (() {
|
||||
static final Map<String, String> printable = (() {
|
||||
final String printableKeys = File(path.join(dataRoot, 'printable.json',)).readAsStringSync();
|
||||
return (json.decode(printableKeys) as Map<String, dynamic>)
|
||||
.cast<String, String>();
|
||||
|
@ -407,7 +407,7 @@ class LogicalKeyData {
|
|||
/// These include synonyms for keys which don't have printable
|
||||
/// representations, and appear in more than one place on the keyboard (e.g.
|
||||
/// SHIFT, ALT, etc.).
|
||||
static late final Map<String, List<String>> synonyms = (() {
|
||||
static final Map<String, List<String>> synonyms = (() {
|
||||
final String synonymKeys = File(path.join(dataRoot, 'synonyms.json',)).readAsStringSync();
|
||||
final Map<String, dynamic> dynamicSynonym = json.decode(synonymKeys) as Map<String, dynamic>;
|
||||
return dynamicSynonym.map((String name, dynamic values) {
|
||||
|
|
|
@ -171,7 +171,7 @@ class MatrixUtils {
|
|||
return Rect.fromLTRB(_minMax[0], _minMax[1], _minMax[2], _minMax[3]);
|
||||
}
|
||||
|
||||
static late final Float64List _minMax = Float64List(4);
|
||||
static final Float64List _minMax = Float64List(4);
|
||||
static void _accumulate(Float64List m, double x, double y, bool first, bool isAffine) {
|
||||
final double w = isAffine ? 1.0 : 1.0 / (m[3] * x + m[7] * y + m[15]);
|
||||
final double tx = (m[0] * x + m[4] * y + m[12]) * w;
|
||||
|
|
|
@ -153,7 +153,7 @@ class TestRenderingFlutterBinding extends BindingBase with SchedulerBinding, Ser
|
|||
}
|
||||
}
|
||||
|
||||
late final TestRenderingFlutterBinding _renderer = TestRenderingFlutterBinding();
|
||||
final TestRenderingFlutterBinding _renderer = TestRenderingFlutterBinding();
|
||||
TestRenderingFlutterBinding get renderer => _renderer;
|
||||
|
||||
|
||||
|
|
|
@ -696,7 +696,7 @@ class KeyEventSimulator {
|
|||
});
|
||||
}
|
||||
|
||||
static late final Map<String, PhysicalKeyboardKey> _debugNameToPhysicalKey = (() {
|
||||
static final Map<String, PhysicalKeyboardKey> _debugNameToPhysicalKey = (() {
|
||||
final Map<String, PhysicalKeyboardKey> result = <String, PhysicalKeyboardKey>{};
|
||||
for (final PhysicalKeyboardKey key in PhysicalKeyboardKey.knownPhysicalKeys) {
|
||||
final String? debugName = key.debugName;
|
||||
|
|
Loading…
Reference in a new issue