1、Prefer using lowerCamelCase for constant names.
(1)代码上面添加一行注释:// ignore: constant_identifier_names
(2)项目根目录增加一个配置文件:analysis_options.yaml,并添加规则。
linter:
rules:
constant_identifier_names: false
2、 Use interpolation to compose strings and values.
改变字符串拼接方式。
print('hi_net:' + log.toString());
改为:
print('hi_net:${log.toString()}');
3、Unnecessary braces in a string interpolation. Try removing the braces.
改变字符串拼接方式。
print("aaa---${result}");
改为:
print("aaa---$result");
4、Don't invoke 'print' in production code.Try using a logging framework.
print("aaa---$result");
改为:
import 'package:flutter/material.dart';
//或者
import 'package:flutter/cupertino.dart';
debugPrint("aaa---$result");