重整多余的UI组件和未定功能的逻辑链路的修正
This commit is contained in:
@@ -6,7 +6,9 @@ import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
|
||||
/// 帮助与反馈页面
|
||||
class HelpFeedbackPage extends StatefulWidget {
|
||||
const HelpFeedbackPage({super.key});
|
||||
const HelpFeedbackPage({super.key, this.faqOnly = false});
|
||||
|
||||
final bool faqOnly;
|
||||
|
||||
@override
|
||||
State<HelpFeedbackPage> createState() => _HelpFeedbackPageState();
|
||||
@@ -81,6 +83,7 @@ class _HelpFeedbackPageState extends State<HelpFeedbackPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context);
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
@@ -95,7 +98,9 @@ class _HelpFeedbackPageState extends State<HelpFeedbackPage>
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
title: Text(
|
||||
AppLocalizations.of(context).translate('my_v2.help_feedback'),
|
||||
l10n.translate(
|
||||
widget.faqOnly ? 'help_feedback.tab_faq' : 'my_v2.help_feedback',
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -103,25 +108,26 @@ class _HelpFeedbackPageState extends State<HelpFeedbackPage>
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
bottom: TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: const Color(0xFF165DFF),
|
||||
unselectedLabelColor: context.appColors.textTertiary,
|
||||
indicatorColor: const Color(0xFF165DFF),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
tabs: [
|
||||
Tab(text: AppLocalizations.of(context).translate('help_feedback.tab_faq')),
|
||||
Tab(text: AppLocalizations.of(context).translate('help_feedback.tab_feedback')),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [
|
||||
_buildFAQTab(),
|
||||
_buildFeedbackTab(),
|
||||
],
|
||||
bottom: widget.faqOnly
|
||||
? null
|
||||
: TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: const Color(0xFF165DFF),
|
||||
unselectedLabelColor: context.appColors.textTertiary,
|
||||
indicatorColor: const Color(0xFF165DFF),
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
tabs: [
|
||||
Tab(text: l10n.translate('help_feedback.tab_faq')),
|
||||
Tab(text: l10n.translate('help_feedback.tab_feedback')),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: widget.faqOnly
|
||||
? _buildFAQTab()
|
||||
: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [_buildFAQTab(), _buildFeedbackTab()],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -129,12 +135,17 @@ class _HelpFeedbackPageState extends State<HelpFeedbackPage>
|
||||
// ==================== 常见问题 ====================
|
||||
|
||||
Widget _buildFAQTab() {
|
||||
const guideCategories = {'cat_bind', 'cat_path', 'cat_remote'};
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
..._faqList.map((category) => _buildFAQCategory(category)),
|
||||
const SizedBox(height: 20),
|
||||
_buildContactSection(),
|
||||
for (final category in _faqList)
|
||||
if (!widget.faqOnly || guideCategories.contains(category['category']))
|
||||
_buildFAQCategory(category),
|
||||
if (!widget.faqOnly) ...[
|
||||
const SizedBox(height: 20),
|
||||
_buildContactSection(),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user