Skip to content

Commit

Permalink
Added analyzer & fixed the analyzer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Jun 13, 2020
1 parent 8590f94 commit 7157cdc
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
6 changes: 3 additions & 3 deletions kiwi_generator/lib/src/injector_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class InjectorGenerator extends Generator {
final DartType concrete = registerObject.getField('from').toTypeValue();
final DartType concreteType = concrete ?? type;

final String className = concreteType.name;
final String className = concreteType.getDisplayString();
final String typeParameters =
concrete == null ? '' : '<${type.name}, $className>';
concrete == null ? '' : '<${type.getDisplayString()}, $className>';

final String nameArgument = name == null ? '' : ", name: '$name'";
final String constructorName =
Expand Down Expand Up @@ -140,7 +140,7 @@ class InjectorGenerator extends Generator {
) {
final String name = resolvers == null ? null : resolvers[parameter.type];
final String nameArgument = name == null ? '' : "'$name'";
return '${parameter.isNamed ? parameter.name + ': ' : ''}c<${parameter.type.name}>($nameArgument)';
return '${parameter.isNamed ? parameter.name + ': ' : ''}c<${parameter.type.getDisplayString()}>($nameArgument)';
}

Map<DartType, String> _computeResolvers(
Expand Down
39 changes: 39 additions & 0 deletions tool/kiwi_analyze.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

cd ..

echo ""
echo "==========================="
echo "example analyze"
echo "---------------------------"
cd example
flutter analyze
echo "==========================="
cd ..

echo ""
echo "==========================="
echo "flutter_example analyze"
echo "---------------------------"
cd flutter_example
flutter analyze
echo "==========================="
cd ..

echo ""
echo "==========================="
echo "kiwi analyze"
echo "---------------------------"
cd kiwi
flutter analyze
echo "==========================="
cd ..

echo ""
echo "==========================="
echo "kiwi_generator analyze"
echo "---------------------------"
cd kiwi_generator
flutter analyze
echo "==========================="
cd ..
8 changes: 4 additions & 4 deletions tool/kiwi_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd ..

echo ""
echo "==========================="
echo "example format lib"
echo "example build_runner build"
echo "---------------------------"
cd example
flutter packages pub run build_runner build --delete-conflicting-outputs
Expand All @@ -13,7 +13,7 @@ cd ..

echo ""
echo "==========================="
echo "flutter_example format lib"
echo "flutter_example build_runner build"
echo "---------------------------"
cd flutter_example
flutter packages pub run build_runner build --delete-conflicting-outputs
Expand All @@ -22,7 +22,7 @@ cd ..

echo ""
echo "==========================="
echo "kiwi format lib"
echo "kiwi build_runner build"
echo "---------------------------"
cd kiwi
echo "Nothing to generate here"
Expand All @@ -31,7 +31,7 @@ cd ..

echo ""
echo "==========================="
echo "kiwi_generator format lib"
echo "kiwi_generator build_runner build"
echo "---------------------------"
cd kiwi_generator
flutter packages pub run build_runner build --delete-conflicting-outputs
Expand Down

0 comments on commit 7157cdc

Please sign in to comment.