迷你图不想显示

时间:2019-08-22 21:15:25

标签: sqlite flutter dart

我试图绘制迷你图,以显示一些统计数据,我尝试过使用此代码,但未显示任何内容,我不知道为什么,请有人可以帮助我

List<double> list;
  Future<List<double>> dataline() async {

      final dao1 = Provider.of<CommandeDao>(context);

      List<NombreCommandeParDateResult> liste = await dao1.NombreCommandeParDate();

      for(var value in liste){
        list.add(value.count.toDouble());
      }
      //List<double> list = new List<double>.from(liste);
      return list;
  }

 FutureBuilder<List<double>>(
                    future: dataline(),
                    builder: (BuildContext context, AsyncSnapshot<List<double>> snapshot) {
                      return snapshot.hasData?Padding(
                        padding: EdgeInsets.all(1.0),
                        child: new Sparkline(
                          data: snapshot.data,
                          lineColor: Color(0xffff6101),
                          pointsMode: PointsMode.all,
                          pointSize: 8.0,
                        ),
                      ):CircularProgressIndicator();

这是数据库中的功能

'NombreCommandeParDate':
    'SELECT count(id_commande) AS count, date FROM commandes group by date;'

0 个答案:

没有答案