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

パッケージ詳細v0.5.0

responsive_layout_builder

画面サイズと向きに基づいて応答性のあるレイアウトを構築するためのFlutterパッケージです。ウェアラブル端末、小・中・大規模なモバイル、小・大規模なタブレット、またはデスクトップに対応できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
139
いいね数
24
Pub ポイント
140

パッケージをインストール

flutter pub add responsive_layout_builder

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

腕時計、モバイル、タブレット、デスクトップを含むさまざまなデバイスで画面サイズと向きを検出し、レスポンシブレイアウトの作成を簡素化するFlutterパッケージです。現在のデバイスの特徴に基づいてUIコンポーネントを動的に適応させるための明確なAPIを提供し、多様なフォームファクターにわたって一貫したユーザー体験を確保します。繰り返しのメディアクエリロジックを書かずに、柔軟でスケーラブルなインターフェースを構築したい開発者にとって理想的です。

用途

  • 異なる画面サイズに合わせたUIの調整
  • 一貫したデザインでクロスプラットフォームアプリを構築する
  • 時計とタブレットのレイアウトを作成する
  • 手動のメディアクエリなしのレスポンシブデザイン
  • デスクトップおよびモバイル向けのレイアウト最適化
  • 複数のデバイス向きをサポートする

主な機能

  • 自動スクリーンサイズ検出
  • 方向に応じたレイアウトの調整
  • ウォッチ、モバイル、タブレット、デスクトップのサポート
  • シンプルで宣言的な API
  • 一般的なデバイス用の組み込みブレークポイント
  • クロスプラットフォーム互換性

適している対象

  • マルチデバイスアプリを開発する開発者
  • 応答性のデザインを重視するチーム
  • アダプティブUIを必要とするプロジェクト
  • Flutterの初心者が応答性のあるレイアウトを学ぶ
  • モバイルおよびデスクトップユーザーをターゲットにしたアプリ
  • 複雑なレイアウト要件を持つプロジェクト

注意事項

  • 複数のデバイスタイプでのテストが必要になる場合があります
  • ブレークポイントは事前に定義されており、完全にカスタマイズすることはできません
  • 非常に頻繁な再構築によるパフォーマンスへの影響
  • 画面サイズおよび向きの検出に制限される
  • 動的コンテンツのリサイズを処理しない
  • 複雑なレイアウト用に状態管理と併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

responsive_layout_builder

Flutter package for building responsive layout based on screen sizes and orientation. It could be wristwatch, small/medium/large mobile, small/large tablet or desktop.

Getting Started

Widget approach

ResponsiveLayoutBuilder could be used as usual widget builder such as LayoutBuilder or OrientationBuilder, etc.

ResponsiveLayoutBuilder(
    builder: (context, screenSize) {
        // Use size argument to build size dependent widgets
    },
),

size property within screenSize stores LayoutSize which could be watch, mobile, tablet, desktop or tv.

mobile property within screenSize stores MobileLayoutSize which could be small, medium or large.

tablet property within screenSize stores TabletLayoutSize which could be small or large.

Functional approach

For using functional approach to retrieve current size use following:

// for getting mobile layout size 
getMobileLayoutSize(width: MediaQuery.of(context).size.width);

// for getting tablet layout size 
getTabletLayoutSize(width: MediaQuery.of(context).size.width);

// for getting screen size based on width
getScreenSize(width: MediaQuery.of(context).size.width);

// for getting screen size based on context 
getContextualScreenSize(context: context);

If you need to specify ScreenSizeSettings for all above functions sizes argument is needed to be passed, like this:

sizes: ScreenSizeSettings(...)

For getScreenSize and getContextualScreenSize could be specified also orientation and defaultSize.

TODO

  • Figure out how to determine TV
  • Add tests

カテゴリー

依存関係

依存関係一覧 1 件

  • pedantic^1.11.0

ソースリポジトリ

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

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