Giter Site home page Giter Site logo

flutterchina / azlistview Goto Github PK

View Code? Open in Web Editor NEW
1.1K 19.0 277.0 1.29 MB

A Flutter sticky headers & index ListView. Flutter 城市列表、联系人列表,索引&悬停。

License: BSD 3-Clause "New" or "Revised" License

Java 0.21% Ruby 4.44% Objective-C 0.05% Dart 94.75% Swift 0.55%
sticky-headers indexbar suspension citylist contacts wechat contactslist didi

azlistview's People

Contributors

sky24n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azlistview's Issues

关于索引对问题

询问作者 能够在这个属性中添加一个index索引吗,我试过自己修改插件添加一个索引,但是同事请求后还是得自己改

 itemBuilder: (context, model) => _buildListItem(model),  在此处model后面添加一个index索引

indexBarBuilder 高度超限

你好,当我使用本插件时,当我顶部有搜索输入,弹出键盘时indexBarBuilder的高度会超限:
azlistview: ^0.1.2
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤

Issue when Phone rotate

Issue with the Alphabets when phone rotate on the small side...I get A RenderFlex overflowed by 200 pixels on the bottom.

Is there a way to hide alphabets or reduce the number of letters like on android phones?

Is there documentation on this?

与tabbar一起使用的问题

当有多个列表并存时,通过顶部tabbar切换,如果给AzListView传入不同的scrollController或不传入,采用默认生成不同的controller,点击顶部状态栏,没有scrollToTop效果。如果传入同一个scrollController,右侧索引会失效,而且会报错一个scrollController绑定不同的listview

使用indexBarBuilder的offset为null

indexBarBuilder: (BuildContext context, List tags, IndexBarTouchCallback onTouch) => _indexBarBuilder(tags, onTouch),

_indexBarBuilder(List tags, IndexBarTouchCallback onTouch) {
return IndexBar(
data: tags.map((e) => e.toUpperCase()).toList(),
width: 36,
itemHeight: 20,
touchDownColor: Color(0xff111111),
touchDownTextStyle: TextStyle(color: Colors.white),
textStyle: TextStyle(fontSize: 16, color: Colors.grey),
onTouch: onTouch,
);
}
滑动indexBar 列表没有跟随滑动
我在 az_listview.dart 120行 打印结果

image

得到结果如下
image

不设置indexBarBuilder的时候一切正常
可以帮我看一下是什么问题吗?

feature

有什么办法添加这样一个功能:列表滚动到一个字母项时,左边的字母列表下标也跟着变

作者你好,我有个小问题想咨询一下,不知道这个问题算不算bug

首先感谢你提供的组件,我在使用组件时发现了一个小问题,我不知道是不是该定义为bug。 当我把模拟数据加载完 通过右侧的字母列表 滑动选中对应的区域 屏幕中间会显示当前停留的字母区域的 灰色的字母,这个滑动的时候 都是ok的,但是发现如果用手直接点对应的字母后 该字母不会消失,点击屏幕周边 也不会消失,如果重新用手在字母列表上滑动一下 则能消失。 不知是否是bug 还是我缺少了什么设置。希望能得到你的帮助

Overflow for indexBar

I'm getting an overflow error when the keyboard is shown. What's the best way to avoid it?

Screenshot 2020-12-08 at 22 53 00

A RenderFlex overflowed on the bottom.

  List<Widget> pages = [
    Body(),
    GitHubLanguagePage(),
  ];

  int currentIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: pages[currentIndex],
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          print("add press ");
        },
        child: Icon(Icons.add),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      bottomNavigationBar: BottomAppBar(
        shape: CircularNotchedRectangle(),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            IconButton(
              icon: Icon(Icons.view_module),
              onPressed: () {
                setState(() {
                  currentIndex = 0;
                });
                print("全部:$currentIndex");
              },
            ),
            IconButton(
              icon: Icon(Icons.favorite),
              onPressed: () {
                setState(() {
                  currentIndex = 1;
                });
                print("收藏:$currentIndex");
              },
            ),
          ],
        ),
      ),
    );
  }

Body Widget code:

  @override
  Widget build(BuildContext context) {
    _search('');
    print('build ...');

    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: SafeArea(
        child: Column(
          children: [
            Container(
              margin: EdgeInsets.all(12),
              decoration: BoxDecoration(
                  border: Border.all(
                      color: Color.fromARGB(255, 225, 226, 230), width: 0.33),
                  color: Color.fromARGB(255, 239, 240, 244),
                  borderRadius: BorderRadius.circular(12)),
              child: TextField(
                autofocus: false,
                onChanged: (value) {
                  _search(value);
                },
                controller: textEditingController,
                decoration: InputDecoration(
                    prefixIcon: Icon(
                      Icons.search,
                      color: Colors.grey,
                    ),
                    suffixIcon: Offstage(
                      offstage: textEditingController.text.isEmpty,
                      child: InkWell(
                        onTap: () {
                          textEditingController.clear();
                          _search('');
                        },
                        child: Icon(
                          Icons.cancel,
                          color: Colors.grey,
                        ),
                      ),
                    ),
                    border: InputBorder.none,
                    hintText: 'Search',
                    hintStyle: TextStyle(color: Colors.grey)),
              ),
            ),
            Expanded(
              child: AzListView(
                data: controller.dataList(),
                physics: AlwaysScrollableScrollPhysics(),
                itemCount: controller.dataList().length,
                itemBuilder: (BuildContext context, int index) {
                  PinYin model = controller.dataList()[index];
                  return getListItem(context, model);
                },
                itemScrollController: itemScrollController,
                susItemBuilder: (BuildContext context, int index) {
                  PinYin model = controller.dataList()[index];
                  return getSusItem(context, model.getSuspensionTag());
                },
                indexBarOptions: IndexBarOptions(
                  needRebuild: true,
                  selectTextStyle: TextStyle(
                      fontSize: 12,
                      color: Colors.white,
                      fontWeight: FontWeight.w500),
                  selectItemDecoration: BoxDecoration(
                      shape: BoxShape.circle, color: Color(0xFF333333)),
                  indexHintWidth: 96,
                  indexHintHeight: 97,
                  // indexHintDecoration: BoxDecoration(
                  //   image: DecorationImage(
                  //     image: AssetImage(
                  //         Utils.getImgPath('ic_index_bar_bubble_white')),
                  //     fit: BoxFit.contain,
                  //   ),
                  // ),
                  indexHintAlignment: Alignment.centerRight,
                  indexHintTextStyle:
                      TextStyle(fontSize: 24.0, color: Colors.black87),
                  indexHintOffset: Offset(-30, 0),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }

设置了 resizeToAvoidBottomInset: false

当点击搜索的时候键盘弹出就报底部溢出

IndexBar在Andrid横屏时越界

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 25 pixels on the bottom.

The relevant error-causing widget was:
Column file:///Users/zhaoxm/workspace/flutter/azlistview/lib/src/index_bar.dart:244:18
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#4ae29 relayoutBoundary=up9 OVERFLOWING
... parentData: (can use size)
... constraints: BoxConstraints(0.0<=w<=36.0, 0.0<=h<=342.7)
... size: Size(36.0, 342.7)
... direction: vertical
... mainAxisAlignment: start
... mainAxisSize: min
... crossAxisAlignment: center
... verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
════════════════════════════════════════════════════════════════════════════════════════════════════

height类型为Int

您好,我在使用azlisview的时候使用了屏幕适配的方案来设定各种尺寸,在给itemHeight等height赋值时发现需传入Int类型,我之前是把我要的参数toInt(),后来发现数据量多了后,indexbar就不能正确的跳转到对应的地方了,应该是精度缺失的问题。请问有没有可能把这些设置尺寸的参数的类型换成double呢,还是有其他的考量?

Scrolling using Shortcuts

Hello, I have attempted to create a version of the listview that is similar to the Github Languages example. I have successfully implemented all needed features except 1. Scrolling to a specific position based on clicking on the shortcut list does not work. It doesn't attempt to scroll. What functions control the scroll? What are the necessary dependencies? (There is no error message when I click) ((The Letter Preview shows up when I click, but the specific letter also does not remain highlighted))

Index bar 重叠

image

  1. 如图
  2. 开放设置index bar 样式的属性 我看到现在有个indexbar builder的东西 ,但是我不知道如何用。。
    有木有例子

Load image

I was unable to load an image on the list, I use both assets and network image still the same thing, is there I have to do this

发现有个bug

Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
centerTitle: true,
),
body: new Column(
children: [
Container(
alignment: Alignment.centerLeft,
padding: const EdgeInsets.only(left: 15.0),
height: 50.0,
child: Text("当前城市: 成都市"),
),
Expanded(
flex: 1,
child: new AzListView(
data: _cityList,
topData: _hotCityList,
itemBuilder: (context, model) => _buildListItem(model),
suspensionWidget: _buildSusWidget(_suspensionTag),
isUseRealIndex: true,
itemHeight: _itemHeight,
suspensionHeight: _suspensionHeight,
onSusTagChanged: _onSusTagChanged,
))
],
));我发现这个必须要放在Scaffold里面并且要有appbar,不然点击侧边索引后对应的索引标题会有部分重复啊,不知道是我写错了还是有问题,麻烦作者确认一下

怎么让箭头显示

在 header 添加了布局,isUseRealIndex: = false 因为需要索引一直显示。

但是怎么在最上方加个箭头,好回到最上方呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.