animated_pie_chart 0.0.2 copy "animated_pie_chart: ^0.0.2" to clipboard
animated_pie_chart: ^0.0.2 copied to clipboard

An animated pie chart with rotation and selected index functionality provides a visually appealing way to showcase data. In start it automatically sort list and shows the data in descending form and h [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:animated_pie_chart/animated_pie_chart.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
   MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(title: Text('Animated Pie Chart'),),
        body: Center(
          child:  AnimatedPieChart(
            sort: true,
            stokeWidth: 8.0,
            padding:3.0,
            animatedSpeed:500,
            pieRadius: 70.0,
            colorsList: [
              Colors.brown,
              Colors.purple,
              Colors.red,
              Colors.yellow,
              Colors.green,
              Colors.blue,
            ],

            pieData: [
              for(int i=0;i<pieChartList.length;i++)
                MdPieChart(value: pieChartList[i].value, name: pieChartList[i].name)
            ],

          ) ,
        ),
      )
    );
  }

  List<MdPieChart> pieChartList = [
    MdPieChart( value: 10,name:  'Apple'),
    MdPieChart( value: 5,name:  'Peach'),
    MdPieChart( value: 15,name:  'Mango'),
    MdPieChart( value: 20,name:  'Banana'),
    MdPieChart( value: 2,name:  'Peach'),
    MdPieChart( value: 8,name:  'Guava'),
    MdPieChart( value: 12,name:  'Lemon'),
    MdPieChart( value: 14,name:  'pineApple'),
    MdPieChart( value: 6,name:  'kiwi'),
    MdPieChart( value: 8,name:  'pear'),
  ];
}
12
likes
100
pub points
68%
popularity

Publisher

unverified uploader

An animated pie chart with rotation and selected index functionality provides a visually appealing way to showcase data. In start it automatically sort list and shows the data in descending form and highest value goes to down in middle. And after the chart rotates as the selected index is brought down to the center, making it more prominent and easy to read. Overall, an animated pie chart with rotation and selected index functionality is an excellent tool for presenting data in a dynamic and engaging way.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

bouncing_widget, flutter

More

Packages that depend on animated_pie_chart