minor: you should add "{...}" (they can be drop for single line if statement according to dart cc)