Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sqlite 生成火花线(脏)时引发以下状态错误:错误状态:无元素_Sqlite_Flutter_Dart - Fatal编程技术网

Sqlite 生成火花线(脏)时引发以下状态错误:错误状态:无元素

Sqlite 生成火花线(脏)时引发以下状态错误:错误状态:无元素,sqlite,flutter,dart,Sqlite,Flutter,Dart,我需要画一个火花线,数据的输入来自sqlite数据库,我不知道为什么它会给我这个错误,请有人帮助我,我正在尝试使用这个请求计算每天的订单:“选择count(id_commande)作为count,date from commands group by date;” 这是我的数据库类: class Commandes extends Table{ IntColumn get idCommande => integer().autoIncrement()(); IntColumn g

我需要画一个火花线,数据的输入来自sqlite数据库,我不知道为什么它会给我这个错误,请有人帮助我,我正在尝试使用这个请求计算每天的订单:“选择count(id_commande)作为count,date from commands group by date;” 这是我的数据库类:

class Commandes extends Table{
  IntColumn get idCommande => integer().autoIncrement()();

  IntColumn get Clientid => integer().customConstraint('REFERENCES clients(idClient)')();

  TextColumn get date => text().withLength(min: 1, max: 5000000)();
}
为了从数据库中提取数据,我使用了以下代码

Future<List<int>> NombreCommandeParDate() async {
    final dao = Provider.of<CommandeDao>(context);
    var liste2 = <int>[];
    List<NombreCommandeParDateResult> liste =  await dao.NombreCommandeParDate();
    for(int i=0 ; i<liste.length; i++)
      {
        liste2.add(liste[i].count);
      }
    return liste2;
  }
 FutureBuilder<List<int>> (
                        future: NombreCommandeParDate(),
                        builder: (BuildContext context, AsyncSnapshot<List<int>> snapshot){
                          if(snapshot.hasData){
                            commandes = snapshot.data;
                            commandes1 = new List<double>.from(commandes);

                            return Text('success !!' , style: TextStyle(color: Colors.black, fontWeight: FontWeight.w700, fontSize: 20.0));
                          }
                          else
                            return Text("pas de data ");
                        },
                      ),
Sparkline
                        (
                        data: commandes1,
                        lineWidth: 5.0,
                        lineColor: Colors.greenAccent,
                      )