You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/pangea/pages/analytics/bar_chart_card.dart

45 lines
1.2 KiB
Dart

import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class BarChartCard extends StatelessWidget {
const BarChartCard({
super.key,
required this.barChart,
required this.legend,
required this.loadingData,
});
final BarChart? barChart;
final Widget legend;
final bool loadingData;
@override
Widget build(BuildContext context) {
return Card(
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
color: Theme.of(context).scaffoldBackgroundColor,
child: Padding(
padding: const EdgeInsets.all(8),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 14),
Expanded(
child: loadingData || barChart == null
? const Center(
child: CircularProgressIndicator(),
)
: barChart!,
),
const SizedBox(height: 10),
legend,
const SizedBox(height: 6),
],
),
),
);
}
}