Skip to content

Commit

Permalink
[feat] Merge develop_nullsafety (bytedance#18)
Browse files Browse the repository at this point in the history
* [feat] Update documents

* [chore] Cherrypick be93269 for rm lock files

* [fix] Make flutter_coverage_badge git dependency with https url.

* [fix] Make flutter_coverage_badge git dependency with https url.

* [feat] Common FloatingWidget support custom height

* Automated report coverage

* [fix] show code plugin fix (bytedance#11)

* [fix] `CodeDisplayService` typo

* [fix] `return` does not break loop in `forEach` & argument `className` is not used

* [fix] test failed when there are more than one script's uri match the given `fileName`

* [feat] Introduce `DioInspector` (bytedance#16)

* feat: Initial commit.

* ♻️ Rename from `network` to `dio`

* 🚀 Implement pluggable

* ⚡️ Add paging for requests

* 🎨 Abstract constants

* ✨ Add `DioPluggable` registry

* ♻️ `DioPluggable` -> `DioInspector`

* 🎨 Use extensions for more pretty callers

* 📝 Address more documentations

* 🔥 Remove used packages

* 🎨 Improve imports

* 💬 `网络请求` -> `Dio Requests`

* 🎨 Apply suggestions

* ✅ Add tests

* [feat] Remove extra MaterialApp, use Overlay (bytedance#13)

* [feat] Remove extra MaterialApp, use Overlay

* [opt] Rm getx, remove unused comments

* [opt] Fix suggestions

* Automated report coverage

* [fix] syntax in example.

* [release] Release 0.2.1

* [release] Release 0.2.1

* [release] kits 0.2.1

* [chore] fix doc

Co-authored-by: smileShirely <[email protected]>
Co-authored-by: lpylpyleo <[email protected]>
Co-authored-by: Alex Li <[email protected]>
  • Loading branch information
4 people authored Aug 10, 2021
1 parent 3a6171f commit 6a294c0
Show file tree
Hide file tree
Showing 55 changed files with 1,387 additions and 4,177 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
.pub-cache/
.pub/
build/
*pubspec.lock

# Android related
**/android/**/gradle-wrapper.jar
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[English](./CHANGELOG_en.md)

## [0.2.1]

* 移除独立的 MaterialApp Widget

## [0.2.0-dev.0]

* 适配 null-safety
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[简体中文](./CHANGELOG.md)

## [0.2.1]

* Remove the extra MaterialApp Widget

## [0.2.0-dev.0]

* Adapted Null-Safety.
Expand Down
59 changes: 40 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Flutter 应用内调试工具平台
扫码或点击链接下载 apk,快速体验 UME。
https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.apk

当前版本内置 10 个插件,
最新版本(0.2.1)内置 11 个插件,
开发者可以创建自己的插件,并集成进 UME 平台。
详见本文[为 UME 开发插件](#为-ume-开发插件)部分。

Expand All @@ -36,12 +36,13 @@ https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.ap

``` yaml
dev_dependencies: # 请不要在 release 环境下使用 UME
flutter_ume: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume_kit_ui: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume_kit_device: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume_kit_perf: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume_kit_show_code: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume_kit_console: ^0.1.0 # null-safety 版本: ^0.2.0-dev.0
flutter_ume: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_ui: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_device: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_perf: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_show_code: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_console: ^0.1.1 # null-safety 版本: ^0.2.1
flutter_ume_kit_dio: ^0.2.0 # 仅支持 null-safety 版本
```
2. 执行 `flutter pub get`
Expand All @@ -54,6 +55,7 @@ https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.ap
import 'package:flutter_ume_kit_show_code/flutter_ume_kit_show_code.dart'; // 代码查看插件包
import 'package:flutter_ume_kit_device/flutter_ume_kit_device.dart'; // 设备信息插件包
import 'package:flutter_ume_kit_console/flutter_ume_kit_console.dart'; // debugPrint 插件包
import 'package:flutter_ume_kit_dio/flutter_ume_kit_dio.dart'; // Dio 网络请求调试工具
```

4. 修改程序入口,增加初始化方法及注册插件代码
Expand All @@ -71,7 +73,8 @@ https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.ap
..register(MemoryInfoPage())
..register(CpuInfoPage())
..register(DeviceInfoPanel())
..register(Console());
..register(Console())
..register(DioInspector(dio: dio)); // 传入你的 Dio 实例
runApp(injectUMEWidget(child: MyApp(), enable: true)); // 初始化
} else {
runApp(MyApp());
Expand All @@ -89,6 +92,11 @@ https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.ap

## 特别说明

**自 `0.1.1`/`0.2.1` 版本起,已经不需要设置 `useRootNavigator: false`。**
以下部分仅适用于 `0.1.1`/`0.2.1` 之前的版本。

<s>

由于 UME 在顶层管理了路由栈,`showDialog` 等方法默认使用 `rootNavigator` 弹出,
所以**必须**在 `showDialog`、`showGeneralDialog` 等弹窗方法,传入参数 `useRootNavigator: false` 避免路由栈错误。

Expand All @@ -106,6 +114,8 @@ showDialog(
useRootNavigator: false); // <===== 非常重要
```

</s>

## 功能介绍

当前开源版 UME 内置了 10 个插件
Expand All @@ -128,6 +138,7 @@ showDialog(
</tr>
<tr>
<td width="33.33%" align="center"><img src="./screenshots/device_info.png" width="100%" alt="设备信息" /></br>设备信息</td>
<td width="33.33%" align="center"><img src="./screenshots/dio_inspector.png" width="100%" alt="Dio 网络请求调试工具" /></br>Dio 网络请求调试工具</td>
</tr>
</table>

Expand All @@ -141,7 +152,7 @@ showDialog(

``` yaml
dependencies:
flutter_ume: '>=0.1.0 <0.2.0'
flutter_ume: '>=0.2.0 <0.3.0'
```

3. 创建插件配置,实现 `Pluggable` 虚类
Expand Down Expand Up @@ -219,8 +230,8 @@ showDialog(

| UME 版本 | Flutter 1.12.13 | Flutter 1.22.3 | Flutter 2.0.1 | Flutter 2.2.3 |
| ---- | ---- | ---- | ---- | ---- |
| 0.1.0 | ✅ | ✅ | ✅ | ✅ |
| 0.2.0-dev.0 | ❌ | ❌ | ✅ | ✅ |
| 0.1.x | ✅ | ✅ | ✅ | ✅ |
| 0.2.x | ❌ | ❌ | ✅ | ✅ |

### 单测覆盖率

Expand All @@ -232,6 +243,7 @@ showDialog(
| flutter_ume_kit_show_code | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_show_code/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_show_code/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_show_code/coverage_badge.svg) |
| flutter_ume_kit_ui | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_ui/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_ui/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_ui/coverage_badge.svg) |
| flutter_ume_kit_console | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_console/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_console/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_console/coverage_badge.svg) |
| flutter_ume_kit_dio | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_dio/coverage_badge.svg) | N/A | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_dio/coverage_badge.svg) |

### 版本号规则

Expand All @@ -241,20 +253,29 @@ showDialog(

| 包 | null-safety 推荐版本号 |
| ---- | ---- |
| flutter_ume | 0.2.0-dev.0 |
| flutter_ume_kit_ui | 0.2.0-dev.0 |
| flutter_ume_kit_device | 0.2.0-dev.0 |
| flutter_ume_kit_perf | 0.2.0-dev.0 |
| flutter_ume_kit_show_code | 0.2.0-dev.0 |
| flutter_ume_kit_console | 0.2.0-dev.0 |
| flutter_ume | 0.2.1 |
| flutter_ume_kit_ui | 0.2.1 |
| flutter_ume_kit_device | 0.2.1 |
| flutter_ume_kit_perf | 0.2.1 |
| flutter_ume_kit_show_code | 0.2.1 |
| flutter_ume_kit_console | 0.2.1 |
| flutter_ume_kit_console | 0.2.0 |

### 更新日志

[Changelog](./CHANGELOG.md)

## 如何贡献
## 开源贡献

[Contributing](./CONTRIBUTING.md)
贡献文档:[Contributing](./CONTRIBUTING.md)

感谢以下贡献者(排名不分先后):

| | |
| ---- | ---- |
| ![ShirelyC](https://avatars.githubusercontent.com/u/11439167?s=64&v=4) | [ShirelyC](https://github.com/smileShirely) |
| ![lpylpyleo](https://avatars.githubusercontent.com/u/15264428?s=64&v=4) | [lpylpyleo](https://github.com/lpylpyleo) |
| ![Alex Li](https://avatars.githubusercontent.com/u/15884415?s=64&v=4) | [Alex Li](https://github.com/AlexV525) |

## 开源协议

Expand Down
63 changes: 42 additions & 21 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ UME is an in-app debug kits platform for Flutter apps.
Scan QR code or click link to download apk. Try it now!
https://github.com/bytedance/flutter_ume/releases/download/v0.1.0.4/app-debug.apk

There are 10 plugin kits built in the current open source version of UME.
There are 11 plugin kits built in the latest open source version of UME.
Developer could create custom plugin kits, and integrate them into UME.
Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more details.

Expand All @@ -26,7 +26,7 @@ Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more detai
- [Version upgrade rules](#version-upgrade-rules)
- [Null-safety](#null-safety)
- [Change log](#change-log)
- [How to contribute](#how-to-contribute)
- [Contributing](#contributing)
- [LICENSE](#license)
- [Contact the author](#contact-the-author)

Expand All @@ -36,12 +36,13 @@ Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more detai

``` yaml
dev_dependencies: # Don't use UME in release mode
flutter_ume: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume_kit_ui: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume_kit_device: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume_kit_perf: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume_kit_show_code: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume_kit_console: ^0.1.0 # null-safety version: ^0.2.0-dev.0
flutter_ume: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_ui: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_device: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_perf: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_show_code: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_console: ^0.1.1 # null-safety version: ^0.2.1
flutter_ume_kit_dio: ^0.2.0 # Only support null-safety
```
2. Run `flutter pub get`
Expand All @@ -54,6 +55,7 @@ Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more detai
import 'package:flutter_ume_kit_show_code/flutter_ume_kit_show_code.dart'; // Show Code
import 'package:flutter_ume_kit_device/flutter_ume_kit_device.dart'; // Device info
import 'package:flutter_ume_kit_console/flutter_ume_kit_console.dart'; // Show debugPrint
import 'package:flutter_ume_kit_dio/flutter_ume_kit_dio.dart'; // Dio Inspector
```

4. Edit main method of your app, register plugin kits and initial UME
Expand All @@ -71,7 +73,8 @@ Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more detai
..register(MemoryInfoPage())
..register(CpuInfoPage())
..register(DeviceInfoPanel())
..register(Console());
..register(Console())
..register(DioInspector(dio: dio)); // Pass in your Dio instance
runApp(injectUMEWidget(child: MyApp(), enable: true)); // Initial UME
} else {
runApp(MyApp());
Expand All @@ -89,6 +92,11 @@ Visit [Develop plugin kits for UME](#develop-plugin-kits-for-ume) for more detai

## IMPORTANT

**From `0.1.1`/`0.2.1` version,we don't need set `useRootNavigator: false`.**
The following section only applies to versions before version `0.1.1`/`0.2.1` .

<s>

Since UME manages the routing stack at the top level, methods such as `showDialog` use `rootNavigator` to pop up by default,
therefore **must** pass in the parameter `useRootNavigator: false` in `showDialog`, `showGeneralDialog` and other 'show dialog' methods to avoid navigator errors.

Expand All @@ -106,6 +114,8 @@ showDialog(
useRootNavigator: false); // <===== It's very IMPORTANT!
```

</s>

## Features

There are 10 plugin kits built in the current open source version of UME.
Expand All @@ -128,6 +138,7 @@ There are 10 plugin kits built in the current open source version of UME.
</tr>
<tr>
<td width="33.33%" align="center"><img src="./screenshots/device_info.png" width="100%" alt="Device Info" /></br>Device Info</td>
<td width="33.33%" align="center"><img src="./screenshots/dio_inspector.png" width="100%" alt="Dio Inspector" /></br>Dio Inspector</td>
</tr>
</table>

Expand All @@ -141,7 +152,7 @@ There are 10 plugin kits built in the current open source version of UME.

``` yaml
dependencies:
flutter_ume: '>=0.1.0 <0.2.0'
flutter_ume: '>=0.2.0 <0.3.0'
```

3. Create the class of the plugin kit which should implement `Pluggable`.
Expand Down Expand Up @@ -219,8 +230,8 @@ There are 10 plugin kits built in the current open source version of UME.

| UME version | Flutter 1.12.13 | Flutter 1.22.3 | Flutter 2.0.1 | Flutter 2.2.3 |
| ---- | ---- | ---- | ---- | ---- |
| 0.1.0 | ✅ | ✅ | ✅ | ✅ |
| 0.2.0-dev.0 | ❌ | ❌ | ✅ | ✅ |
| 0.1.x | ✅ | ✅ | ✅ | ✅ |
| 0.2.x | ❌ | ❌ | ✅ | ✅ |

### Coverage

Expand All @@ -232,29 +243,39 @@ There are 10 plugin kits built in the current open source version of UME.
| flutter_ume_kit_show_code | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_show_code/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_show_code/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_show_code/coverage_badge.svg) |
| flutter_ume_kit_ui | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_ui/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_ui/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_ui/coverage_badge.svg) |
| flutter_ume_kit_console | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_console/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop/kits/flutter_ume_kit_console/coverage_badge.svg) | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_console/coverage_badge.svg) |
| flutter_ume_kit_dio | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/master/kits/flutter_ume_kit_dio/coverage_badge.svg) | N/A | ![Coverage](https://raw.githubusercontent.com/bytedance/flutter_ume/develop_nullsafety/kits/flutter_ume_kit_dio/coverage_badge.svg) |

### Version upgrade rules

Please refer to [Semantic versions](https://dart.dev/tools/pub/versioning#semantic-versions) for details.

### Null-safety

| Package | null-safety version |
| Package | Suggest version |
| ---- | ---- |
| flutter_ume | 0.2.0-dev.0 |
| flutter_ume_kit_ui | 0.2.0-dev.0 |
| flutter_ume_kit_device | 0.2.0-dev.0 |
| flutter_ume_kit_perf | 0.2.0-dev.0 |
| flutter_ume_kit_show_code | 0.2.0-dev.0 |
| flutter_ume_kit_console | 0.2.0-dev.0 |
| flutter_ume | 0.2.1 |
| flutter_ume_kit_ui | 0.2.1 |
| flutter_ume_kit_device | 0.2.1 |
| flutter_ume_kit_perf | 0.2.1 |
| flutter_ume_kit_show_code | 0.2.1 |
| flutter_ume_kit_console | 0.2.1 |
| flutter_ume_kit_dio | 0.2.0 |

### Change log

[Changelog](./CHANGELOG_en.md)

## How to contribute
## Contributing

[Contributing](./CONTRIBUTING_en.md)
Contributing rules: [Contributing](./CONTRIBUTING_en.md)

Thanks to the following contributors (names not listed in order):

| | |
| ---- | ---- |
| ![ShirelyC](https://avatars.githubusercontent.com/u/11439167?s=64&v=4) | [ShirelyC](https://github.com/smileShirely) |
| ![lpylpyleo](https://avatars.githubusercontent.com/u/15264428?s=64&v=4) | [lpylpyleo](https://github.com/lpylpyleo) |
| ![Alex Li](https://avatars.githubusercontent.com/u/15884415?s=64&v=4) | [Alex Li](https://github.com/AlexV525) |

## LICENSE

Expand Down
Loading

0 comments on commit 6a294c0

Please sign in to comment.