diff --git a/README.md b/README.md index 929a224..a4cbbcf 100644 --- a/README.md +++ b/README.md @@ -34,19 +34,19 @@ __Note:__ This is a WIP early implementation, use at your own risk. You can inst Import the package: -``` +```dart import 'package:flutter_circular_chart/flutter_circular_chart.dart'; ``` 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 _chartKey; +```dart +final GlobalKey _chartKey = new GlobalKey(); ``` Create chart data entry objects: -``` +```dart List data = [ new CircularStackEntry( [ @@ -62,7 +62,7 @@ List data = [ Create an `AnimatedCircularChart`, passing it the `_chartKey` and initial `data`: -``` +```dart @override Widget build(BuildContext context) { return new AnimatedCircularChart( @@ -76,7 +76,7 @@ Widget build(BuildContext context) { Call `updateData` to animate the chart: -``` +```dart void _cycleSamples() { List nextData = [ new CircularStackEntry(