@@ -269,10 +269,9 @@ abstract class RendererBase<T extends Object?> {
269269
270270 // If this section is not a conditional or repeated section, it is a value
271271 // section, regardless of type.
272- var isNullValue = property.isNullValue! ;
273- if (node.invert && isNullValue (context)) {
272+ if (node.invert && property.isNullValue (context)) {
274273 renderBlock (node.children);
275- } else if (! node.invert && ! isNullValue (context)) {
274+ } else if (! node.invert && ! property. isNullValue (context)) {
276275 property.renderValue !(context, this , node.children, sink);
277276 }
278277 }
@@ -288,17 +287,17 @@ abstract class RendererBase<T extends Object?> {
288287 }
289288}
290289
291- String renderSimple (
292- Object context, List < MustachioNode > ast, Template template, StringSink sink,
290+ String renderSimple (Object ? context, List < MustachioNode > ast, Template template,
291+ StringSink sink,
293292 {required RendererBase <Object > parent, required Set <String > getters}) {
294293 var renderer = SimpleRenderer (context, parent, template, sink, getters);
295294 renderer.renderBlock (ast);
296295 return renderer.sink.toString ();
297296}
298297
299- class SimpleRenderer extends RendererBase <Object > {
298+ class SimpleRenderer extends RendererBase <Object ? > {
300299 SimpleRenderer (
301- Object context,
300+ Object ? context,
302301 RendererBase <Object > parent,
303302 Template template,
304303 StringSink sink,
@@ -356,7 +355,7 @@ class Property<T> {
356355 final Iterable <void > Function (
357356 T , RendererBase <T >, List <MustachioNode >, StringSink )? renderIterable;
358357
359- final bool Function (T )? isNullValue;
358+ final bool Function (T ) isNullValue;
360359
361360 final void Function (T , RendererBase <T >, List <MustachioNode >, StringSink )?
362361 renderValue;
@@ -366,8 +365,11 @@ class Property<T> {
366365 required this .renderVariable,
367366 this .getBool,
368367 this .renderIterable,
369- this .isNullValue,
370- this .renderValue});
368+ // TODO(jcollins-g): consider making this required or emitting warnings
369+ // if called on a non-nullable?
370+ bool Function (T )? isNullValue,
371+ this .renderValue})
372+ : isNullValue = (isNullValue ?? (_) => false );
371373
372374 String renderSimpleVariable (
373375 T c, List <String > remainingNames, String typeString) {
0 commit comments