13 Horiz
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
buildLegendItem(Colors.red, 'To do', 30),
const Gap(24),
buildLegendItem(Colors.blue, 'In progress', 15),
const Gap(24),
buildLegendItem(Colors.green, 'Done', 80),
],
),
Widget buildLegendItem(Color color, String title, num data) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'$data',
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24,
color: Colors.black87,
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.circle, size: 10, color: color),
const Gap(4),
Text(
title,
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
color: Colors.black54,
),
),
],
),
],
);
}