パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細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を動的に調整できるようになります。Android、iOS、Web、macOS、Windows、Linux向けアプリに最適で、レスポンシブデザインのワークフローを簡素化します。

用途

  • クロスプラットフォーム対応のレスポンシブレイアウトの構築
  • 異なる画面サイズに合わせたUIの調整
  • Webおよびモバイル向けの適応型デザインを作成する
  • ブレイクポイントベースのスタイルの簡素化
  • マルチデバイスアプリ開発のサポート

主な機能

  • ブレークポイントに基づく応答型ロジック
  • クロスプラットフォーム互換性
  • 柔軟なウィジェットユーティリティ
  • 自動調整レイアウト
  • 最小限のボイラープレートコード

適している対象

  • マルチプラットフォームアプリを開発する開発者
  • 応答性のデザインを重視するチーム
  • 動的な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();

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。