chore: adjust UI

This commit is contained in:
Nathan 2025-03-19 10:48:30 +08:00
parent f0d967f0e4
commit 72b13dd941
2 changed files with 14 additions and 36 deletions

View File

@ -45,7 +45,7 @@ class LocalAISetting extends StatelessWidget {
collapsed: const SizedBox.shrink(), collapsed: const SizedBox.shrink(),
expanded: Column( expanded: Column(
children: [ children: [
const VSpace(6), const VSpace(12),
DecoratedBox( DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: color:

View File

@ -1,6 +1,5 @@
import 'package:appflowy/workspace/application/settings/ai/local_ai_setting_panel_bloc.dart'; import 'package:appflowy/workspace/application/settings/ai/local_ai_setting_panel_bloc.dart';
import 'package:appflowy/workspace/presentation/settings/pages/setting_ai_view/ollma_setting.dart'; import 'package:appflowy/workspace/presentation/settings/pages/setting_ai_view/ollma_setting.dart';
import 'package:expandable/expandable.dart';
import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
@ -13,42 +12,21 @@ class LocalAISettingPanel extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (context) => LocalAISettingPanelBloc(), create: (context) => LocalAISettingPanelBloc(),
child: ExpandableNotifier( child: Padding(
initialExpanded: true,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: false,
hasIcon: false,
tapBodyToExpand: false,
tapHeaderToExpand: false,
),
header: const SizedBox.shrink(),
collapsed: const SizedBox.shrink(),
expanded: Padding(
padding: const EdgeInsets.symmetric(vertical: 6), padding: const EdgeInsets.symmetric(vertical: 6),
child: child: BlocBuilder<LocalAISettingPanelBloc, LocalAISettingPanelState>(
BlocBuilder<LocalAISettingPanelBloc, LocalAISettingPanelState>(
builder: (context, state) { builder: (context, state) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// If the progress indicator is startLocalAIApp, then don't show the LLM model.
if (state.progressIndicator ==
const LocalAIProgress.downloadLocalAIApp())
const SizedBox.shrink()
else ...[
OllamaSettingPage(), OllamaSettingPage(),
VSpace(6), VSpace(6),
PluginStateIndicator(), PluginStateIndicator(),
], ],
],
); );
}, },
), ),
), ),
),
),
); );
} }
} }