Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadingMoreCustomScrollView add center attribute #50

Closed
mdddj opened this issue Nov 2, 2022 · 0 comments
Closed

LoadingMoreCustomScrollView add center attribute #50

mdddj opened this issue Nov 2, 2022 · 0 comments

Comments

@mdddj
Copy link

mdddj commented Nov 2, 2022

CustomScrollView has Key? center attribute, please add this, tkx

use center eg.

///聊天内容展示
  Widget get chatsListWidget {
    return LoadingMoreCustomScrollView(
      reverse: true,
      controller: scroller,
      center: // <<< - todo add a center key
      slivers: [
        LoadingMoreSliverList(SliverListConfig<ChatItemData>(
          itemBuilder:renderChatLayoutItem,
          sourceList: repository,
          indicatorBuilder: (s, c) => kBuildIndicator(s, c, isSliver: true),
          extendedListDelegate: const ExtendedListDelegate(closeToTrailing: true),
          showNoMore: false
        )),
        SliverPadding(
          padding: EdgeInsets.zero,
          key: centerKey,
        ),
        LoadingMoreSliverList(SliverListConfig<ChatItemData>(
          itemBuilder: renderChatLayoutItem,
          sourceList: repositoryNew,
          showNoMore: false,
        ))
      ],
    );
  }

  ///旧版本
  Widget get oldVersion {
    return CustomScrollView(
      controller: scroller,
      center: centerKey,
      slivers: [
        // ChatUserDetailCard(model.txModel!.conversationID).toSliverWidget,
        //旧的聊天记录
        SliverPadding(
          padding: EdgeInsets.zero,
          key: centerKey,
        ),
        //新的聊天记录
        const Chats(),
      ],
    );
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants