Avoid 'as' keyword
It has performance implications in release mode. We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
This commit is contained in:
@@ -68,7 +68,7 @@ class AndroidApk extends ApplicationPackage {
|
||||
String launchActivity;
|
||||
for (xml.XmlElement category in document.findAllElements('category')) {
|
||||
if (category.getAttribute('android:name') == 'android.intent.category.LAUNCHER') {
|
||||
xml.XmlElement activity = category.parent.parent as xml.XmlElement;
|
||||
xml.XmlElement activity = category.parent.parent;
|
||||
String activityName = activity.getAttribute('android:name');
|
||||
launchActivity = "$id/$activityName";
|
||||
break;
|
||||
|
||||
@@ -294,9 +294,10 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
for (String package in packages.keys)
|
||||
packagesBody.writeln('$package:${path.toUri(packages[package])}');
|
||||
|
||||
/// specify analysis options
|
||||
/// note that until there is a default "all-in" lint rule-set we need
|
||||
/// to opt-in to all desired lints (https://github.com/dart-lang/sdk/issues/25843)
|
||||
/// Specify analysis options.
|
||||
/// Note that until there is a default "all-in" lint rule-set we need
|
||||
/// to opt-in to all desired lints (https://github.com/dart-lang/sdk/issues/25843).
|
||||
/// For a list of lints, see: http://dart-lang.github.io/linter/lints/
|
||||
String optionsBody = '''
|
||||
analyzer:
|
||||
errors:
|
||||
@@ -307,6 +308,8 @@ analyzer:
|
||||
todo: ignore
|
||||
linter:
|
||||
rules:
|
||||
# we'll turn on avoid_as as soon as it doesn't complain about "as dynamic"
|
||||
# - avoid_as
|
||||
- camel_case_types
|
||||
# sometimes we have no choice (e.g. when matching other platforms)
|
||||
# - constant_identifier_names
|
||||
|
||||
Reference in New Issue
Block a user