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

套件詳情v0.0.3

responsive_ui_kit

responsive_ui_kit 幫助您使用置中版面、響應式分割檢視、螢幕尺寸擴展和自動文字縮放來建立適應性、可擴展的 Flutter UI。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
11
喜歡數
0
Pub 分數
160

安裝套件

flutter pub add responsive_ui_kit

套件介紹

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

responsive_ui_kit 是一個 Flutter 套件,旨在簡化在多個平台建立適應性和可擴展使用者介面的過程。它提供置中佈局、響應式分割檢視、螢幕尺寸延伸功能以及自動文字縮放,確保在各種尺寸裝置上保持一致的 UI 行為。此套件從跨平台支援的角度設計,可簡化 Android、iOS、Web、macOS、Windows 和 Linux 的開發流程。該套件無需複雜的自訂邏輯即可增強 UI 響應性,非常適合需要在不同螢幕尺寸下提供精緻體驗的應用程式。

適用情境

  • 建構跨平台 Flutter 應用
  • 建立適應性儀表板佈局
  • 設計響應式表單和卡片
  • 實現分屏檢視
  • 確保跨裝置的一致性排版
  • 開發可擴展的管理面板

主要特色

  • 居中佈局工具
  • 響應式拆分檢視元件
  • 螢幕尺寸擴展助手
  • 基於設備的自動文字縮放
  • 跨平台相容性
  • 簡單 API 結合

適合對象

  • 針對多個平台的開發者
  • 建構響應式儀表板的團隊
  • 需要自適應UI的應用程式
  • 專注於前端的Flutter開發者
  • 具有不同螢幕尺寸需求的專案
  • 響應式設計的快速原型製作

使用建議

  • 可能需要額外的樣式來處理複雜版面
  • 對高級UI模式的自訂有限
  • 依賴於 Flutter 的渲染引擎
  • 未針對高度動態內容進行優化
  • 最適合結構化、基於網格的設計
  • 需要理解響應式設計原則

原始 README

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

🌐 Flutter Responsive UI

A clean and flexible way to build responsive layouts in Flutter across mobile, tablet, and desktop — with minimal boilerplate and powerful layout tools.


✨ Features

🧱 Simple, composable layout widgets
📐 Screen-based constraints (context.width, context.height)
🔡 Auto-scaling text with context.scaleText(...)
🔀 Dynamic Row/Column layout with ResponsiveSplitBody
🧩 ResponsiveCenteredBody for centered readable content
⚙️ Customizable breakpoints
🧠 Inherited context with ResponsiveLayoutProvider
🧪 Built-in example app


📦 Installation

Add to your pubspec.yaml:

dependencies:
  responsive_ui_kit : ^0.0.2

Import the package.

import 'package:flutter_responsive_ui/responsive_ui_kit.dart';

Video

https://github.com/user-attachments/assets/6e97004f-8694-4885-a852-5918e5615e8a

Usage

Wrap your app with ```ResponsiveLayoutProvider```` to access screen size in the widget tree:

void main() {
  runApp(
    const ResponsiveLayoutProvider(
      child: MaterialApp(
        home: MyHomePage(),
      ),
    ),
  );
}

🧱 Core Widgets

✅ ResponsiveCenteredBody

Center your content and constrain its width (default maxWidth = 640).

ResponsiveCenteredBody(
maxWidth: 720,
backgroundColor: Colors.grey[200],
child: Text("Centered content"),
)
🔀 ResponsiveSplitBody

Automatically switches between vertical and horizontal layout:

ResponsiveSplitBody(
primaryChild: Text("Primary"),
secondaryChild: Text("Secondary"),
gap: 16,
)

Force layout direction:

ResponsiveSplitBody(
  forceVerticalLayout: true, // Always vertical
)

Custom breakpoints: use maxMobileWidth property of BreakPoints

 ResponsiveSplitBody(
breakPoints: BreakPoints(maxMobileWidth: 700),
)

📐 Context Extensions

  • Use helpful extensions anywhere:
final screenWidth = context.width;
final screenHeight = context.height;

Global method for scalable sizes

    Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            Text(
              'text widget scaling with screen size',
              style: TextStyle(
                color: Colors.amber,
                // getRespSize will scale your given size according to screen size and TextSizes is class where you can some standarad 
                //text sizes
                fontSize: getRespSize(context, size: TextSizes.titleMedium),
                // TextScalingValues parameter to control of scaling 

              ),
            ),
            Icon(Icons.home, size: getRespSize(context, size: 22))
          ],
        ),

🛠️ Configuration

Feature Usage
Max width ResponsiveCenteredBody(maxWidth: ...)
Custom breakpoints BreakPoints(maxMobileWidth: ...)
Gap between children gap: 20 in ResponsiveSplitBody
Flex ratios primaryFlex, secondaryFlex
Cross axis alignment crossAxisAlignment: CrossAxisAlignment.start

💬 Support

  • 🐛 Issues → https://github.com/kFasih132/flutter_responsive_ui
  • 📖 Docs → This README + example app
  • 🌟 Like it? Star it on pub.dev
Built with ❤️ by Fasih us Rehman for the Flutter community

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。