flutterchina / flukit Goto Github PK
View Code? Open in Web Editor NEWA Flutter UI Kit(一个 Flutter UI组件库),包含 ScaleView, Swiper, PullRefresh, WaterMark, GradientCircularProgressIndicator...
A Flutter UI Kit(一个 Flutter UI组件库),包含 ScaleView, Swiper, PullRefresh, WaterMark, GradientCircularProgressIndicator...
没有找到这个效果的示例呢,如何实现呢
如题:请问作者如何灵活按需临时阻止上下滑动呢,比如:没有更多数据时阻止next而去重新拉取数据,回到顶部时阻止back而去刷新数据
RT
妹子好看,star了
希望尽快适配nullsafety
在6s上面跑demo,感觉太卡了,和原生相差很远呀
只支持安卓吗?
ios上同样适用吗
1、PullRefreshBox 的构造函数可以这样写:
PullRefreshBox({Key key, this.child, @required this.onRefresh, PullRefreshIndicator indicator, this.overScrollEffect})
: this.indicator = indicator ?? DefaultPullRefreshIndicator(),
super(key: key);
final PullRefreshCallback onRefresh;
final Widget child;
final TargetPlatform overScrollEffect;
final PullRefreshIndicator indicator;
2、PullRefreshBoxState 和 _AnimatedRotationBoxState 的initState
没有 调用 super.initState()
,这是不合适的。
3、PullRefreshBoxState
中的方法返回Future,但是没有return。
--lib
--package_src
--lib
--src
package_src 这个目录下的文件是做什么的呀
InfiniteListView 如何用代码触发下拉刷新
var hasMore = await widget.onRetrieveData(1, _items, pullDown);
if (_items.isEmpty ||
_items.length % widget.pageSize != 0 && hasMore != true) {
state.noMore = true;
}
state.items = _items;
when the _widget.pageSize == items.length, hasMore = false:
the state.noMore = true does not work
移除了 InfiniteListView 吗?
替代控件有吗?
当背景色有透明度时,前景色会加上透明,新建一个画笔工具就可以解决这个问题
Error: Method not found: 'PinyinHelper.convertToPinyinStringWithoutException'.
String pinyin = PinyinHelper.convertToPinyinStringWithoutException(list[i].name);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
E/flutter (24234): #0 ScrollPosition.viewportDimension (package:flutter/src/widgets/scroll_position.dart:175:53)
E/flutter (24234): #1 _PagePosition.getPixelsFromPage (package:flutter/src/widgets/page_view.dart:382:19)
E/flutter (24234): #2 PageController.animateToPage (package:flutter/src/widgets/page_view.dart:197:16)
E/flutter (24234): #3 _SwiperState.animateToPage (package:flukit/src/swiper.dart:447:11)
E/flutter (24234): #4 _SwiperState._start. (package:flukit/src/swiper.dart:408:7)
E/flutter (24234): #5 _rootRunUnary (dart:async/zone.dart:1436:47)
E/flutter (24234): #6 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (24234): #7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
E/flutter (24234): #8 _CustomZone.bindUnaryCallbackGuarded. (dart:async/zone.dart:1281:26)
E/flutter (24234): #9 _rootRunUnary (dart:async/zone.dart:1444:13)
E/flutter (24234): #10 _CustomZone.runUnary (dart:async/zone.dart:1335:19)
E/flutter (24234): #11 _CustomZone.bindUnaryCallback. (dart:async/zone.dart:1265:26)
E/flutter (24234): #12 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
E/flutter (24234): #13 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
E/flutter (24234): #14 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
update new version to Dart Packages
E/flutter ( 7676): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a
null value
E/flutter ( 7676): #0 ScrollPosition.viewportDimension (package:flutter/src/widgets/scroll_position.dart:177:53)
E/flutter ( 7676): #1 _PagePosition.getPixelsFromPage (package:flutter/src/widgets/page_view.dart:390:19)
E/flutter ( 7676): #2 PageController.animateToPage (package:flutter/src/widgets/page_view.dart:203:16)
E/flutter ( 7676): #3 _SwiperState.animateToPage (package:flukit/src/swiper.dart:447:11)
E/flutter ( 7676): #4 _SwiperState._start. (package:flukit/src/swiper.dart:408:7)
E/flutter ( 7676): #5 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter ( 7676): #6 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter ( 7676): #7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
E/flutter ( 7676):
flukit-3.0.1/lib/src/safe_value_notifier.dart:20:33: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
在iOS系统中,
其他两个下拉刷新的demo都可以在点击status bar的时候,自动回到顶部
但是pull_refresh_with_scrollview这个例子就不行。
自定义了scrollController的都不可以吗
应该转换完index再返回
比如改成
itemBuilder: (context, index) { return widget.itemBuilder(context, _getRealIndex()); }
通常会遇到这样的场景,列表页顶部通常有搜索框,用户输入搜索内容触发整个列表重新获取数据并刷新列表。InfiniteListView并不支持用代码控制刷新。也有朋友给过一些例子 例如在 InfiniteListView 加上 ScrollController,用代码控制ScrollController下拉位置来触发下拉刷新,但是这样做有很多问题,例如当网络延时或其他原因查不到数据时,用这个方法就触发不了第二次刷新。我自己也想了一个解决方案,目前可以正常用代码触发刷新,希望交流一下。
添加一个控制器类
class InfiniteListViewRefreshController {
Future Function(bool) refreshFunc;
void refresh(bool pullDown) {
if(refreshFunc!=null) refreshFunc(pullDown);
}
}
在 InfiniteListView的构造函数中传入此类的实例。
在_InfiniteListViewState 中的initState 方法中将_InfiniteListViewState内置的刷新方法签名赋值给InfiniteListViewRefreshController 实例的refreshFunc字段,代码如下:
@OverRide
void initState() {
super.initState();
state = widget.initState ?? LoadingState<T>();
if (!state.initialized) {
refresh(false);
}
if(widget.refreshController!=null) {
widget.refreshController.refreshFunc = refresh;
}
}
这样可以调用InfiniteListViewRefreshController 的实例方法 refresh 来触发刷新。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.