flutter_console
This project is based on flutter_console.
1. Installation and Usage
1.1 Installation
Go to the project directory and add the following dependencies in pubspec.yaml
pubspec.yaml
...
dependencies:
flutter_console:
git:
url: https://gitcode.com/CPF-Flutter/flutter_console.git
# ref: Select the TAG version that matches your Flutter framework version from the table below
ref: 0.0.4-ohos-1.0.0
...
Execute Command
flutter pub get
TAG Version Mapping
| Flutter Framework Version | TAG | Branch |
|---|---|---|
| 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 Usage
For use cases example
2. Constraints
2.1 Compatibility
This document is verified based on the following versions:
- 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;
- 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;
- 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
If the value of **ohos Support** is **yes**, it means that the ohos platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
ConsoleOverlay
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| show | Display console floating window | function | required OverlayState baseOverlay, required ConsoleStream contentStream, double y = 200 | void | yes |
| unfoldWidgetUpdate | Update expanded state floating window component | function | / | void | yes |
| foldAction | Collapse console window | function | / | void | yes |
| refresh | Refresh floating window content | function | / | void | yes |
ConsoleStream
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| push | Push log messages to the stream | function | Object? message | void | yes |
| pause | Pause log stream | function | / | void | yes |
| resume | Resume log stream | function | / | void | yes |
| destroy | Destroy the log stream | function | / | void | yes |
ConsoleWidgetState
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| updateWindowHeight | Update window height | function | DragUpdateDetails detail | void | yes |
4. Properties
If the value of **ohos Support** is **yes**, it means that the ohos platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
ConsoleWidget
| Name | Description | Type | Input | Output | ohos Support |
|---|---|---|---|---|---|
| onCloseClicked | Close button click callback | VoidCallback | / | / | yes |
| onFoldClicked | Collapse button click callback | VoidCallback | / | / | yes |
| consoleStream | Log stream object property | ConsoleStream | / | / | yes |
4. Known Issues
5. Others
6. License
This project is licensed under The MIT (license).