Why would you want to do that? <template if
removes the nodes from the DOM when show == false
.
All you have to do is
In HTML
`on-click='{{hide}}'`
In Dart
void hide() {
show = false;
}
If you don't want to hide the <div on-click='...>
move it outside the <template if=...>
Hint:
If your show
field is of type bool you can simplify to
<template if="{{show}}">