Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (52 sloc) 1.6 KB
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart';
import 'chart_util.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Chart Exploration',
theme: ThemeData(
home: MyHomePage(title: 'Vibration Data'),
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
_MyHomePageState createState() => _MyHomePageState();
class _MyHomePageState extends State<MyHomePage> {
List<Series> vibrationData;
Widget build(BuildContext context) {
ChartUtil().getChartData().then((vibrationData) {
setState(() {
this.vibrationData = vibrationData;
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
body: Center(
child: vibrationData != null
? FractionallySizedBox(
child: TimeSeriesChart(
defaultRenderer: new LineRendererConfig(
includeArea: true, stacked: true),
animate: false,
new DateTimeAxisSpec(renderSpec: NoneRenderSpec()),
heightFactor: .5,
: CircularProgressIndicator()));
You can’t perform that action at this time.