|
|
@ -173,7 +173,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
// 设备图标 |
|
|
// 设备图标 |
|
|
Widget _buildDeviceIcon(bool isDarkMode) { |
|
|
Widget _buildDeviceIcon(bool isDarkMode) { |
|
|
return Container( |
|
|
return Container( |
|
|
padding: EdgeInsets.all(16.w), |
|
|
padding: EdgeInsets.all(6.w), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: isDarkMode |
|
|
color: isDarkMode |
|
|
? Colors.white.withValues(alpha: 0.05) |
|
|
? Colors.white.withValues(alpha: 0.05) |
|
|
@ -191,46 +191,52 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
final imagePath = controller.lastConnectedDeviceImage; |
|
|
final imagePath = controller.lastConnectedDeviceImage; |
|
|
|
|
|
|
|
|
if (imagePath == null || imagePath.isEmpty) { |
|
|
if (imagePath == null || imagePath.isEmpty) { |
|
|
return Image.asset( |
|
|
return ClipRRect( |
|
|
isDarkMode |
|
|
borderRadius: BorderRadius.circular(12.r), |
|
|
? 'assets/images/headphone_new3.png' |
|
|
child: SizedBox( |
|
|
: 'assets/images/headphone_new4.png', |
|
|
width: 120.h, |
|
|
height: 100.h, |
|
|
height: 120.h, |
|
|
fit: BoxFit.contain, |
|
|
child: Image.asset( |
|
|
|
|
|
'assets/images/defaultPicture.jpg', |
|
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 网络图片 |
|
|
// 网络图片(正方形裁剪) |
|
|
return Image.network( |
|
|
return ClipRRect( |
|
|
imagePath, |
|
|
borderRadius: BorderRadius.circular(16.r), |
|
|
height: 100.h, |
|
|
child: SizedBox( |
|
|
fit: BoxFit.contain, |
|
|
width: 100.h, |
|
|
loadingBuilder: (context, child, loadingProgress) { |
|
|
height: 100.h, |
|
|
if (loadingProgress == null) return child; |
|
|
child: Image.network( |
|
|
return SizedBox( |
|
|
imagePath, |
|
|
height: 100.h, |
|
|
fit: BoxFit.cover, |
|
|
child: Center( |
|
|
loadingBuilder: (context, child, loadingProgress) { |
|
|
child: CircularProgressIndicator( |
|
|
if (loadingProgress == null) return child; |
|
|
value: loadingProgress.expectedTotalBytes != null |
|
|
return SizedBox( |
|
|
? loadingProgress.cumulativeBytesLoaded / |
|
|
height: 100.h, |
|
|
loadingProgress.expectedTotalBytes! |
|
|
child: Center( |
|
|
: null, |
|
|
child: CircularProgressIndicator( |
|
|
strokeWidth: 2, |
|
|
value: loadingProgress.expectedTotalBytes != null |
|
|
color: isDarkMode ? Colors.white : Colors.blue, |
|
|
? loadingProgress.cumulativeBytesLoaded / |
|
|
), |
|
|
loadingProgress.expectedTotalBytes! |
|
|
), |
|
|
: null, |
|
|
); |
|
|
strokeWidth: 2, |
|
|
}, |
|
|
color: isDarkMode ? Colors.white : Colors.blue, |
|
|
errorBuilder: (context, error, stackTrace) { |
|
|
), |
|
|
// 网络图片加载失败时使用默认图片 |
|
|
), |
|
|
return Image.asset( |
|
|
); |
|
|
isDarkMode |
|
|
}, |
|
|
? 'assets/images/headphone_new3.png' |
|
|
errorBuilder: (context, error, stackTrace) { |
|
|
: 'assets/images/headphone_new4.png', |
|
|
return Image.asset( |
|
|
height: 100.h, |
|
|
'assets/images/defaultPicture.jpg', |
|
|
fit: BoxFit.contain, |
|
|
fit: BoxFit.cover, |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
), |
|
|
), |
|
|
|