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

flutter_device_emulator のカバー
パッケージ詳細v0.0.3

flutter_device_emulator

リアルタイムで複数のデバイス画面にわたってFlutterウィジェットをプレビューします。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
45
いいね数
0
Pub ポイント
150

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

flutter pub add flutter_device_emulator

パッケージ概要

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

Flutter デバイスエミュレータは、開発者がさまざまなデバイスの画面サイズや向きで Flutter ウィジェットをリアルタイムでプレビューできるツールです。Android、iOS、Web、macOS、Windows、Linux など複数のプラットフォームをサポートしており、物理的なデバイスがなくても一貫した UI テストが可能になります。このパッケージは開発ワークフローにシームレスに統合され、デザインの反復作業中に即時の視覚フィードバックを提供します。特に応答性のあるレイアウトとクロスプラットフォーム互換性を確認する際に役立ちます。

用途

  • リアルタイムウィジェットプレビュー
  • クロスプラットフォームUIテスト
  • レスポンシブデザインの検証
  • 迅速なプロトタイピング
  • デザインの一貫性チェック
  • 画面サイズのシミュレーション

主な機能

  • リアルタイムデバイスプレビュー
  • 複数のデバイステンプレート
  • すべての主要プラットフォームに対応
  • ライブレイアウトの更新
  • Flutter との簡単な統合
  • 方向の切り替え

適している対象

  • UI/UXデザイナー
  • Flutter開発者
  • クロスプラットフォームアプリのテスト担当者
  • プロトタイピングチーム
  • フロントエンドエンジニア

注意事項

  • 一部の機能には手動設定が必要です
  • ビジュアルプレビューに限定(実行時インタラクションなし)
  • 低スペックのマシンでのパフォーマンスに影響する可能性があります
  • 物理デバイステストの代替ではありません
  • 組み込みのテーマやロケールのシミュレーションなし

元の README

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

flutter_device_emulator

Pub Version License: MIT

A Flutter package to emulate different device screens and layouts, making it easier to preview and test your app on various device types and resolutions directly within your Flutter app or development environment.

flutter_device_emulator demo

Features

  • Emulate multiple device screen sizes and resolutions
  • Switch between device types (phone, tablet, etc.)
  • Preview your app in different orientations
  • Easy integration with your existing Flutter project
  • Customizable device frames and backgrounds

Installation

Add the following to your pubspec.yaml:

dependencies:
  flutter_device_emulator: latest_version

Then run:

flutter pub get

Usage

Import the package and wrap your app or widget with the emulator:

import 'package:flutter_device_emulator/flutter_device_emulator.dart';

DeviceEmulator(
  builder: (context) => SafeArea(child: HomePage()),
)
Example

See the example/ directory for a complete sample app demonstrating usage and available features.

API Reference

DeviceEmulator

The main widget to wrap your app for device emulation. Provides controls for device type, orientation, theme, and text direction.

Constructor:

DeviceEmulator({
  required WidgetBuilder builder,
  bool enableThemeToggle = true,
  bool enableOrientationToggle = true,
  bool enableLanguageToggle = true,
  Key? key,
})

Parameters:

  • builder (required): A function that builds the widget tree to be emulated inside the device frame.
  • enableThemeToggle (default: true): If true, shows a button to toggle between light and dark themes.
  • enableOrientationToggle (default: true): If true, shows a button to toggle between portrait and landscape orientations.
  • enableLanguageToggle (default: true): If true, shows a button to toggle between left-to-right and right-to-left text directions.
  • key: Optional widget key.

Features:

  • Device selector: Choose from a list of common devices to emulate.
  • Theme toggle: Switch between light and dark modes.
  • Orientation toggle: Switch between portrait and landscape.
  • Text direction toggle: Switch between LTR and RTL layouts.
  • Screenshot: Capture the current emulated screen (web only).

Example:

DeviceEmulator(
  builder: (context) => SafeArea(child: HomePage()),
)

For detailed API documentation, see the source code in lib/.

Contributing

Contributions are welcome! Please open issues or submit pull requests for bug fixes, features, or improvements.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a pull request

License

This project is licensed under the MIT License.

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

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

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