示例#1
0
 public SmartRefresher(
     ScrollView child,
     float initialOffset            = 0f,
     IndicatorBuilder headerBuilder = null,
     IndicatorBuilder footerBuilder = null,
     Config headerConfig            = null,
     Config footerConfig            = null,
     bool enablePullUp             = DefaultConstants.default_enablePullUp,
     bool enablePullDown           = DefaultConstants.default_enablePullDown,
     bool enableOverScroll         = DefaultConstants.default_enableOverScroll,
     OnRefresh onRefresh           = null,
     OnOffsetChange onOffsetChange = null,
     RefreshController controller  = null,
     NotificationListenerCallback <ScrollNotification> onNotification = null,
     Key key = null
     ) : base(key)
 {
     this.child         = child;
     this.initialOffset = initialOffset;
     this.headerBuilder =
         headerBuilder ?? ((context, mode) => new SmartRefreshHeader(mode, RefreshHeaderType.other));
     this.footerBuilder    = footerBuilder ?? ((context, mode) => new SmartRefreshFooter(mode));
     this.headerConfig     = headerConfig ?? new RefreshConfig();
     this.footerConfig     = footerConfig ?? new LoadConfig(triggerDistance: 0);
     this.enablePullUp     = enablePullUp;
     this.enablePullDown   = enablePullDown;
     this.enableOverScroll = enableOverScroll;
     this.onRefresh        = onRefresh;
     this.onOffsetChange   = onOffsetChange;
     this.controller       = controller ?? new RefreshController();
     this.onNotification   = onNotification;
 }
 public CenteredRefresher(
     List <Widget> children,
     IndicatorBuilder headerBuilder = null,
     IndicatorBuilder footerBuilder = null,
     Config headerConfig            = null,
     Config footerConfig            = null,
     bool enablePullUp             = DefaultConstants.default_enablePullUp,
     bool enablePullDown           = DefaultConstants.default_enablePullDown,
     bool enableOverScroll         = DefaultConstants.default_enableOverScroll,
     OnRefresh onRefresh           = null,
     OnOffsetChange onOffsetChange = null,
     RefreshController controller  = null,
     NotificationListenerCallback <ScrollNotification> onNotification = null,
     Key key         = null,
     int centerIndex = 0
     ) : base(key)
 {
     this.children      = children;
     this.headerBuilder =
         headerBuilder ?? ((context, mode) => new SmartRefreshHeader(mode, RefreshHeaderType.other));
     this.footerBuilder    = footerBuilder ?? ((context, mode) => new SmartRefreshFooter(mode));
     this.headerConfig     = headerConfig ?? new RefreshConfig();
     this.footerConfig     = footerConfig ?? new LoadConfig(triggerDistance: 0);
     this.enablePullUp     = enablePullUp;
     this.enablePullDown   = enablePullDown;
     this.enableOverScroll = enableOverScroll;
     this.onRefresh        = onRefresh;
     this.onOffsetChange   = onOffsetChange;
     this.controller       = controller ?? new RefreshController();
     this.onNotification   = onNotification;
     this.centerIndex      = centerIndex;
 }
示例#3
0
 public NotificationListener(
     Key key      = null,
     Widget child = null,
     NotificationListenerCallback <T> onNotification = null) : base(key)
 {
     this.child          = child;
     this.onNotification = onNotification;
 }
示例#4
0
 public CustomMarkdown(
     Key key         = null,
     string data     = null,
     bool selectable = false,
     MarkdownStyleSheet markdownStyleSheet = null,
     SyntaxHighlighter syntaxHighlighter   = null,
     MarkdownTapLinkCallback onTapLink     = null,
     string imageDirectory                   = null,
     ExtensionSet extensionSet               = null,
     MarkdownImageBuilder imageBuilder       = null,
     MarkdownCheckboxBuilder checkboxBuilder = null,
     ScrollPhysics physics                   = null,
     bool shrinkWrap                     = false,
     Widget contentHead                  = null,
     Widget relatedArticles              = null,
     List <Widget> commentList           = null,
     RefreshController refreshController = null,
     bool enablePullDown                 = false,
     bool enablePullUp                   = false,
     OnRefresh onRefresh                 = null,
     NotificationListenerCallback <ScrollNotification> onNotification = null,
     float initialOffset = 0f,
     bool needRebuildWithCachedCommentPosition = false,
     bool isArticleJumpToCommentStateActive    = false
     ) : base(key, data, markdownStyleSheet, syntaxHighlighter,
              onTapLink, imageDirectory, extensionSet, imageBuilder, checkboxBuilder, selectable)
 {
     this.padding           = EdgeInsets.all(16);
     this.physics           = physics;
     this.shrinkWrap        = shrinkWrap;
     this.contentHead       = contentHead;
     this.relatedArticles   = relatedArticles;
     this.commentList       = commentList;
     this.refreshController = refreshController;
     this.enablePullDown    = enablePullDown;
     this.enablePullUp      = enablePullUp;
     this.onRefresh         = onRefresh;
     this.onNotification    = onNotification;
     this.initialOffset     = initialOffset;
     this.needRebuildWithCachedCommentPosition = needRebuildWithCachedCommentPosition;
     this.isArticleJumpToCommentStateActive    = isArticleJumpToCommentStateActive;
 }
示例#5
0
 public SmartRefresher(
     ScrollView child,
     float initialOffset            = 0f,
     IndicatorBuilder headerBuilder = null,
     IndicatorBuilder footerBuilder = null,
     Config headerConfig            = null,
     Config footerConfig            = null,
     bool enablePullUp             = DefaultConstants.default_enablePullUp,
     bool enablePullDown           = DefaultConstants.default_enablePullDown,
     bool enableOverScroll         = DefaultConstants.default_enableOverScroll,
     bool reverse                  = false,
     OnRefresh onRefresh           = null,
     OnOffsetChange onOffsetChange = null,
     RefreshController controller  = null,
     NotificationListenerCallback <ScrollNotification> onNotification = null,
     bool hasBottomMargin = false,
     Key key = null
     ) : base(key)
 {
     this.child         = child;
     this.initialOffset = initialOffset;
     this.headerBuilder =
         headerBuilder ?? ((context, mode) => new SmartRefreshHeader(mode, RefreshHeaderType.other));
     this.footerBuilder = footerBuilder ?? ((context, mode) => new SmartRefreshFooter(
                                                mode: mode,
                                                hasBottomMargin
                                  ? EdgeInsets.only(0, 16, 0,
                                                    16 + CConstant.TabBarHeight +
                                                    MediaQuery.of(context: context).padding.bottom)
                                  : null
                                                ));
     this.headerConfig     = headerConfig ?? new RefreshConfig();
     this.footerConfig     = footerConfig ?? new LoadConfig(triggerDistance: 0);
     this.enablePullUp     = enablePullUp;
     this.enablePullDown   = enablePullDown;
     this.enableOverScroll = enableOverScroll;
     this.onRefresh        = onRefresh;
     this.onOffsetChange   = onOffsetChange;
     this.controller       = controller ?? new RefreshController();
     this.onNotification   = onNotification;
     this.reverse          = reverse;
 }