搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.5

adaptive_screen_flutter

使佈局適應行動裝置、平板電腦和網頁螢幕。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
91
喜歡數
23
Pub 分數
150

安裝套件

flutter pub add adaptive_screen_flutter

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

AdaptiveScreenFlutter 是一個響應式 UI 套件,可讓佈局自動調整以適應不同螢幕尺寸,適用於行動裝置、平板與網頁平台。它透過偵測裝置類型與螢幕尺寸,簡化了建立流暢設計的過程,讓開發者無需撰寫複雜的條件邏輯即可定義自適應行為。該套件與 Flutter 的 widget 系統完全整合,支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux。非常適合需要在多種裝置上維持一致使用者體驗的應用程式。

適用情境

  • 使用響應式佈局構建跨平台應用
  • 為平板電腦和桌面電腦創建自適應介面
  • 為移動設備和網頁設計統一的使用者介面
  • 優化使用者介面以適應不同的螢幕尺寸
  • 開發可擴展的儀表板介面
  • 支援多裝置應用部署

主要特色

  • 自動螢幕尺寸檢測
  • 平台無關的響應式設計
  • 針對行動裝置、平板電腦和網頁的內建斷点
  • 與現有 Flutter 專案的輕鬆整合
  • 支援所有 Flutter 目標平台
  • 靈活的佈局配置

適合對象

  • 針對多個平台的開發者
  • 建構響應式儀表板的團隊
  • 需要平板和網頁支援的應用
  • 需要最少響應式樣板的項目
  • 專注於前端的 Flutter 團隊

使用建議

  • 可能需要在多種設備類型上進行測試
  • 佈局邏輯應仔細規劃
  • 不太適合高度動態或自定義渲染需求
  • 依賴於準確的螢幕尺寸檢測
  • 最佳搭配結構良好的小部件樹使用

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Hi Flutter dev, this package helps you to build UI with adaptive screen based on mobile, tablet and web.

Example

Getting started

You can customize the brakepoint of the screen width or just use the default of this package for the screen width.

Usage

The defaut brake point of tablet is 600.0 and 950 for the web.

OR

If you want to custom the brake point, you can set init brake point in main method like this

void main(){
    // here for setting mobile to tablet brakepoint
    ScreenInit.setTabletBrakePoint(650.0);
    // here for setting tablet to web brakepoint
    ScreenInit.setWebBrakePoint(1000.0);
    runApp(MyApp());
}

Wrap your widget with AdaptiveScreen()

AdaptiveScreen(
    mobile: Center(
        child: Text('Ini Mobile')
    ),
    tablet: Row(
        children:[
            Text('Ini tablet'),
            Container()
            // ...
        ]
    ),
    web: Column(
        children:[
            Text('Ini web'),
            SizedBox(height:30),
            // ...
        ]
    )
)

LICENSE

MIT License

Copyright (c) 2022 Ferdian Gunawan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Additional Information

Please don't hesitate to contribute to this package.

Shout out to Abdelouahed Medjoudja that has inspired me for the default width screen 600 and 950.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。