Skip to content

Commit

Permalink
commit code
Browse files Browse the repository at this point in the history
  • Loading branch information
mengyanshou committed Aug 25, 2021
1 parent 5ea2047 commit 69ad7be
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 283 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 1.1.3
- 优化扫码页面

- 整体UI调整
- 修复各种连接失败的问题
- adb切换为自编译版本
## 1.1.2
- 修复缺少adb的问题

Expand Down
Binary file removed assets/app-release.apk
Binary file not shown.
Binary file added assets/server.jar
Binary file not shown.
202 changes: 96 additions & 106 deletions lib/app/modules/online_devices/views/online_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,124 +22,114 @@ class OnlineView extends GetView<OnlineController> {
),
);
}
return Container(
decoration: BoxDecoration(
color: AppColors.background,
borderRadius: BorderRadius.circular(12.w),
border: Border.all(
color: Colors.grey.withOpacity(0.2),
width: 1.w,
),
),
child: SizedBox(
height: controller.list.length * 48.w,
child: ListView.builder(
itemCount: controller.list.length,
padding: EdgeInsets.zero,
itemBuilder: (c, i) {
final DeviceEntity entity = controller.list[i];
return InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(Dimens.gap_dp8),
child: SizedBox(
height: Dimens.gap_dp48,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.deepPurple,
),
margin: EdgeInsets.only(
left: Dimens.gap_dp8,
),
height: Dimens.gap_dp6,
width: Dimens.gap_dp6,
return SizedBox(
height: controller.list.length * 48.w,
child: ListView.builder(
itemCount: controller.list.length,
padding: EdgeInsets.zero,
itemBuilder: (c, i) {
final DeviceEntity entity = controller.list[i];
return InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(Dimens.gap_dp8),
child: SizedBox(
height: Dimens.gap_dp48,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.deepPurple,
),
SizedBox(
width: Dimens.gap_dp8,
margin: EdgeInsets.only(
left: Dimens.gap_dp8,
),
Text(
' ${entity.address}',
style: const TextStyle(
fontWeight: FontWeight.bold,
),
height: Dimens.gap_dp6,
width: Dimens.gap_dp6,
),
SizedBox(
width: Dimens.gap_dp8,
),
Text(
' ${entity.address}',
style: const TextStyle(
fontWeight: FontWeight.bold,
),
Text(
'(${entity.unique})',
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
),
),
Text(
'(${entity.unique})',
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.grey,
),
],
),
),
],
),
Row(
children: [
IconButton(
tooltip: '让对方设备连接我',
icon: Transform(
alignment: Alignment.center,
transform: Matrix4.identity(),
child: const Icon(
Icons.wifi_tethering,
),
Row(
children: [
IconButton(
tooltip: '让对方设备连接我',
icon: Transform(
alignment: Alignment.center,
transform: Matrix4.identity(),
child: const Icon(
Icons.wifi_tethering,
color: Colors.black54,
),
),
onPressed: () async {
showToast('发送请求成功');
Dio().get<void>(
'http://${entity.address}:$adbToolQrPort',
);
},
),
SizedBox(
width: Dimens.gap_dp16,
),
Material(
color: Colors.transparent,
child: IconButton(
splashRadius: 40,
tooltip: '尝试连接这个设备',
icon: Center(
child: SvgPicture.asset(
GlobalAssets.connect,
color: Colors.black54,
width: 20,
),
),
onPressed: () async {
showToast('发送请求成功');
Dio().get<void>(
'http://${entity.address}:$adbToolQrPort',
);
AdbUtil.startPoolingListDevices();
AdbResult result;
try {
result = await AdbUtil.connectDevices(
entity.address,
);
showToast(result.message);
} on AdbException catch (e) {
showToast(e.message);
}
},
),
SizedBox(
width: Dimens.gap_dp16,
),
Material(
color: Colors.transparent,
child: IconButton(
splashRadius: 40,
tooltip: '尝试连接这个设备',
icon: Center(
child: SvgPicture.asset(
GlobalAssets.connect,
color: Colors.black54,
width: 20,
),
),
onPressed: () async {
AdbUtil.startPoolingListDevices();
AdbResult result;
try {
result = await AdbUtil.connectDevices(
entity.address,
);
showToast(result.message);
} on AdbException catch (e) {
showToast(e.message);
}
},
),
),
SizedBox(
width: Dimens.gap_dp8,
),
],
),
],
),
),
SizedBox(
width: Dimens.gap_dp8,
),
],
),
],
),
);
},
),
),
);
},
),
);
});
Expand Down
Loading

0 comments on commit 69ad7be

Please sign in to comment.