ParentDataWidget 的错误使用颤振应用程序

问题描述

我被这个问题困扰了很长时间

in debug console

我不知道怎么解决,请帮忙 它说灵活,而我没有使用灵活的小部件。 我只使用了扩展,即使我删除了扩展的小部件仍然有同样的错误 我还尝试删除除列表视图构建器小部件之外的所有内容,但我仍会收到相同的错误

这是代码

import 'package:Flutter/material.dart';
import 'package:todoy/Colors.dart';
import 'Taskslistview.dart';
import 'TasksListTile.dart';
import 'package:provider/provider.dart';
import 'Helper.dart';

    bool isChekec = false;
    
        class TasksScreen extends StatelessWidget {
          Widget buildsheet(BuildContext context) {
            return SingleChildScrollView(
              child: Column(
                children: [
                  Container(
                    decoration: Boxdecoration(
                      color: Colors.white,),height: 400,child: Padding(
                      padding: EdgeInsets.only(left: 50.0,right: 50),child: Column(
                        crossAxisAlignment: CrossAxisAlignment.stretch,children: [
                          SizedBox(
                            height: 10,Center(
                              child: Text(
                            'Add Task',style: TextStyle(
                                fontSize: 30,color: Provider.of<Helper>(context).choosedcolor),)),TextField(
                            decoration: Inputdecoration(
                                helperStyle: TextStyle(color: Colors.red),helperText: Provider.of<Helper>(context).alreadyexist
                                    ? "this task already exist"
                                    : " "),textAlign: TextAlign.center,onChanged: (value) {
                              if (Provider.of<Helper>(context,listen: false)
                                  .tasknames
                                  .contains(value)) {
                                Provider.of<Helper>(context,listen: false)
                                    .alreadyture();
                              } else {
                                Provider.of<Helper>(context,listen: false)
                                    .alreadyfalse();
                              }
                              Provider.of<Helper>(context,listen: false)
                                  .addtaskname(value);
        
                              Provider.of<Helper>(context,listen: false)
                                  .addtaskname(value);
        
                              print(Provider.of<Helper>(context,listen: false)
                                  .addedtask);
                            },SizedBox(
                            height: 10,Container(
                            height: 50,// ignore: deprecated_member_use
                            child: FlatButton(
                                color: Provider.of<Helper>(context).choosedcolor,onpressed: () {
                                  if (Provider.of<Helper>(context,listen: false)
                                      .alreadyexist) {
                                    print("you cant");
                                  } else if (Provider.of<Helper>(context,listen: false)
                                          .addedtask ==
                                      "") {
                                    print("ffgg");
                                  } else {
                                    Provider.of<Helper>(context,listen: false).addname(
                                        Provider.of<Helper>(context,listen: false)
                                            .addedtask);
                                    Provider.of<Helper>(context,listen: false)
                                        .add(TasksListTile(
                                      isChcked: isChekec,nameofthetask:
                                          Provider.of<Helper>(context,listen: false)
                                              .addedtask,));
                                    Provider.of<Helper>(context,listen: false)
                                        .addedtask = "";
                                    Navigator.pop(context);
                                  }
                                },child: Text(
                                  "ADD",style: TextStyle(color: Colors.white,fontSize: 20),)
                        ],],);
          }
        
          @override
          Widget build(BuildContext context) {
            return MaterialApp(
              home: Scaffold(
                backgroundColor: Provider.of<Helper>(context).choosedcolor,body: Column(
                  crossAxisAlignment: CrossAxisAlignment.stretch,children: [
                    Padding(
                      padding: const EdgeInsets.only(left: 300.0,top: 30,right: 15),child: GestureDetector(
                        onTap: () {
                          Navigator.push(context,MaterialPageRoute(builder: (context) => ColoRSScreen()));
                        },child: CircleAvatar(
                            radius: 35,backgroundColor: Colors.white,child: Icon(
                              Icons.invert_colors,size: 40,color: Provider.of<Helper>(context).choosedcolor,Padding(
                      padding: EdgeInsets.only(left: 40.0,top: 40),child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,children: [
                          Padding(
                            padding: EdgeInsets.only(left: 10.0),child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [
                                CircleAvatar(
                                    radius: 35,child: Icon(
                                      Icons.list,Padding(
                                  padding: const EdgeInsets.only(right: 30.0),child: Container(
                                    height: 67,child: FittedBox(
                                      child: FloatingActionButton(
                                        child: Icon(Icons.delete_forever,color: Provider.of<Helper>(context)
                                                .choosedcolor),onpressed: () {
                                          Provider.of<Helper>(context,listen: false)
                                              .remove();
                                        },Padding(
                            padding: EdgeInsets.only(top: 8.0,left: 10,bottom: 10),child: Text(
                              "Todoy",fontSize: 40),textAlign: TextAlign.start,Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [
                              Text(
                                ' ${Provider.of<Helper>(context).tasks.length} Tasks',Padding(
                                padding: const EdgeInsets.only(right: 30.0),child: Container(
                                  height: 70,child: FittedBox(
                                    child: FloatingActionButton(
                                      child: Text(
                                        "+",style: TextStyle(
                                            fontSize: 50,onpressed: () {
                                        showModalBottomSheet(
                                            context: context,builder: buildsheet);
                                      },SizedBox(
                      height: 20,Expanded(
                      child: Container(
                        padding: EdgeInsets.only(left: 20),decoration: Boxdecoration(
                            color: Colors.white,borderRadius: BorderRadius.only(
                                topLeft: Radius.circular(40),topRight: Radius.circular(40))),child: Taskslistview(),);
          }
        }

在任务列表视图中:

class Taskslistview extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    bool isChecked = false;
    return ListView.builder(
      itemCount: Provider.of<Helper>(context).tasks.length,itemBuilder: (context,index) {
        return TasksListTile(
          isChcked: isChecked,nameofthetask:
              Provider.of<Helper>(context,listen: false).tasknames[index],);
      },);
  }
}

请帮助我尝试了一切修复它没有任何效果

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...