loadTemplate function
Load template JSON from file
Implementation
Template loadTemplate(String path) {
final file = File(path);
if (!file.existsSync()) {
throw Exception('Template file not found: $path');
}
final jsonStr = file.readAsStringSync();
final jsonData = jsonDecode(jsonStr) as Map<String, dynamic>;
return Template.fromJson(jsonData);
}