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

GitHub リポジトリsmew-tech/presentation-displays

presentation-displays

Flutterプラグインは2つの画面での実行をサポートしています。基本的にHDMIまたはワイヤレスで別の画面に接続されたタブレットです。

presentation-displays のプロジェクト画像
スター
76
フォーク
123
最終プッシュ(UTC)
2024/03/26
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

presentation_displays

Supported mobile platforms iOS and Android

Flutter plugin supports to run on two screens. It's basically a tablet connected to another screen via an HDMI or Wireless

Plugin: https://pub.dev/packages/presentation_displays

Idea: We create a Widget by using Flutter code and pass it to Native code side then convert it to FlutterEngine and save it to FlutterEngineCache for later use.

Next, we define the Display by using displayId and we will define the UI flutter that needs to display by grabbing FlutterEngine in FlutterEngineCache and transferring it to Dialog Presentation as a View.

We provide methods to get a list of connected devices and the information of each device then transfer data from the main display to the secondary display.

Simple steps:

  • Create Widgets that need to display and define them as a permanent router when you configure the router in the Flutter code.

  • Get the Displays list by calling displayManager.getDisplays ()

  • Define which Display needs to display For instance: displays [1] .displayId Display the index 2.

  • Display it on Display with your routerName as presentation displayManager.showSecondaryDisplay (displayId: displays [1] .displayId, routerName: "presentation")

  • Transmit the data from the main display to the secondary display by displayManager.transferDataToPresentation (" test transfer data ")

  • The secondary screen receives data

@override
Widget build (BuildContext context) {
    return SecondaryDisplay (
        callback: (argument) {
        setState (() {
        value = argument;
        });
    }
    );
}
  • wesetup new entry point for secondary display so we can decided what we need to call for initialization. Works only for android for now
@pragma('vm:entry-point')
void secondaryDisplayMain() {
 /// do something that don't break plugin registration here.
}
Upgrade version 1.0.0
  • Able to package android release build. Works fine in example app.

  • Tested example app in android tab and ios tab and things work as expected. Ensure the devices have USB C 3.0 and above else HDMI out is not supported.

  • In case of iOS, please refer to example app app delegate. There are few lines of code which needs to be added to your app's app delegate as well for this to work fine in iOS.

  • Updated optional issues and null checks

  • Added option to hide second display from the first

  • WIP support second main in iOS for extended display

  • WIP Send data back from 2nd to 1st display

You can take a look at our example to learn more about how the plugin works

Test on Sunmi-D2 device

The example app running in android

SMEW GitHub avatar
GitHub 作者

SMEW ↗

Founder SMEW Technology

SMEW TechnologyVietnam公式サイト ↗
言語DartKotlinSwiftRubyObjective-C

カテゴリー

使用している依存関係

依存関係一覧 3 件

  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}
  • flutter_lints開発用^1.0.4

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗