contact_list_view 1.1.1 copy "contact_list_view: ^1.1.1" to clipboard
contact_list_view: ^1.1.1 copied to clipboard

A Flutter sliver-based contact list with A-Z index navigation, sticky section headers, and extensible builders for index, cursor, and header rendering.

example/lib/main.dart

import 'package:example/app_theme.dart';
import 'package:example/contact_page.dart';
import 'package:example/home_page.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: AppTheme.light,
      darkTheme: AppTheme.dark,
      themeMode: .system,
      home: IndexPage(),
    );
  }
}

class IndexPage extends StatefulWidget {
  const IndexPage({super.key});

  @override
  State<IndexPage> createState() => _IndexPageState();
}

class _IndexPageState extends State<IndexPage> {
  late final PageController pageController;

  late int currentIndex = 0;

  @override
  void initState() {
    super.initState();
    pageController = PageController(initialPage: 0);
  }

  void onTap(int index) {
    setState(() {
      currentIndex = index;
    });
    pageController.animateToPage(
      index,
      duration: Duration(milliseconds: 250),
      curve: Curves.linear,
    );
  }

  void onChanged(int index) {
    setState(() {
      currentIndex = index;
    });
  }

  @override
  void dispose() {
    pageController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PageView(
        controller: pageController,
        onPageChanged: onChanged,
        children: [
          HomePage(),
          ContactPage(),
          Placeholder(child: Text('Mine')),
        ],
      ),
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: currentIndex,
        onTap: onTap,
        items: [
          BottomNavigationBarItem(icon: Icon(Icons.home), label: '首页'),
          BottomNavigationBarItem(icon: Icon(Icons.contacts), label: '联系人'),
          BottomNavigationBarItem(icon: Icon(Icons.person), label: '我的'),
        ],
      ),
    );
  }
}
1
likes
160
points
140
downloads
screenshot

Documentation

API reference

Publisher

verified publisherjsontodart.cn

Weekly Downloads

A Flutter sliver-based contact list with A-Z index navigation, sticky section headers, and extensible builders for index, cursor, and header rendering.

Homepage
Repository (GitHub)
View/report issues

Topics

#widget #azlistview #contact #chat

License

Apache-2.0 (license)

Dependencies

flutter, scrollview_observer, signals, value_layout_builder

More

Packages that depend on contact_list_view