rand dart fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'package:settings_gen/src/template/util.dart';
|
||||
|
||||
class CommaList<T> {
|
||||
CommaList(this.templates) : assert(templates != null);
|
||||
CommaList(this.templates);
|
||||
|
||||
final List<T> templates;
|
||||
|
||||
@@ -11,10 +11,7 @@ class CommaList<T> {
|
||||
}
|
||||
|
||||
class SurroundedCommaList<T> {
|
||||
SurroundedCommaList(this.prefix, this.suffix, this.templates)
|
||||
: assert(prefix != null),
|
||||
assert(suffix != null),
|
||||
assert(templates != null);
|
||||
SurroundedCommaList(this.prefix, this.suffix, this.templates);
|
||||
|
||||
final String prefix;
|
||||
final String suffix;
|
||||
|
||||
@@ -11,9 +11,7 @@ class ParamTemplate {
|
||||
String get metadata => hasRequiredAnnotation ? '@required ' : '';
|
||||
|
||||
@override
|
||||
String toString() => defaultValue == null
|
||||
? '$metadata$type $name'
|
||||
: '$type $name = $defaultValue';
|
||||
String toString() => '$type $name = $defaultValue';
|
||||
}
|
||||
|
||||
class TypeParamTemplate {
|
||||
@@ -23,7 +21,7 @@ class TypeParamTemplate {
|
||||
String get asArgument => name;
|
||||
|
||||
@override
|
||||
String toString() => bound == null ? name : '$name extends $bound';
|
||||
String toString() => '$name extends $bound';
|
||||
}
|
||||
|
||||
class NamedArgTemplate {
|
||||
|
||||
@@ -23,10 +23,8 @@ class LibraryScopedNameFinder {
|
||||
|
||||
Map<Element, String> _namesByElement;
|
||||
Map<Element, String> get namesByElement {
|
||||
if (_namesByElement != null) {
|
||||
return _namesByElement;
|
||||
}
|
||||
|
||||
return _namesByElement;
|
||||
|
||||
_namesByElement = {};
|
||||
|
||||
// Add all of this library's type-defining elements to the name map
|
||||
|
||||
Reference in New Issue
Block a user