From 15d9df37293f88c695d6587a24e18cd0306338f4 Mon Sep 17 00:00:00 2001 From: Victor Uvarov Date: Fri, 25 Oct 2019 13:07:46 -0700 Subject: [PATCH] User final for generated variables that are not reassigned --- lib/src/class_builder.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/class_builder.dart b/lib/src/class_builder.dart index f8d44d3..f229534 100644 --- a/lib/src/class_builder.dart +++ b/lib/src/class_builder.dart @@ -19,8 +19,8 @@ class ClassBuilder extends Builder { String buildRead() { var code = StringBuffer(); code.writeln(''' - var numOfFields = reader.readByte(); - var fields = { + final numOfFields = reader.readByte(); + final fields = { for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), }; return ${cls.name}(