fix: adjust board dark mode UI

This commit is contained in:
appflowy 2022-09-07 20:52:25 +08:00
parent c5963bc765
commit 8632b141ad
2 changed files with 37 additions and 24 deletions

View File

@ -9,6 +9,7 @@ import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart'; import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart';
import 'package:app_flowy/plugins/grid/presentation/widgets/cell/cell_builder.dart'; import 'package:app_flowy/plugins/grid/presentation/widgets/cell/cell_builder.dart';
import 'package:app_flowy/plugins/grid/presentation/widgets/row/row_detail.dart'; import 'package:app_flowy/plugins/grid/presentation/widgets/row/row_detail.dart';
import 'package:app_flowy/workspace/application/appearance.dart';
import 'package:appflowy_board/appflowy_board.dart'; import 'package:appflowy_board/appflowy_board.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
@ -21,6 +22,7 @@ import 'package:flowy_sdk/protobuf/flowy-grid/block_entities.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.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';
import 'package:provider/provider.dart';
import '../../grid/application/row/row_cache.dart'; import '../../grid/application/row/row_cache.dart';
import '../application/board_bloc.dart'; import '../application/board_bloc.dart';
import 'card/card.dart'; import 'card/card.dart';
@ -88,34 +90,37 @@ class _BoardContentState extends State<BoardContent> {
children: [const _ToolbarBlocAdaptor(), _buildBoard(context)], children: [const _ToolbarBlocAdaptor(), _buildBoard(context)],
); );
return Container( return Padding(
color: context.read<AppTheme>().surface, padding: const EdgeInsets.symmetric(horizontal: 20),
child: Padding( child: column,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: column,
),
); );
}, },
), ),
); );
} }
Expanded _buildBoard(BuildContext context) { Widget _buildBoard(BuildContext context) {
return Expanded( return ChangeNotifierProvider.value(
child: AppFlowyBoard( value: Provider.of<AppearanceSettingModel>(context, listen: true),
boardScrollController: scrollManager, child: Selector<AppearanceSettingModel, AppTheme>(
scrollController: ScrollController(), selector: (ctx, notifier) => notifier.theme,
controller: context.read<BoardBloc>().boardController, builder: (ctx, theme, child) => Expanded(
headerBuilder: _buildHeader, child: AppFlowyBoard(
footerBuilder: _buildFooter, boardScrollController: scrollManager,
cardBuilder: (_, column, columnItem) => _buildCard( scrollController: ScrollController(),
context, controller: context.read<BoardBloc>().boardController,
column, headerBuilder: _buildHeader,
columnItem, footerBuilder: _buildFooter,
), cardBuilder: (_, column, columnItem) => _buildCard(
groupConstraints: const BoxConstraints.tightFor(width: 300), context,
config: AppFlowyBoardConfig( column,
groupBackgroundColor: HexColor.fromHex('#F7F8FC'), columnItem,
),
groupConstraints: const BoxConstraints.tightFor(width: 300),
config: AppFlowyBoardConfig(
groupBackgroundColor: theme.bg1,
),
),
), ),
), ),
); );
@ -320,7 +325,15 @@ class _ToolbarBlocAdaptor extends StatelessWidget {
fieldController: bloc.fieldController, fieldController: bloc.fieldController,
); );
return BoardToolbar(toolbarContext: toolbarContext); return ChangeNotifierProvider.value(
value: Provider.of<AppearanceSettingModel>(context, listen: true),
child: Selector<AppearanceSettingModel, AppTheme>(
selector: (ctx, notifier) => notifier.theme,
builder: (ctx, theme, child) {
return BoardToolbar(toolbarContext: toolbarContext);
},
),
);
}, },
); );
} }

View File

@ -56,7 +56,7 @@ class _SettingButton extends StatelessWidget {
onPressed: () {}, onPressed: () {},
icon: Padding( icon: Padding(
padding: const EdgeInsets.symmetric(vertical: 3.0, horizontal: 3.0), padding: const EdgeInsets.symmetric(vertical: 3.0, horizontal: 3.0),
child: svgWidget("grid/setting/setting"), child: svgWidget("grid/setting/setting", color: theme.iconColor),
), ),
), ),
popupBuilder: (BuildContext popoverContext) { popupBuilder: (BuildContext popoverContext) {