搜索插件、代码仓与 APP 分类

GitHub 代码仓kFasih132/flutter_responsive_ui

flutter_responsive_ui

kFasih132/flutter_responsive_ui open-source repository details.

flutter_responsive_ui 项目封面
星标
0
复刻
0
最近推送(UTC)
2025年7月21日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

🌐 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
Fasih ur Rehman GitHub avatar
GitHub 作者

Fasih ur Rehman ↗

语言C++DartCMakeSwiftCHTMLKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项

  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^5.0.0

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

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

GitHub Docs — About repositories ↗