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

GitHub 저장소bharathraj-e/responsive_ui

반응형 UI

Flutter 반응형 위젯 - 모든 Flutter 플랫폼에서 작동합니다

반응형 UI 프로젝트 이미지
스타
16
포크
8
최근 푸시(UTC)
2023. 4. 2.
프로젝트 상태
활성

원본 README

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

Responsive UI

Pub

responsive_ui package helps you to create a responsive widget and Nested responsive widgets. Works on all Platforms.

Getting Started

Live demo : https://bharathraj-e.github.io/responsive_ui/ Have a look!

It works as same as Bootstrap / Materialize Row Column method, Splitting screen into 12 columns and placing widget by combining column based on screen size.

    Responsive(
        children: <Widget>[
            Div(
                division:Division(
                    colS: 5,
                    offsetL: 2,
                ),
                child: Card(child: Icon(Icons.game))
            ),
            Div(
                division:Division(
                    colS: 12,
                    colM: 6,
                    colL: 4,
                ),  
                child: Text('responsive ui')
            )          
        ]
    )

Widgets

The Responsive UI Package contains two simple widgets.

  1. Div()
  2. Responsive()

1. Div()

Arguments inputs if null / default to
child Widget required
division Division if null defaluts to Division()

Divison() intakes column sizes and offSets.

Arguments inputs if null / default to
colXS (int) 0-12 12
colS (int) 0-12 colXS value
colM (int) 0-12 ColS value
colL (int) 0-12 ColM value
colXL (int) 0-12 ColL value
offsetXS (int) 0-12 0
offsetS (int) 0-12 0
offsetM (int) 0-12 0
offsetL (int) 0-12 0
offsetXL (int) 0-12 0
(XS = Extra Small, S = small, M = medium, L = large, XL = Extra Large)
  • 0 - 0.0 width (gone) (replaced with SizedBox.shrink())

  • 12 - full width (provided by parent widget not screen width)

  • Parent widget should not be a horizontal scroll type widget

  • To offset, simply add offsetS / offsetM / offsetL to the Div() widget with colS / colM / colL respectively.

  • Offset works for their respective column sizes.

2. Responsive()

Responsive intakes List<Widget> or List<Div> with default column/screen size for each widget can be declared.

Arguments inputs if null / default
children List / List
not null / required / empty[]
alignment WrapAlignment WrapAlignment.start
runAlignment WrapAlignment WrapAlignment.start
crossAxisAlignment WrapCrossAlignment WrapCrossAlignment.start
runSpacing double 0.0

Note

  • Responsive widget is a Wrap widget.

  • Responsive & Div() widget need Finite width to work.

  • Div() works with vertical scroll not in horizontal scroll, as it calculations are base on width only.

  • Div() works as expected when it placed as a direct child of Responsive() widget's children.

  • Sum of the offset and the respective col should be <= to 12

Nested Responsive

Place a Responsive() widget into a Div().

The nested Responsive() widget takes the width provided by parent Div() widget and not the screen width

sample

Screen Types

Type Default Size
Xtra small < 375.0
Small 375.0 - 596.0
Medium 596.0 - 897.0
Large 897.0 - 1232.0
Xtra Large >1232.0

Override / Set your default size

Yes, now you can set your own breakpoints, that applies to all the Responsive & Div widgets.

void main() {
  // sample 1
  Responsive.setGlobalBreakPoints(400.0, 600.0, 997.0, 1380.0);
  // Sample 2 
  Responsive.setGlobalBreakPoints(0, 596.0, 897.0, 1232.0);
  // Since the first value is 0 : colXS is always neglected
  runApp(const MyApp());
}

responsive_ui is made simply using Wrap() and LayoutBuilder() with a bits of logics.



Buy Me A Coffee
Bharathraj Elangovan GitHub avatar
GitHub 작성자

Bharathraj Elangovan ↗

Flutter Developer, TN INDIA

Chennai, Tamil Nadu공식 웹사이트 ↗
언어C++CMakeDartHTMLCRubySwiftKotlinObjective-C

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개

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

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗