flutter_console:基于 Flutter 的 Console 可视化组件项目

暂无描述

分支2Tags3
文件最后提交记录最后更新时间
3 个月前
4 年前
1 年前
4 年前
4 年前
5 个月前
3 个月前
2 年前
23 天前
4 年前
1 年前
4 年前
3 个月前
23 天前
23 天前
1 年前
4 年前
3 个月前
4 年前
5 个月前

flutter_console

本项目基于 flutter_console 开发。

1. 安装与使用

1.1 安装方式

进入到工程目录并在 pubspec.yaml 中添加以下依赖:

pubspec.yaml

...

dependencies:
  flutter_console:
    git:
      url: https://gitcode.com/CPF-Flutter/flutter_console.git
      # ref: 根据下方表格选择不同框架适配的TAG版本
      ref: 0.0.4-ohos-1.0.0

...

执行命令

flutter pub get

TAG 版本对应表

| Flutter 框架版本 | TAG 名称 | 分支名 |------------------------- | ------ | | 3.7 | 0.0.4-ohos-1.0.0 | master | | 3.22 | 0.0.4-ohos-1.0.0 | master | | 3.35 | 0.0.4-ohos-1.0.0 | master |

1.2 使用案例

使用案例详见 example

2. 约束与限制

2.1 兼容性

在以下版本中已测试通过

  1. Flutter: 3.7.12-ohos-1.0.6; SDK: 5.0.0(12); IDE: DevEco Studio: 5.0.13.200; ROM: 5.1.0.120 SP3;
  2. Flutter: 3.22.1-ohos-1.0.1; SDK: 5.0.0(12); IDE: DevEco Studio: 5.0.13.200; ROM: 5.1.0.120 SP3;
  3. Flutter: 3.35.8-ohos-0.0.1; SDK: 6.0.1(21); IDE: DevEco Studio: 6.0.1.260; ROM: 6.0.0.120 SP6;

3. API

"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

ConsoleOverlay

Name Description Type Input Output ohos Support
show 显示控制台浮窗 function required OverlayState baseOverlay, required ConsoleStream contentStream, double y = 200 void yes
unfoldWidgetUpdate 更新展开状态的浮窗组件 function / void yes
foldAction 折叠控制台窗口 function / void yes
refresh 刷新浮窗内容 function / void yes

ConsoleStream

Name Description Type Input Output ohos Support
push 推送日志消息到流 function Object? message void yes
pause 暂停日志流 function / void yes
resume 恢复日志流 function / void yes
destroy 销毁日志流 function / void yes

ConsoleWidgetState

Name Description Type Input Output ohos Support
updateWindowHeight 更新窗口高度 function DragUpdateDetails detail void yes

4. 属性

"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

ConsoleWidget

Name Description Type Input Output ohos Support
onCloseClicked 关闭按钮点击回调 VoidCallback / / yes
onFoldClicked 折叠按钮点击回调 VoidCallback / / yes
consoleStream 日志流对象属性 ConsoleStream / / yes

4. 遗留问题

5. 其他

6. 开源协议

本项目基于 The MIT (license) ,请自由地享受和参与开源。