|
|
|
@ -15,6 +15,7 @@ class TranslationMiddlewareView |
|
|
|
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|
|
|
|
|
|
|
return Scaffold( |
|
|
|
//primary: false, |
|
|
|
backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.grey[50], |
|
|
|
appBar: _buildAppBar(isDarkMode), |
|
|
|
body: _buildBody(isDarkMode), |
|
|
|
@ -49,29 +50,19 @@ class TranslationMiddlewareView |
|
|
|
/// 构建主体内容 |
|
|
|
Widget _buildBody(bool isDarkMode) { |
|
|
|
return SafeArea( |
|
|
|
child: Padding( |
|
|
|
padding: EdgeInsets.all(20.w), |
|
|
|
child: Column( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
// 翻译功能选项网格 |
|
|
|
Expanded( |
|
|
|
child: _buildTranslationOptionsGrid(isDarkMode), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
child: _buildTranslationOptionsGrid(isDarkMode), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 构建翻译选项网格 |
|
|
|
Widget _buildTranslationOptionsGrid(bool isDarkMode) { |
|
|
|
return GridView.builder( |
|
|
|
padding: EdgeInsets.all(20.w), // 将内边距应用于网格内容 |
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( |
|
|
|
crossAxisCount: 2, |
|
|
|
crossAxisSpacing: 16.w, |
|
|
|
mainAxisSpacing: 16.h, |
|
|
|
childAspectRatio: 0.85, |
|
|
|
childAspectRatio: 1, |
|
|
|
), |
|
|
|
itemCount: controller.translationOptions.length, |
|
|
|
itemBuilder: (context, index) { |
|
|
|
@ -120,9 +111,9 @@ class TranslationMiddlewareView |
|
|
|
], |
|
|
|
), |
|
|
|
child: Padding( |
|
|
|
padding: EdgeInsets.all(20.w), |
|
|
|
padding: EdgeInsets.fromLTRB(20.w, 28.h, 20.w, 20.h), |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
// 图标 |
|
|
|
Container( |
|
|
|
@ -138,7 +129,8 @@ class TranslationMiddlewareView |
|
|
|
color: option.iconColor.withOpacity(isEnabled ? 1.0 : 0.5), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
|
|
|
|
const Spacer(), |
|
|
|
|
|
|
|
// 标题 |
|
|
|
Text( |
|
|
|
|