Skip to content

Commit

Permalink
git tag v1.0.0+9
Browse files Browse the repository at this point in the history
  • Loading branch information
matteriot committed Jan 5, 2024
1 parent 149cf72 commit 3a0035d
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.0+9]

*fix url as Uri

## [1.0.0+8]

* update grpc
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/mdnsService/devices/local/dht.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class _DHTPageState extends State<DHTPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/status";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -189,7 +189,7 @@ class _DHTPageState extends State<DHTPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2))
.then((_) {
setState(() {
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/mdnsService/devices/local/lightLevel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _LightLevelPageState extends State<LightLevelPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/status";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -183,7 +183,7 @@ class _LightLevelPageState extends State<LightLevelPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2))
.then((_) {
setState(() {
Expand Down
6 changes: 3 additions & 3 deletions lib/plugins/mdnsService/devices/local/oneKeySwitch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _OneKeySwitchPageState extends State<OneKeySwitchPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/status";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -128,7 +128,7 @@ class _OneKeySwitchPageState extends State<OneKeySwitchPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2));
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -160,7 +160,7 @@ class _OneKeySwitchPageState extends State<OneKeySwitchPage> {
"http://${widget.device.ip}:${widget.device.port}/led?status=${ledBottonStatus == "on" ? "off" : "on"}";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down
6 changes: 3 additions & 3 deletions lib/plugins/mdnsService/devices/local/phicommDC1Plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class _PhicommDC1PluginPageState extends State<PhicommDC1PluginPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/status";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -254,7 +254,7 @@ class _PhicommDC1PluginPageState extends State<PhicommDC1PluginPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2))
.then((_) {
setState(() {
Expand Down Expand Up @@ -316,7 +316,7 @@ class _PhicommDC1PluginPageState extends State<PhicommDC1PluginPage> {
}
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down
12 changes: 6 additions & 6 deletions lib/plugins/mdnsService/devices/local/phicommR1Controler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
"http://${widget.device.ip}:${widget.device.port}/input-keyevent?key=$key";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down Expand Up @@ -588,7 +588,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
child: Text("确认"),
onPressed: () async {
response = await http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2));
print(response.body);
Navigator.of(context).pop();
Expand Down Expand Up @@ -766,7 +766,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
"http://${widget.device.ip}:${widget.device.port}/do-cmd?cmd=$cmd";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
showToast(response.body);
} catch (e) {
print(e.toString());
Expand All @@ -779,7 +779,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
"http://${widget.device.ip}:${widget.device.port}/do-adb-cmd?cmd=$cmd";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
showToast(response.body);
} catch (e) {
print(e.toString());
Expand All @@ -792,7 +792,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
"http://${widget.device.ip}:${widget.device.port}/do-cmd?cmd=settings get global bluetooth_on";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
showToast(response.body);
Map<String, dynamic> body = jsonDecode(response.body);
showToast(body['result'].toString());
Expand All @@ -807,7 +807,7 @@ class _PhicommR1ControlerPageState extends State<PhicommR1ControlerPage> {
"http://${widget.device.ip}:${widget.device.port}/list-packages";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 7));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 7));
// Fluttertoast.showToast(msg: response.body);
Map<String, dynamic> body = jsonDecode(response.body);
setState(() {
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/mdnsService/devices/local/phicommTC1A1Plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class _PhicommTC1A1PluginPageState extends State<PhicommTC1A1PluginPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/status";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 6));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 6));
} catch (e) {
print(e.toString());
return;
Expand Down Expand Up @@ -190,7 +190,7 @@ class _PhicommTC1A1PluginPageState extends State<PhicommTC1A1PluginPage> {
"http://${widget.device.ip}:${widget.device.port}/switch?$slot0=${_status[slot0] ? 1 : 0}&$slot1=${_status[slot1] ? 1 : 0}&$slot2=${_status[slot2] ? 1 : 0}&$slot3=${_status[slot3] ? 1 : 0}&$slot4=${_status[slot4] ? 1 : 0}&$slot5=${_status[slot5] ? 1 : 0}";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down
10 changes: 5 additions & 5 deletions lib/plugins/mdnsService/devices/local/rgbaLed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class _RGBALedPageState extends State<RGBALedPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2))
.then((_) {
setState(() {
Expand Down Expand Up @@ -288,7 +288,7 @@ class _RGBALedPageState extends State<RGBALedPage> {
url = "http://${widget.device.ip}:${widget.device.port}/set?b=0";
}
try {
await http.get(url as Uri).timeout(const Duration(seconds: 2));
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
setState(() {
_status[color] = Color.fromARGB(_status[color].alpha == 0 ? 255 : 0,
_status[color].red, _status[color].green, _status[color].blue);
Expand All @@ -307,7 +307,7 @@ class _RGBALedPageState extends State<RGBALedPage> {
try {
if (!_requsting) {
_requsting = true;
await http.get(url as Uri).timeout(const Duration(seconds: 2));
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
setState(() {
_status[color] = c;
});
Expand Down Expand Up @@ -337,7 +337,7 @@ class _RGBALedPageState extends State<RGBALedPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/set?m=${newValue.toString()}";
try {
await http.get(url as Uri).timeout(const Duration(seconds: 2));
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
setState(() {
_currentModes = newValue!;
});
Expand All @@ -351,7 +351,7 @@ class _RGBALedPageState extends State<RGBALedPage> {
String url =
"http://${widget.device.ip}:${widget.device.port}/set?s=${cmd}";
try {
await http.get(url as Uri).timeout(const Duration(seconds: 2));
await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
} catch (e) {
print(e.toString());
return;
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/mdnsService/devices/local/seial315433.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class _Serial315433PageState extends State<Serial315433Page> {
String url =
"http://${widget.device.ip}:${widget.device.port}/rename?name=${_name_controller.text}";
await http
.get(url as Uri)
.get(Uri.parse(url))
.timeout(const Duration(seconds: 2));
widget.device.info["name"] = _name_controller.text;
} catch (e) {
Expand Down Expand Up @@ -157,7 +157,7 @@ class _Serial315433PageState extends State<Serial315433Page> {
"http://${widget.device.ip}:${widget.device.port}/botton?status=$cmd";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
} catch (e) {
print(e.toString());
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/mdnsService/mDNSService/VNCRFBWebPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class VNCWebPageState extends State<VNCWebPage> {
}

_launchURL(String url) async {
if (await canLaunchUrl(url as Uri)) {
await launchUrl(url as Uri);
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else {
print('Could not launch $url');
}
Expand Down
6 changes: 3 additions & 3 deletions lib/plugins/mdnsService/mDNSService/onvifManager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class _OvifManagerPageState extends State<OvifManagerPage> {
String url = "http://${widget.device.ip}:${widget.device.port}/list";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
Map<String, dynamic> rst = jsonDecode(response.body);
if (rst["Code"] != 0) {
Expand Down Expand Up @@ -159,7 +159,7 @@ class _OvifManagerPageState extends State<OvifManagerPage> {
"http://${widget.device.ip}:${widget.device.port}/delete?XAddr=$XAddr";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
_getList();
} catch (e) {
Expand Down Expand Up @@ -243,7 +243,7 @@ class _OvifManagerPageState extends State<OvifManagerPage> {
"http://${widget.device.ip}:${widget.device.port}/add?Name=$Name&XAddr=$XAddr&UserName=$UserName&Password=$Password";
http.Response response;
try {
response = await http.get(url as Uri).timeout(const Duration(seconds: 2));
response = await http.get(Uri.parse(url)).timeout(const Duration(seconds: 2));
print(response.body);
_getList();
} catch (e) {
Expand Down
36 changes: 30 additions & 6 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,22 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.7"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "04be76c4a4bb50f14904e64749237e541e7c7bcf7ec0b196907322ab5d2fc739"
url: "https://pub.flutter-io.cn"
source: hosted
version: "9.0.16"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.5"
matcher:
dependency: transitive
description:
Expand All @@ -252,18 +268,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
version: "1.11.0"
mqtt5_client:
dependency: "direct main"
description:
Expand Down Expand Up @@ -589,14 +605,22 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.flutter-io.cn"
source: hosted
version: "13.0.0"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: edc8a9573dd8c5a83a183dae1af2b6fd4131377404706ca4e5420474784906fa
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
version: "0.4.0"
webview_flutter:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: openiothub_plugin
description: openiothub_plugin
version: 1.0.0+8
version: 1.0.0+9
homepage: https://github.com/OpenIoTHub

environment:
Expand Down

0 comments on commit 3a0035d

Please sign in to comment.