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

패키지 상세v1.0.6+4

the_responsive_builder

이 Flutter 패키지는 반응형 Flutter 애플리케이션을 구축하는 데 도움이 되는 유틸리티 세트를 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
16
좋아요
16
Pub 점수
140

패키지 설치

flutter pub add the_responsive_builder

패키지 개요

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

Responsive Builder는 여러 플랫폼에서 반응형 사용자 인터페이스를 쉽게 만들 수 있도록 설계된 Flutter 패키지입니다. 화면 크기, 기기 유형, 방향에 따라 레이아웃과 스타일을 자동으로 조정하는 유틸리티 함수와 위젯을 제공합니다. 브레이크포인트와 유연한 제약 조건을 활용하여 반복적인 조건부 로직 없이 다양한 기기에 맞춰 동적으로 조정되는 UI를 구축할 수 있습니다. 안드로이드, iOS, 웹, macOS, Windows, 리눅스를 대상으로 하는 앱에 이상적이며, 반응형 디자인 워크플로우를 간소화합니다.

사용 사례

  • 크로스 플랫폼 반응형 레이아웃 구축
  • 다른 화면 크기에 맞춰 UI 적응
  • 웹 및 모바일을 위한 적응형 디자인 만들기
  • 브레이크포인트 기반 스타일링 간소화
  • 다기기 앱 개발 지원

주요 기능

  • 브레이크포인트 기반 반응형 로직
  • 크로스 플랫폼 호환성
  • 유연한 위젯 유틸리티
  • 자동 조정 레이아웃
  • 최소한의 보일러플레이트 코드

적합한 대상

  • 다중 플랫폼 앱을 개발하는 개발자
  • 반응형 디자인을 우선시하는 팀
  • 동적 UI 적응이 필요한 프로젝트
  • Flutter 초보자들이 반응형 패턴을 배우고 있습니다
  • 다양한 기기 생태계를 겨냥하는 앱

고려 사항

  • 반응형 디자인 원칙에 대한 이해가 필요할 수 있습니다
  • 복잡한 레이아웃에 대한 제한된 사용자 정의
  • 브레이크포인트 사용의 일관성에 의존
  • 표준 반응형 요구 사항에 가장 적합
  • 매우 동적 또는 비선형 레이아웃에는 적합하지 않습니다

원본 README

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

Pub

The Responsive Builder

This package provides a set of utilities to aid in building responsive Flutter applications that adapt to different screen sizes and orientations.

1. Setup

Firstly, add package to pubspec.yaml.

Then, wrap your main MaterialApp widget with the TheResponsiveBuilder

void main() => runApp(
  TheResponsiveBuilder(
    builder: (context, orientation, screenType) {
      return MaterialApp(
        //... your other MaterialApp properties
      );
    },
  ),
);
2. Usage of extensions

With the utilities set up, you can easily use the extensions provided:

- Height & Width
// This will set the height to 20% of the screen height
Container(height: 20.h, ...);

// This will set the width to 50% of the screen width
Container(width: 50.w, ...);
- Density Pixels & Scaled Pixels
// This uses a logarithmic formula to scale UI elements based on screen size and pixel density.
TextStyle(fontSize: 16.dp, ...);

// This scales the text size based on the user's font size settings.
TextStyle(fontSize: 16.sp, ...);
- Screen Type & Orientation
if (context.screenType == ScreenType.mobile) {
  // Build UI for mobile
} else {
  // Build UI for tablet
}

if (context.orientation == Orientation.portrait) {
  // Build UI for portrait mode
} else {
  // Build UI for landscape mode
}
- Lock & Unlock Screen Orientation
// Lock screen orientation to Portrait mode
context.lockToPortrait();

// Lock screen orientation to Landscape mode
context.lockToLandscape();

// Unlock screen orientation to automatic mode
context.unlockOrientation();

카테고리

소스 저장소

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

아직 데이터가 없습니다.