분류, 패키지 및 저장소 검색

패키지 상세v1.1.0

design_grid

디자이너의 의도한 대로 디자인을 구현하세요. 전통적인 반응형 디자인 그리드 접근 방식을 사용하거나, Material Design 레이아웃을 선택하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
71
좋아요
36
Pub 점수
160

패키지 설치

flutter pub add design_grid

패키지 개요

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

Design Grid는 디자이너가 의도한 대로 디자인을 정확히 구현하는 데 도움을 주는 Flutter 패키지입니다. 전통적인 반응형 그리드 레이아웃과 Material Design의 레이아웃 시스템을 모두 지원하며, UI 구성에서 유연성을 제공합니다. 직관적인 API를 통해 플랫폼 간 정렬, 간격 및 반응형 동작을 간단하게 처리할 수 있습니다. 디자인 모크업과 최종 앱 인터페이스 사이에 시각적 일관성을 유지하려는 팀에게 이상적입니다. 이 패키지는 모든 주요 Flutter 플랫폼과 호환되어 크로스플랫폼 신뢰성을 보장합니다.

사용 사례

  • Figma 또는 Sketch에서 픽셀 단위 정확한 디자인 구현
  • 다양한 화면 크기에 대응하는 반응형 레이아웃 구축
  • 사용자 정의 UI에 Material Design 가이드라인 통합
  • 위젯 간에 일관된 간격과 정렬 만들기
  • 다중 플랫폼 앱에서 디자인 정확도 보장

주요 기능

  • 클래식 반응형 그리드를 지원합니다
  • 내장된 Material Design 레이아웃 지원
  • 크로스 플랫폼 호환성
  • 유연한 간격 및 정렬 도구
  • 기존 Flutter 프로젝트와의 간편한 통합

적합한 대상

  • 디자이너와 긴밀하게 협업하는 프론트엔드 개발자
  • 디자인 정확성을 우선시하는 팀
  • 기기 간에 일관된 UI가 필요한 프로젝트
  • Material Design 원칙을 사용하는 개발자
  • 다중 플랫폼을 대상으로 하는 앱

고려 사항

  • 그리드 시스템에 대한 이해가 필요합니다
  • 복잡한 레이아웃의 경우 추가 스타일링이 필요할 수 있습니다
  • 디자인 시스템 문서와 함께 사용하는 것이 가장 좋습니다
  • 완전한 UI 프레임워크가 아님—기존 위젯을 보완함
  • 그리드 구조를 넘어서는 사용자 정의가 제한적

원본 README

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

Build Status

Implement designs just like in Figma. Arrange your widgets in a grid and make your designer happy.

Design Grid streamlines your workflow and saves time. Easily configure multiple devices and screen sizes while reducing boilerplate code. Its user-friendly design makes integration effortless, allowing you to focus on your project's core.

The classic use-case of implementing a colum-based design. Use ResponsiveDesignGrid to implement a bootstrap-like design system where every element has a different column-span based on breakpoints.

Need to implement a design based on the strict rules of Material Layout? Use the MaterialDesignGrid to get an exact implementation of the Material Design Layout guide.

🔗 Table of Contents

✨ Features

Responsive Design Grid

Implement a column-based design with different column-spans for every breakpoint. Responsive design grid widgets can be indefinitely nested. Create small and clean widgets that use ResponsiveDesignGrid for layout. They will fit, no matter how deeply nested you use them.

You can customize:

  • Breakpoints
  • Column-spacing
  • Row-spacing
  • Grid-padding
  • Amount of columns

Material Design Grid

Implement a design based on the Material Design guidelines. Material Design Grid is not meant to be used nested.

You can customize:

  • Breakpoints
  • Column-spacing
  • Row-spacing
  • Grid-padding
  • Amount of columns per breakpoint

🎉 Getting started

Decide whether you need to use the ResponsiveDesignGrid or the MaterialDesignGrid. Speak with your designer to build a common understanding.

🏗️ Usage

Responsive Design Grid

ResponsiveDesignGridConfig is required only once in your app, it provides the ResponsiveDesignGridTheme. You can however always add an extra ResponsiveDesignGridTheme widget if you really need to. Beware, that this is not recommended.

You can nest design grids indefinitely. To keep performance high, make sure to nest them directly in a ResponsiveDesignGridItem. If you get any errors, you might have to pass the parameter shouldCalculateLayout: true to the ResponsiveDesignGrid widget. This might happen most likely when the design grid does not get the full width of the app, or if you nested it inside another ResponsiveDesignGridItem and it doesn't get the full width there.

ResponsiveDesignGridRow widget will wrap its children, your rows should have as little children as possible. Avoid large Rows since this will impact performance.

Basic Usage
@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Adjusting Breakpoints

To change the default breakpoints values, you can use the breakpoints property in ResponsiveDesignGridConfig constructor which takes an instance of ResponsiveDesignGridBreakpoints class.

@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
            breakpoints: const ResponsiveDesignGridBreakpoints(
            small: 375,
            medium: 768,
            large: 1280,
            extraLarge: 1920,
        ),
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Customizing the grid

To change the amount of columns, the column spacing, the row spacing or the grid padding, you can use the theme property in ResponsiveDesignGridConfig constructor which takes an instance of ResponsiveDesignGridThemeData class.

@override
Widget build(BuildContext context){
    return ResponsiveDesignGridConfig(
        theme: ResponsiveDesignGridThemeData(
            columns: 12,
            columnSpacing: 16.0,
            rowSpacing: 16.0,
            gridPadding:16.0,
        ),
        child: ResponsiveDesignGrid(
            children: [
                ResponsiveDesignGridRow(
                    children: [
                        ResponsiveDesignGridItem(
                            columns: ResponsiveDesignGridColumns(
                                small: 12,
                                medium: 10,
                                large: 8,
                                extraLarge: 6,
                            ),
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}
Material Design Grid

MaterialDesignGridTheme is required only once in your app, above the MaterialDesignGrid widget.

MaterialDesignGrid is not meant to be used nested due to material specifications.

MaterialDesignGridRow widget will wrap its children, you should size your rows as small as possible. Avoid large Rows since this will impact performance.

@override
Widget build(BuildContext context) {
    return MaterialDesignGridTheme(
        child: MaterialDesignGrid(
            children: [
                MaterialDesignGridRow(
                    children: [
                        MaterialDesignGridItem(
                            columns: 4,
                            child: Placeholder(),
                        ),
                    ],
                )
            ],
        ),
    );
}

📚 Additional information

All classes and exposed properties are well documented. If you find the documentation to be lacking, please create an issue 😊

Implementing a custom design grid approach

The base widgets used for both the ResponsiveDesignGrid as well as the MaterialDesignGrid can be found in lib/src/widgets. You can extend those to create your super-fancy very own custom design grid implementation 🥳.

카테고리

소스 저장소

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

아직 데이터가 없습니다.