| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import 'package:build/build.dart';
- String toCamelCase(String s) {
- if (s.length < 2) {
- return s.toLowerCase();
- }
- return s[0].toLowerCase() + s.substring(1);
- }
- String getImportStr(BuildStep buildStep) {
- var importStr = "";
- if (buildStep.inputId.path.contains('lib/')) {
- importStr =
- "package:${buildStep.inputId.package}/${buildStep.inputId.path.replaceFirst('lib/', '')}";
- } else {
- importStr = "${buildStep.inputId.path}";
- }
- return importStr;
- }
- bool isSpeciousType(String type) {
- if (type == "int" ||
- type == "double" ||
- type == "num" ||
- type == "Runes" ||
- type == "String" ||
- type == "bool" ||
- type == "dynamic" ||
- type == "List" ||
- type == "Map" ||
- type == "dynamic") {
- return false;
- }
- return true;
- }
- /// 获取type
- Set<String> getType(String type) {
- type.replaceAll("<", ",");
- type.replaceAll(">", ",");
- return (type
- .replaceAll("<", ",")
- .replaceAll(">", ",")
- .split(",")
- .map((e) => e.trim())
- .toList()
- ..removeWhere((element) => element.trim().isEmpty))
- .toSet();
- }
|