diff --git a/art/md/en/FAQ.md b/art/md/en/FAQ.md index e69de29b..be3c63cb 100644 --- a/art/md/en/FAQ.md +++ b/art/md/en/FAQ.md @@ -0,0 +1,65 @@ +# FAQ + +## 1.Header and Footer have jump problems after success + +This is because you don't set keys for Headers and Footers, because EasyRefresh updates the status of Headers and Footers. +If the key is not set, the state cannot be recorded and initialized, resulting in a jump. + +Sample code +~~~dart + GlobalKey _headerKey = new GlobalKey(); + GlobalKey _footerKey = new GlobalKey(); + .... + refreshHeader: MaterialHeader( + key: _headerKey, + ), + refreshFooter: MaterialFooter( + key: _footerKey, + ), + .... +~~~ + +## 2.CustomScrollView and the use of folded heads + +If you use CustomScrollView directly, there may always be hints that no more data is available, even if new data is loaded. +This is because CustomScrollView does not automatically maintain semanticChildCount, so we need to maintain it ourselves. +Fold the head in Custom ScrollView using SliverAppBar. + +Sample code, complete example[SliverPage](https://github.com/xuelongqy/flutter_easyrefresh/blob/master/example/lib/page/sliver_page.dart) +~~~dart + CustomScrollView( + // Manual maintenance of semanticChildCount to determine whether there is no more data + semanticChildCount: str.length, + slivers: [ + SliverAppBar( + floating: false, + pinned: true, + expandedHeight: 180.0, + flexibleSpace: FlexibleSpaceBar( + title: Text("CustomScrollView"), + ), + ), + SliverPadding(....) + ] + ) +~~~ + +## 3.Using libraries such as flutter_swiper, sliding conflicts occur + +This is because UI components in these libraries trigger sliding events, leading to sliding conflicts. +Use RefreshSafeArea encapsulation, which will not change your interface. + +Sample code, complete example[SwiperPage](https://github.com/xuelongqy/flutter_easyrefresh/blob/master/example/lib/page/swiper_page.dart) +~~~dart + RefreshSafeArea( + child: Swiper( + itemBuilder: (BuildContext context, int index) { + return _createMarqueeCard(index); + }, + itemCount: 5, + viewportFraction: 0.8, + scale: 0.9, + autoplay: true, + ), + ); +~~~