Update README.md

This commit is contained in:
Victor Choueiri 2018-02-01 17:41:30 +02:00 committed by GitHub
parent b9496c6ada
commit 9ac1f3c6cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,11 +38,15 @@ Import the package:
import 'package:flutter_circular_chart/flutter_circular_chart.dart'; import 'package:flutter_circular_chart/flutter_circular_chart.dart';
``` ```
Create chart data entry objects: Create a [GlobalKey](https://docs.flutter.io/flutter/widgets/GlobalKey-class.html) to be able to access the chart and update its data:
``` ```
final GlobalKey<AnimatedCircularChartState> _chartKey; final GlobalKey<AnimatedCircularChartState> _chartKey;
```
Create chart data entry objects:
```
List<CircularStackEntry> data = <CircularStackEntry>[ List<CircularStackEntry> data = <CircularStackEntry>[
new CircularStackEntry( new CircularStackEntry(
<CircularSegmentEntry>[ <CircularSegmentEntry>[
@ -55,7 +59,8 @@ List<CircularStackEntry> data = <CircularStackEntry>[
), ),
]; ];
``` ```
Create an `AnimatedCircularChart`:
Create an `AnimatedCircularChart`, passing it the `_chartKey` and initial `data`:
``` ```
@override @override