Skip to content

Commit

Permalink
chore: update device item style
Browse files Browse the repository at this point in the history
  • Loading branch information
lcp committed Apr 3, 2024
1 parent ad2bf65 commit 18a3313
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion lib/page/conversation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ class _SendMessageScreen extends State<SendMessageScreen> implements ISocketEven
reverse: true,
shrinkWrap: true,
itemBuilder: (context, index, animation) {
// 假设 index 为偶数是对面设备发送的消息,奇数是本机发送的消息
var message = messageList[index];
bool isOpponent = message.receiver == self?.uid;

Expand Down
28 changes: 14 additions & 14 deletions lib/page/deviceList.dart
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,28 @@ class _DeviceListScreen extends State<DeviceListScreen> implements ISocketEvent{
itemBuilder: (context, index) {
final deviceItem = devices[index];
return ListTile(
leading: Icon(deviceItem.platform.toLowerCase() == "android"? Icons.android_rounded:
deviceItem.platform.toLowerCase() == "macos"? Icons.laptop_mac_rounded:
deviceItem.platform.toLowerCase() == "ios"? Icons.apple_rounded:
deviceItem.platform.toLowerCase() == "windows"? Icons.laptop_windows_rounded: Icons.laptop_rounded,
size: 28,
color: deviceItem.uid == socketManager.receiver || deviceItem.around == true
? Colors.lightBlue
: Colors.grey), // Server 图标,
title: Text(deviceItem.name),
subtitle: Row(
children: [
Text(deviceItem.host),
SizedBox(
width: 4,
),
Icon(deviceItem.platform.toLowerCase() == "android"?Icons.android_rounded:
deviceItem.platform.toLowerCase() == "macos" || deviceItem.platform.toLowerCase() == "ios"? Icons.apple_rounded: Icons.laptop_windows_rounded,
size: 18,
color: deviceItem.uid == socketManager.receiver
? Colors.lightBlue
: Colors.grey), // Server 图标
// const SizedBox(width: 4,),
// Client 图标
if (deviceItem.around == true) SizedBox(width: 6,),
if (deviceItem.around == true) Icon(Icons.online_prediction_rounded, color: Colors.lightBlue,size: 18,)
// if (deviceItem.around == true) SizedBox(width: 6,),
// if (deviceItem.around == true) Icon(Icons.online_prediction_rounded, color: Colors.lightBlue,size: 18,)
],
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
IconButton(
if (deviceItem.uid == socketManager.receiver || device?.isServer == false && socketManager.receiver.isEmpty) IconButton(
icon: deviceItem.uid == socketManager.receiver
? Icon(
Icons.wifi_rounded,
Expand Down Expand Up @@ -639,7 +639,7 @@ class _SettingsScreen extends State<SettingsScreen> {
_buildSettingItem(
'本机名称 ${device?.name??""}',
const Icon(
Icons.verified_user,
Icons.verified_user_rounded,
color: CupertinoColors.systemGrey,
),
onTap: () {
Expand All @@ -663,7 +663,7 @@ class _SettingsScreen extends State<SettingsScreen> {
_buildSettingItem(
'服务端口 ${device?.port}',
const Icon(
Icons.verified_user,
Icons.wifi_tethering,
color: CupertinoColors.systemGrey,
),
onTap: () {
Expand Down

0 comments on commit 18a3313

Please sign in to comment.