Skip to content

Commit

Permalink
update sdk constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahwilliams committed Mar 5, 2021
1 parent 7fcc19c commit c4344e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lib/src/renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ class Renderer extends Visitor {
@override
void visitPartial(PartialNode node) {
var partialName = node.name;
var template =
partialResolver == null ? null : (partialResolver!(partialName) as Template?);
var template = partialResolver == null
? null
: (partialResolver!(partialName) as Template?);
if (template != null) {
var renderer = Renderer.partial(this, template, node.indent);
var nodes = getTemplateNodes(template);
Expand All @@ -208,7 +209,7 @@ class Renderer extends Visitor {
return _stack.last;
}
var parts = name.split('.');
var object = noSuchProperty;
Object? object = noSuchProperty;
for (var o in _stack.reversed) {
object = _getNamedProperty(o, parts[0]);
if (object != noSuchProperty) {
Expand All @@ -228,7 +229,7 @@ class Renderer extends Visitor {
// which contains the key name, this is object[name]. For other
// objects, this is object.name or object.name(). If no property
// by the given name exists, this method returns noSuchProperty.
Object _getNamedProperty(dynamic object, dynamic name) {
Object? _getNamedProperty(dynamic object, dynamic name) {
if (object is Map && object.containsKey(name)) return object[name];

if (object is List && _integerTag.hasMatch(name)) {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A mustache template library that supports dart2js and dart2native
homepage: https://github.com/jonahwilliams/mustache

environment:
sdk: '>=2.12.0-0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'

dev_dependencies:
test: '^1.16.0-nullsafety.7'
test: '^1.16.5'

0 comments on commit c4344e0

Please sign in to comment.