sider_bar 0.1.0 copy "sider_bar: ^0.1.0" to clipboard
sider_bar: ^0.1.0 copied to clipboard

outdated

sider bar for listview like ios contact list

sider_bar #

sider bar for listview like ios contact list

Usage #

Import the package #

First, add sider_bar as a dependency in your pubspec.yaml

Then, import it:

import 'package:sider_bar/sider_bar.dart';

wrap ListView in a Stack,and SideBar over ListView with AlignmentDirectional.centerEnd

@override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          // Here we take the value from the MyHomePage object that was created by
          // the App.build method, and use it to set our appbar title.
          title: new Text(widget.title),
        ),
        body: Stack(
          alignment: AlignmentDirectional.centerEnd,
          children: <Widget>[
            ListView.builder(
              controller: _controller,
              itemCount: mDataList.length,
              itemBuilder: buildItem,
            ),
            SideBar(
                list: mDataList,
                textColor: Colors.blue,
                color: Colors.blue.withOpacity(0.2),
                valueChanged: (value) {
                  _controller
                      .jumpTo(mDataList.indexOf(value) * 44.0); //card 差不多44的高度
                })
          ],
        ),
    );
  }

capture #

示例

8
likes
30
pub points
27%
popularity

Publisher

unverified uploader

sider bar for listview like ios contact list

Homepage

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on sider_bar