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
Flutter 颤振可重定值清单0.1.5包。项目不';t离开占位符状态,重新排序行为异常 类主页扩展StatefulWidget{ 康斯特网页({ 关键点, }):super(key:key); @凌驾 _HomePageState createState()=>\u HomePageState(); } 类_HomePageState扩展状态{ 列出项目; _主页状态(){ _项目=[ “A”, “B”, “C”, “D”, “E”, ]; } 小部件构建项(int索引){ 控件内容=容器( 边距:常量边集。对称(垂直:5), 填充:常数边集。全部(20), 对齐:alignment.centerLeft, 颜色:颜色,蓝色, 子:文本( “${u项[索引]}”, ), ); 返回可重减额项目( 键:ValueKey(索引), childBuilder:(上下文,状态){ 内容=不透明度( 不透明度:状态==ReorderableItemState.placeholder?0.1:1.0, 子项:DelayedReorderableListener( 延迟:持续时间(毫秒:500), 孩子:内容, ), ); 返回内容; }, ); } @凌驾 小部件构建(构建上下文){ 返回可重排序列表( onReorder:(draggedItem,newPosition){ var oldIndex=(draggedItem作为ValueKey).value; var newIndex=(newpositionas ValueKey).value; 最终项目=_项目[旧索引]; 设置状态(){ _项目移除(旧索引); _项目。插入(新索引,项目); 打印(“重新排序[$oldIndex]->[$newIndex]”; }); 返回true; }, 子项:ListView.builder( itemBuilder:(上下文,索引)=>\u buildItem(索引), itemCount:_items.length, ), ); } } 链接到程序包:_Flutter_Reorderable List - Fatal编程技术网

Flutter 颤振可重定值清单0.1.5包。项目不';t离开占位符状态,重新排序行为异常 类主页扩展StatefulWidget{ 康斯特网页({ 关键点, }):super(key:key); @凌驾 _HomePageState createState()=>\u HomePageState(); } 类_HomePageState扩展状态{ 列出项目; _主页状态(){ _项目=[ “A”, “B”, “C”, “D”, “E”, ]; } 小部件构建项(int索引){ 控件内容=容器( 边距:常量边集。对称(垂直:5), 填充:常数边集。全部(20), 对齐:alignment.centerLeft, 颜色:颜色,蓝色, 子:文本( “${u项[索引]}”, ), ); 返回可重减额项目( 键:ValueKey(索引), childBuilder:(上下文,状态){ 内容=不透明度( 不透明度:状态==ReorderableItemState.placeholder?0.1:1.0, 子项:DelayedReorderableListener( 延迟:持续时间(毫秒:500), 孩子:内容, ), ); 返回内容; }, ); } @凌驾 小部件构建(构建上下文){ 返回可重排序列表( onReorder:(draggedItem,newPosition){ var oldIndex=(draggedItem作为ValueKey).value; var newIndex=(newpositionas ValueKey).value; 最终项目=_项目[旧索引]; 设置状态(){ _项目移除(旧索引); _项目。插入(新索引,项目); 打印(“重新排序[$oldIndex]->[$newIndex]”; }); 返回true; }, 子项:ListView.builder( itemBuilder:(上下文,索引)=>\u buildItem(索引), itemCount:_items.length, ), ); } } 链接到程序包:

Flutter 颤振可重定值清单0.1.5包。项目不';t离开占位符状态,重新排序行为异常 类主页扩展StatefulWidget{ 康斯特网页({ 关键点, }):super(key:key); @凌驾 _HomePageState createState()=>\u HomePageState(); } 类_HomePageState扩展状态{ 列出项目; _主页状态(){ _项目=[ “A”, “B”, “C”, “D”, “E”, ]; } 小部件构建项(int索引){ 控件内容=容器( 边距:常量边集。对称(垂直:5), 填充:常数边集。全部(20), 对齐:alignment.centerLeft, 颜色:颜色,蓝色, 子:文本( “${u项[索引]}”, ), ); 返回可重减额项目( 键:ValueKey(索引), childBuilder:(上下文,状态){ 内容=不透明度( 不透明度:状态==ReorderableItemState.placeholder?0.1:1.0, 子项:DelayedReorderableListener( 延迟:持续时间(毫秒:500), 孩子:内容, ), ); 返回内容; }, ); } @凌驾 小部件构建(构建上下文){ 返回可重排序列表( onReorder:(draggedItem,newPosition){ var oldIndex=(draggedItem作为ValueKey).value; var newIndex=(newpositionas ValueKey).value; 最终项目=_项目[旧索引]; 设置状态(){ _项目移除(旧索引); _项目。插入(新索引,项目); 打印(“重新排序[$oldIndex]->[$newIndex]”; }); 返回true; }, 子项:ListView.builder( itemBuilder:(上下文,索引)=>\u buildItem(索引), itemCount:_items.length, ), ); } } 链接到程序包:,flutter,reorderable-list,Flutter,Reorderable List,我试着从它的网站上学习这个软件包。我期望正常的可重排序列表行为,但结果是错误的。 上面的代码只是说明相同问题的简化版本。是的,在提出这个问题之前,我试着解决了几个小时 结果(不要介意下面的按钮,它们不是来自此代码):

我试着从它的网站上学习这个软件包。我期望正常的可重排序列表行为,但结果是错误的。 上面的代码只是说明相同问题的简化版本。是的,在提出这个问题之前,我试着解决了几个小时

  • 结果(不要介意下面的按钮,它们不是来自此代码):