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

simple_grid 표지
패키지 상세v0.1.5

simple_grid

부트스트랩을 영감으로 삼은 동적 그리드로, 그리드 레이아웃을 설명하는 데 사용할 수 있습니다. 이 패키지는 순수하게 MediaQuery를 사용하며, 렌더링에 대해 걱정할 필요가 없습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
955
좋아요
79
Pub 점수
160

패키지 설치

flutter pub add simple_grid

패키지 개요

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

Simple Grid는 Flutter용 반응형 그리드 레이아웃 패키지로, 부트스트랩에서 영감을 받았습니다. MediaQuery를 사용하여 유연하고 동적인 그리드 시스템을 정의할 수 있게 해주며, 다양한 화면 크기와 플랫폼 간에 레이아웃이 원활하게 적응되도록 합니다. 이 패키지는 복잡한 계산을 추상화함으로써 반응형 UI 디자인을 단순화하여, 수동 렌더링에 대한 걱정 없이 직관적인 그리드 정의가 가능하게 합니다. 모바일, 웹, 데스크톱 앱에서 일관되고 확장 가능한 인터페이스를 구축하는 데 이상적입니다.

사용 사례

  • 반응형 대시보드 구축
  • 적응형 카드 레이아웃 만들기
  • 다중 열 양식 설계
  • 크로스 플랫폼 UI 개발
  • 유체형 콘텐츠 그리드 구현

주요 기능

  • MediaQuery 기반 반응형
  • 부트스트랩을 영감으로 한 문법
  • 수동 렌더링 필요 없음
  • 크로스 플랫폼 지원
  • 간단한 선언적 그리드 정의

적합한 대상

  • 초보자 플러터 개발자
  • 반응형 UI 디자이너
  • 크로스플랫폼 앱 제작자
  • 빠른 프로토타이핑 팀
  • 레이아웃 중심 프로젝트

고려 사항

  • 그리드 구조를 넘어서는 사용자 정의가 제한적
  • MediaQuery 정확도에 따라 다름
  • 매우 복잡한 레이아웃에는 적합하지 않습니다
  • 고급 디자인을 위해 추가 스타일링이 필요할 수 있습니다
  • 표준 그리드 패턴에 가장 적합

원본 README

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

Indonesian documentation is here

Introduction

pub package build

Inspired by bootstrap , This is dynamic grid layout that you can use Like a bootstrap grid, but the size following material UI break points. You can also customize your break point like here. This package purely using mediaquery, don't worry about the render.

Simple Demo

code example here

Order Demo

code example here

Grid Explanation

Bootstrap, material-ui or another web-grid always use 12 size. Here is the image example:

Classes

There are 4 classes that you have to now, these are:

  1. SpGrid is the container of grid, more information here
  2. SpGridItem is the children of SpGrid, more information here
  3. SpGridSize is the class that you can declare the maximum of the screen size, more information here
  4. SpOrder, this class is a sort class. when you use 1 of it's value, the value will create an ordering when the screen on the value condition. more information here

Example

SpGrid(width: MediaQuery.of(context).size.width, children: [
  SpGridItem(
    xs: 12,
    sm: 6,
    md: 4,
    lg: 3,
    child: Container(
      color: Colors.blue,
      height: 200,
    ),
  ),
  SpGridItem(
    xs: 12,
    sm: 6,
    md: 4,
    lg: 3,
    child: Container(
      color: Colors.green,
      height: 200,
    ),
  ),
  SpGridItem(
    xs: 12,
    sm: 6,
    md: 4,
    lg: 3,
    child: Container(
      color: Colors.yellow,
      height: 200,
    ),
  ),
  SpGridItem(
    xs: 12,
    sm: 6,
    md: 4,
    lg: 3,
    child: Container(
      color: Colors.purple,
      height: 200,
    ),
  ),
]);

Order Example

import 'package:flutter/material.dart';
import 'package:simple_grid/simple_grid.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Simple_grid',
      theme: ThemeData(
        brightness: Brightness.dark,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("SIMPLE GRID EXAMPLE"),
      ),
      body: SpGrid(
        width: MediaQuery.of(context).size.width,
        spacing: 10,
        runSpacing: 10,
        children: [
          SpGridItem(
            xs: 12,
            md: 6,
            order: SpOrder(sm: 1, xs: 1),
            child: Container(
              height: 200,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text(
                    "Hello!",
                    style: TextStyle(fontSize: 40),
                    textAlign: TextAlign.center,
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  Text(
                    "I'm John Doe and I Love Programming",
                    style: TextStyle(fontSize: 25),
                    textAlign: TextAlign.center,
                  ),
                ],
              ),
            ),
          ),
          SpGridItem(
            xs: 12,
            md: 6,
            order: SpOrder(sm: 0, xs: 0),
            child: Container(
              height: 200,
              decoration: BoxDecoration(
                  image: DecorationImage(
                      image: NetworkImage(
                          "https://raw.githubusercontent.com/nggepe/simple_grid/master/doc/john.png"))),
            ),
          ),
        ],
      ),
    );
  }
}

Customize Break Point

SpGrid(
  width: MediaQuery.of(context).size.width,
  gridSize: SpGridSize(xs: 0, sm: 500, md: 768, lg: 980, xl: 1200),
  children:[],
)

카테고리

소스 저장소

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

아직 데이터가 없습니다.