Search code examples
fluttergraphpackagefl-chart

can I add something in the middle of a pie chart by using fl-chart package?


How to add an image / icon or any object in the middle of a pie chart in fl_chart package for flutter ?

I want to make this: Iwant to have the running man!


Solution

  • you can try stack and use icon on top of pie and use alignment or padding to get icon in middle like :

     Stack(
                          alignment: Alignment.center,
                          children: [
                            // icon, svg, image
                            Padding(
                              padding: const EdgeInsets.all(8.0),
                              child: Icon(Icons.add),
                            ),
                            your_fl_widget(),
                          ],
                        )