templateNotes function
Optional notes block. Empty body returns nothing.
Implementation
Widget templateNotes(TemplateTheme theme, {required String title, String? body}) {
if (body == null || body.trim().isEmpty) {
return const SizedBox.shrink();
}
return Container(
width: double.infinity,
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(color: theme.wash, borderRadius: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(title, style: TextStyle(fontSize: 8, color: theme.accent)),
SizedBox(height: 4),
Text(
body,
style: TextStyle(fontSize: 10, height: 1.35, color: theme.ink),
),
],
),
);
}