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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。