搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。