Skip to content

Commit 1140660

Browse files
committed
created extension utils
1 parent 2519ac7 commit 1140660

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:analyzer/dart/element/type.dart';
2+
3+
extension DartTypeExtension on DartType {
4+
5+
bool get isPrimitive {
6+
return isDartCoreBool ||
7+
isDartCoreDouble ||
8+
isDartCoreFunction ||
9+
isDartCoreInt ||
10+
isDartCoreNum ||
11+
isDartCoreString ||
12+
isDartCoreSymbol;
13+
}
14+
15+
bool get isFuture => isDartAsyncFuture || isDartAsyncFutureOr;
16+
17+
bool get isCollection => isDartCoreMap || isDartCoreList || isDartCoreSet;
18+
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export './dart_type_extension.dart';

0 commit comments

Comments
 (0)