패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.2.0

flex_list

유연한 목록을 위한 Flutter 레이아웃 위젯입니다. wrap 내에서 Expand 위젯이 어떻게 동작할 것인지와 같이 작동합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.8천
좋아요
30
Pub 점수
150

패키지 설치

flutter pub add flex_list

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

FlexList는 레이아웃 제약 조건 내에서 동적으로 적응하는 유연하고 반응형 리스트를 만들기 위해 설계된 Flutter 위젯입니다. Wrap 내부의 Expand 위젯과 유사하게 작동하여 사용 가능한 공간에 따라 항목이 늘어나고 줄어들 수 있습니다. 다양한 화면 크기와 방향에서 유연하고 확장 가능한 리스트 레이아웃을 만들기에 이상적이며, 복잡한 커스텀 코드 없이도 UI의 유연성을 향상시킵니다. 이 패키지는 모든 주요 플랫폼을 지원하므로, 적응형 리스트 동작이 필요한 크로스플랫폼 애플리케이션에 적합합니다.

사용 사례

  • 반응형 목록 레이아웃
  • 동적 항목 크기
  • 크로스 플랫폼 UI 디자인
  • 적응형 콘텐츠 컨테이너
  • 유연한 그리드 형식의 목록
  • 중첩 레이아웃 통합

주요 기능

  • 자동 크기 조절 목록 항목
  • 모든 플러터 플랫폼을 지원합니다
  • 직관적인 래핑과 유사한 동작
  • 필수 최소 구성
  • 기존 레이아웃과의 원활한 통합
  • 장치 간 일관된 동작

적합한 대상

  • 반응형 UI를 구축하는 개발자
  • 적응형 목록 디자인을 필요로 하는 앱
  • 크로스 플랫폼 프로젝트
  • 레이아웃 중심 애플리케이션
  • 동적 간격이 필요한 UI 컴포넌트

고려 사항

  • 복잡한 중첩 구조에서는 신중한 정렬이 필요할 수 있습니다
  • 매우 큰 데이터 세트와의 성능 영향
  • 기본적인 플렉스 동작 외의 사용자 정의가 제한적
  • 고정 크기 또는 강성 레이아웃에 적합하지 않음
  • 중간 크기의 목록에 적합
  • 부모 컨테이너의 제약 조건에 의존

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flex List

Pub Points Pub Points Pub Points

Provides a flexible list layout that behaves as you would expect from Expand widgets within a Wrap.

Features

FlexList puts as many provided elements as possible in one row (like Wrap), but also extends the width of the elements by the remaining space per row. This means that each row is filled to the maximum width.

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flex_list: <latest_version>

In your library add the following import:

import 'package:flex_list/flex_list.dart';

Usage

The following example shows how to use FlexList. Beside the children property, you can set horizontalSpacing and verticalSpacing to define the spacing between the elements.

Note: Both spacing values are 10 by default.

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'FlexList Demo',
        theme: ThemeData(),
        home: Scaffold(
          body: Center(
            child: SizedBox(
                width: 300,
                child: FlexList(
                  horizontalSpacing: 5,
                  verticalSpacing: 10,
                  children: [
                    for (var i = 0; i < 10; i++)
                      Container(
                        color: Theme
                            .of(context)
                            .colorScheme.surfaceContainer,
                        padding: EdgeInsets.symmetric(
                            horizontal: 20 + 20 * (i % 4), vertical: 10),
                        child: Text("Item $i"),
                      )
                  ],
                )),
          ),
        ));
  }
}
Rendering of above Example
Example Rendering

Additional information

This package was written because of the lack of such layout function. The package repository is maintained on Github and published on pub.dev

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트