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

device_frame のカバー
パッケージ詳細v1.4.0

device_frame

一般的なデバイスのマックアップ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
30.1万
いいね数
165
Pub ポイント
140

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

flutter pub add device_frame

パッケージ概要

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

device_frame パッケージは、一般的なデバイス用のカスタマイズ可能なモックアップを提供し、開発者が Flutter アプリを現実的なデバイス環境で事前に確認できるようにします。Android、iOS、Web、macOS、Windows、Linux など、さまざまなプラットフォームをサポートしています。プレゼンテーション、ドキュメント作成、デザインレビューに最適で、アプリや開発ワークフローへの簡単な統合が可能です。パッケージには、画面サイズと向きを調整可能な事前定義されたデバイスフレームが含まれており、外部ツールを使用せずに視覚的コミュニケーションを強化できます。

用途

  • ドキュメント内のアプリプレビュー
  • デザインプレゼンテーションのマックアップ
  • デバイスコンテキストを使用したUIテスト
  • 開発者デモ
  • 開発中の視覚フィードバック

主な機能

  • 事前定義されたデバイステンプレート
  • クロスプラットフォーム対応
  • カスタマイズ可能なフレーム寸法
  • Flutter との簡単な統合
  • 複数の画面向きをサポートしています

適している対象

  • Flutter開発者
  • UI/UXデザイナー
  • 技術ライター
  • プロダクトマネージャー
  • プレゼンテーション作成者

注意事項

  • 本番アプリUI向けではありません
  • 新しいデバイスには手動でのフレーム更新が必要です
  • 静的モックアップレンダリングに限定
  • インタラクティブデバイスの動作なし
  • 開発またはデモ環境で最適に使用されます

元の README

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

Device Preview for Flutter

Simulate any device — screen, safe areas, locale, accessibility — with full framework fidelity.

You build on one screen; your users arrive on hundreds. Device Preview switches your running app to another device — an old 320pt phone, a tablet in landscape, a notched display, a half-width desktop window — instantly, with no rebuild and no simulator.

Screen size, pixel ratio, safe areas, orientation, folds, the software keyboard, locales, brightness, text scale, accessibility settings and target platform all change with it, and your app reads them through the same MediaQuery it always used. So the problems that normally surface in front of a customer — a clipped headline, a button under the home indicator, an overflow at 200% text — surface in front of you instead.

Control it from Flutter DevTools, from Dart, or from your tests.

Quickstart

dependencies:
  device_preview: <latest version>
void main() {
  DevicePreview.enable();
  runApp(const MyApp()); // runs as usual — now simulatable
}

That's the whole integration. Open DevTools, select the device_preview tab, and pick a device.

enable() is safe to call unconditionally: simulation is active in debug and profile builds and completely off in release, so nothing ships to your users. Pass a value to decide yourself — DevicePreview.enable(enabled: kDebugMode) for debug only, DevicePreview.enable(enabled: false) to turn it off.

Programmatic control:

import 'package:device_preview/presets.dart';

final c = DevicePreview.controller;
await c.applyPreset(DevicePresets.iPhone16Pro);
await c.setOrientation(Orientation.landscape);
await c.update((s) => s.copyWith(textScaleFactor: 2.0, platformBrightness: Brightness.dark));
await c.reset();

DevicePreview.controller throws when simulation is off (every release build); use DevicePreview.maybeController?.… from code that ships.

See device_preview/README.md for the full package documentation, including widget-test support via DevicePreviewBindingMixin.

Documentation

Open the website · Design document

Repository structure

Directory Contents
device_preview The published package: binding, controller, presets, service extensions, bundled DevTools extension build.
device_preview_devtools_extension Source of the DevTools extension web app (never published; built into device_preview/extension/devtools/build).
device_specs The device catalog: one JSON per device — metrics, screen outline and body artwork. Generated into both the extension catalog and the package's built-in DevicePresets; see its README to add a device.
device_frame Legacy device frame drawings package from the 2.x era. Nothing in the 3.0 release depends on it — 3.0 renders frames from the device_specs artwork, carried by the built-in presets and pushed over the DevTools protocol.
docs The website, including its interactive demo — docs/demo is the counter example built for the web, docs/device_catalog.json the catalog its HTML panel pushes to it. Rebuild both with tool/build_demo.sh.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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