Comments (16)
没太看明白,描述一下关键操作和关键代码
from keframe.
我把ComplexListOptExample1的ListView部分做了以下改动
child: FutureBuilder<int>(
future: Future.delayed(Duration(seconds: 1), () => 100), // 模拟加载数据耗时1秒
initialData: 0,
builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
return ListView.builder(
cacheExtent: 500,
controller: scrollController,
itemCount: snapshot.data,
itemBuilder: (c, i) => FrameSeparateWidget(
index: i,
placeHolder: Container(
color: i % 2 == 0 ? Colors.yellow : Colors.green, // 修改占位的背景色
height: 60,
),
child: CellWidget(
color: i % 2 == 0 ? Colors.red : Colors.blue,
index: i,
),
),
);
},
),
就遇到了占位widget没有消失的问题
https://user-images.githubusercontent.com/12608693/124060334-6a979780-da5f-11eb-969e-b6ae6fb6abb7.mp4
from keframe.
给 FrameSeparateWidget 嵌套透明度/位移等动画就正常了
child: FutureBuilder<int>(
future: Future.delayed(Duration(seconds: 1), () => 100), // 模拟加载数据耗时1秒
initialData: 0,
builder: (BuildContext context, AsyncSnapshot<int> snapshot) {
return ListView.builder(
cacheExtent: 500,
controller: scrollController,
itemCount: snapshot.data,
itemBuilder: (c, i) => OpacityTansWidget( // 嵌套透明度动画
child: FrameSeparateWidget(
index: i,
placeHolder: Container(
color: i % 2 == 0 ? Colors.yellow : Colors.green, // 修改占位的背景色
height: 60,
),
child: CellWidget(
color: i % 2 == 0 ? Colors.red : Colors.blue,
index: i,
),
),
),
);
},
),
from keframe.
嗯嗯 感谢反馈,这个问题能复现,我在晚上调试一下
from keframe.
itemBuilder: (c, i) => FrameSeparateWidget(
index: i,
placeHolder: Container(
color: Colors.white,
height: 60,
),
child: OpacityTansWidget(
child: CellWidget(
color: i % 2 == 0 ? Colors.red : Colors.blue,
index: i,
),
),
),
动画按照那种加法有效果么,应该是要包裹实际的 item
from keframe.
itemBuilder: (c, i) => FrameSeparateWidget( index: i, placeHolder: Container( color: Colors.white, height: 60, ), child: OpacityTansWidget( child: CellWidget( color: i % 2 == 0 ? Colors.red : Colors.blue, index: i, ), ), ),动画按照那种加法有效果么,应该是要包裹实际的 item
如果包裹实际的 item,那就还是一样的占位 widget 没有消失。另外,修改某个item后,界面没有变化,必须滑动一下才会刷新,应该都是同一个原因。
from keframe.
恩 我打断点调试之后,发现任务队列的调度失败了。看起来这个 future 会影响到系统 endOfFrame 的回调,导致这个 Future 没法返回,所以没有正确的替换。
from keframe.
使 1.0.2 或者 2.0.2 版本试试
from keframe.
方便发一个使用后的录屏么
from keframe.
使 1.0.2 或者 2.0.2 版本试试
好的,待会我试试。
from keframe.
换成 2.0.2 版本就正常了,o( ̄▽ ̄)d赞!
from keframe.
方便搞个录屏,搞个录屏么,兄die,直接传到这或者发我邮箱也成。我在做个合集,可以留一些你的推荐信息。
from keframe.
方便搞个录屏,搞个录屏么,兄die,直接传到这或者发我邮箱也成。我在做个合集,可以留一些你的推荐信息。
from keframe.
哇 多谢!有 QQ 咩,咱们细聊
from keframe.
我的是 762579473
from keframe.
使用fish_redux框架
使用版本
keframe: 1.0.2
实现代码
GridView.builder( cacheExtent: 500, itemBuilder: (ctx, index) { return FrameSeparateWidget( index: index, placeHolder: Container( padding: EdgeInsets.all(6), decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), color: YZColors.w, ), height: 86, ), child: OpacityTansWidget( child: adapter.itemBuilder(ctx, index), ), ); }, itemCount: adapter.itemCount, gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, mainAxisSpacing: 4, crossAxisSpacing: 4, childAspectRatio: aspectRatio(), ), );
操作视频:
QtScrcpy_20210904_161800_478.mp4
日志:
因为是没有看到后台有日志输出
void transformWidget() { SchedulerBinding.instance.addPostFrameCallback((t) { FrameSeparateTaskQueue.instance.scheduleTask(() { if (mounted) setState(() { result = widget.child; }); }, Priority.animation, id: widget.index); }); }
调试的时候,看到调用到了SchedulerBinding.instance.addPostFrameCallback,但是没有没有调用FrameSeparateTaskQueue.instance.scheduleTask,说明出现了没有回调addPostFrameCallback,但是不知道为什么没有回调。在界面上随便操作一下就会显示出来。
from keframe.
Related Issues (20)
- sliver组件可以用吗 HOT 1
- [Request For Comment] The boost optimize for Key frame is amazing, but can be push to upstream? HOT 2
- optimize the separated frame mechanisms HOT 6
- [IMPORTANT] keframe needs fix to work on Flutter 3.0.0 HOT 2
- 在长列表场景中,当组件被移动到视口外,是不是不会被清除内存 HOT 11
- Nested `FrameSeparateWidget`s causes widget to be stuck in placeholder state HOT 9
- Determine how many subitems to render within a frame based on the time remaining, rather than one per frame
- Enhance proposal: Seems that we can build/layout as many items as possible until time is up, using this approach HOT 5
- 0
- hi,能否增加一个函数第n帧后build?
- 当一个tabview 嵌套多个CustomScrollView,使用keframe时,发现
- demo运行就直接崩溃 HOT 1
- EasyRefresh 里不能使用 SizeCacheWidget
- After using SizeCacheWidget, UI-related instances are not released. HOT 1
- 如果有单个ListTile高度大于一个屏幕高度的时候,无法向上滑动加载 HOT 4
- issue 提交请准备四个东西,否则不做处理,尊重你我的时间
- CustomScrollView 怎么使用分帧呢? HOT 1
- 使用shrinkWrap或者SingleChildScrollView+Column列表会从中间展开 HOT 2
- 对于被嵌套的widge中含有image时效果不明显 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keframe.