Skip to content
On this page

PieChart

A circular chart for showing proportions of a whole.

PieChart in FluttyUIPieChart in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

PieChart

const PieChart({
  super.key,
  required this.data,
  required this.labelKey,
  required this.valueKey,
  this.colorKey = 'color',
  this.pie = const Pie(),
  this.width,
  this.height,
  this.aspectRatio = 1,
  this.padding = const EdgeInsets.all(16),
  this.animation = const ChartAnimation(),
  this.resetKey,
  this.interaction = const ChartInteraction(),
  this.controller,
  this.onSelectionChanged,
  this.onChartBoundsChange,
  this.center,
  this.emptyBuilder,
  this.semanticsLabel = 'Pie chart',
});
ParameterTypeRequiredDefault
keyKey?Nonull
dataList<ChartDatum>Yes—
labelKeyStringYes—
valueKeyStringYes—
colorKeyStringNo'color'
piePieNoconst Pie()
widthdouble?Nonull
heightdouble?Nonull
aspectRatiodoubleNo1
paddingEdgeInsetsNoconst EdgeInsets.all(16)
animationChartAnimationNoconst ChartAnimation()
resetKeyObject?Nonull
interactionChartInteractionNoconst ChartInteraction()
controllerChartController?Nonull
onSelectionChangedValueChanged<ChartSelection?>?Nonull
onChartBoundsChangeValueChanged<Rect>?Nonull
centerWidget?Nonull
emptyBuilderWidgetBuilder?Nonull
semanticsLabelStringNo'Pie chart'

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/charts/pie_chart/pie_chart.dart

This reference is generated from the PieChart declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI