mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-13 11:53:41 +00:00
feat: add MCP support (#1471)
This commit is contained in:
83 files changed
+3119
-363
No files matched your search
File diff suppressed because it is too large.
Load diff
+8
-2
@@ -64,8 +64,14 @@ class DownloadCategoriesControl extends StatelessWidget {
|
||||
child: shad.SecondaryButton(
|
||||
key: const ValueKey('add-download-category'),
|
||||
onPressed: onAdd,
|
||||
leading: const Icon(Icons.add, size: 17),
|
||||
child: Text(context.l10n.add),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.add, size: 17),
|
||||
const SizedBox(width: AppDesignTokens.space8),
|
||||
Text(context.l10n.add),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,10 +5,19 @@ import '../../../../shared/theme/app_design_tokens.dart';
|
||||
import '../../../../shared/theme/app_palette.dart';
|
||||
|
||||
class SettingsItem extends StatelessWidget {
|
||||
const SettingsItem({super.key, required this.title, required this.child, this.subtitle});
|
||||
const SettingsItem({
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.child,
|
||||
this.subtitle,
|
||||
this.subtitleAction,
|
||||
this.titleTrailing,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
final Widget? subtitleAction;
|
||||
final Widget? titleTrailing;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
@@ -29,7 +38,12 @@ class SettingsItem extends StatelessWidget {
|
||||
children: [
|
||||
const SizedBox(width: leadingSpace),
|
||||
Expanded(
|
||||
child: _SettingsItemLabel(title: title, subtitle: subtitle),
|
||||
child: _SettingsItemLabel(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
subtitleAction: subtitleAction,
|
||||
titleTrailing: titleTrailing,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: columnGap),
|
||||
ConstrainedBox(
|
||||
@@ -45,7 +59,12 @@ class SettingsItem extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_SettingsItemLabel(title: title, subtitle: subtitle),
|
||||
_SettingsItemLabel(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
subtitleAction: subtitleAction,
|
||||
titleTrailing: titleTrailing,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Align(alignment: Alignment.centerLeft, child: child),
|
||||
],
|
||||
@@ -54,10 +73,12 @@ class SettingsItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _SettingsItemLabel extends StatelessWidget {
|
||||
const _SettingsItemLabel({required this.title, this.subtitle});
|
||||
const _SettingsItemLabel({required this.title, this.subtitle, this.subtitleAction, this.titleTrailing});
|
||||
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
final Widget? subtitleAction;
|
||||
final Widget? titleTrailing;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -66,13 +87,30 @@ class _SettingsItemLabel extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(color: palette.textPrimary, fontSize: 13, fontWeight: FontWeight.w700),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(color: palette.textPrimary, fontSize: 13, fontWeight: FontWeight.w700),
|
||||
),
|
||||
),
|
||||
if (titleTrailing != null) ...[const SizedBox(width: 5), titleTrailing!],
|
||||
],
|
||||
),
|
||||
if (subtitleText != null && subtitleText.isNotEmpty) ...[
|
||||
const SizedBox(height: 4),
|
||||
Text(subtitleText, style: TextStyle(color: palette.textSecondary, fontSize: 12, height: 1.3)),
|
||||
Wrap(
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 6,
|
||||
runSpacing: 2,
|
||||
children: [
|
||||
Text(subtitleText, style: TextStyle(color: palette.textSecondary, fontSize: 12, height: 1.3)),
|
||||
?subtitleAction,
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
@@ -99,8 +99,14 @@ class SettingsListEditor extends StatelessWidget {
|
||||
child: shad.SecondaryButton(
|
||||
key: addButtonKey,
|
||||
onPressed: onAdd,
|
||||
leading: const Icon(Icons.add, size: 17),
|
||||
child: Text(addLabel ?? context.l10n.add),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.add, size: 17),
|
||||
const SizedBox(width: AppDesignTokens.space8),
|
||||
Text(addLabel ?? context.l10n.add),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -280,8 +286,16 @@ Future<GithubMirrorDraft?> showGithubMirrorDialog(BuildContext context, {GithubM
|
||||
for (final type in GithubMirrorType.values)
|
||||
shad.SecondaryButton(
|
||||
onPressed: () => setDialogState(() => selectedType = type),
|
||||
leading: selectedType == type ? const Icon(Icons.check, size: 15) : null,
|
||||
child: Text(type.name),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (selectedType == type) ...[
|
||||
const Icon(Icons.check, size: 15),
|
||||
const SizedBox(width: AppDesignTokens.space8),
|
||||
],
|
||||
Text(type.name),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user