FLUTTER ECOSYSTEM

TNorbury/flutter_expandable_sliver_list

사용자가 확장 가능한 슬리버 목록을 만들 수 있는 플러터 위젯입니다. 사용자 정의 스크롤 뷰 내에서 항목 목록을 전개하고 접을 수 있습니다!

flutter_expandable_sliver_list 프로젝트 이미지
Stars
7
Forks
6
최근 푸시(UTC)
2024. 4. 6.
프로젝트 상태
활성
Tyler Norbury GitHub avatar
GITHUB User

Tyler Norbury ↗

Head of Mobile Development at @vakaros

@vakarosUK
언어Dart

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • flutter{"sdk":"flutter"}
  • flutter_lints개발 의존성^2.0.1
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

expandable_sliver_list

pub package flutter_tests codecov style: flutter lints License: MIT

A Flutter widget which creates a Sliver List that you can then either expand or collapse, in order to show or hide the contents of the list.

https://raw.githubusercontent.com/TNorbury/flutter_expandable_sliver_list/master/readme_assets/example.gif

Getting Started

Installing

In your Flutter project, add the package to your dependencies

flutter pub add expandable_sliver_list

or

dependencies:
  ...
  expandable_sliver_list: ^4.1.0
  ...
Usage Example

A complete example on how to use this widget can be found in the example directory. But the basics are:

Import the package

import 'package:expandable_sliver_list/expandable_sliver_list.dart';

Create a controller and a list of items to display

ExpandableSliverListController controller = ExpandableSliverListController();

List<int> items = [1, 2, 3, 4, 5];

Create the widget

ExpandableSliverList<int>(
  initialItems: items,
  controller: controller,
  builder: (context, item, index) {
    return ListTile(
      title: Text(item.toString()),
    );
  },
)

Now you can use the controller to expand or collapse the list

controller.collapse();
controller.expand();

Or to add items to the list

controller.insertItem(54, 2);
controller.removeItem(4);