|
|
|
@ -72,56 +72,60 @@ class _PairingViewState extends State<PairingView> |
|
|
|
return Scaffold( |
|
|
|
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|
|
|
body: SafeArea( |
|
|
|
child: _buildMainContent(isDarkMode), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
// 固定顶部区域 - 不受下方内容影响 |
|
|
|
_buildFixedTopSection(isDarkMode), |
|
|
|
|
|
|
|
// 可滚动的动态内容区域 |
|
|
|
Expanded( |
|
|
|
child: _buildDynamicContentSection(isDarkMode), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
// bottomNavigationBar: Opacity( |
|
|
|
// opacity: 0.5, |
|
|
|
// child: const CommonBottomNav(currentIndex: 0), |
|
|
|
// ), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// 主要内容 |
|
|
|
Widget _buildMainContent(bool isDarkMode) { |
|
|
|
return Container( |
|
|
|
width: double.infinity, |
|
|
|
height: MediaQuery.of(Get.context!).size.height, |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w), |
|
|
|
// 添加SingleChildScrollView以防止溢出 |
|
|
|
child: SingleChildScrollView( |
|
|
|
physics: const BouncingScrollPhysics(), |
|
|
|
child: ConstrainedBox( |
|
|
|
constraints: BoxConstraints( |
|
|
|
minHeight: |
|
|
|
MediaQuery.of(Get.context!).size.height - 100.h, // 减去底部导航和状态栏高度 |
|
|
|
), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
SizedBox(height: 20.h), // 顶部间距 |
|
|
|
|
|
|
|
// 标题部分 |
|
|
|
_buildHeader(isDarkMode), |
|
|
|
|
|
|
|
SizedBox(height: 20.h), |
|
|
|
// 固定顶部区域 |
|
|
|
Widget _buildFixedTopSection(bool isDarkMode) { |
|
|
|
return Padding( |
|
|
|
padding: EdgeInsets.only(top: 60.h, left: 24.w, right: 24.w), |
|
|
|
child: Column( |
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
children: [ |
|
|
|
// 标题部分 |
|
|
|
_buildHeader(isDarkMode), |
|
|
|
SizedBox(height: 20.h), |
|
|
|
|
|
|
|
// 设备动画 - 根据状态显示不同动画 |
|
|
|
_buildDeviceAnimation(isDarkMode), |
|
|
|
_buildDeviceAnimation(isDarkMode), |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
SizedBox(height: 20.h), |
|
|
|
// 动态内容区域 |
|
|
|
Widget _buildDynamicContentSection(bool isDarkMode) { |
|
|
|
return SingleChildScrollView( |
|
|
|
physics: const BouncingScrollPhysics(), |
|
|
|
child: Padding( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
SizedBox(height: 30.h), |
|
|
|
|
|
|
|
// 状态信息 |
|
|
|
_buildStatusInfo(isDarkMode), |
|
|
|
// 状态信息 |
|
|
|
_buildStatusInfo(isDarkMode), |
|
|
|
|
|
|
|
SizedBox(height: 40.h), |
|
|
|
SizedBox(height: 40.h), |
|
|
|
|
|
|
|
// 底部按钮 |
|
|
|
_buildActionButtons(isDarkMode), |
|
|
|
// 底部按钮 |
|
|
|
_buildActionButtons(isDarkMode), |
|
|
|
|
|
|
|
SizedBox(height: 20.h), |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 20.h), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
|