From 9e090b01836ab160ed22954be6ac026d3f8c446e Mon Sep 17 00:00:00 2001 From: appflowy Date: Tue, 9 Aug 2022 11:59:22 +0800 Subject: [PATCH] chore: fix typo: pannel -> panel --- .../cell/cell_service/context_builder.dart | 35 +++++++++++----- .../{grid_listenr.dart => grid_listener.dart} | 0 .../grid/application/grid_service.dart | 10 ++--- .../widgets/cell/cell_cotainer.dart | 1 - .../app_flowy/lib/startup/deps_resolver.dart | 4 +- .../edit_context.dart | 5 ++- .../edit_panel/edit_panel_bloc.dart | 41 +++++++++++++++++++ .../edit_pannel/edit_pannel_bloc.dart | 41 ------------------- .../workspace/application/home/home_bloc.dart | 38 +++++++++-------- .../presentation/home/home_layout.dart | 13 +++--- .../presentation/home/home_screen.dart | 38 ++++++++--------- .../presentation/home/home_sizes.dart | 4 +- .../edit_panel.dart} | 26 ++++++------ .../panel_animation.dart} | 0 14 files changed, 138 insertions(+), 118 deletions(-) rename frontend/app_flowy/lib/plugins/grid/application/field/{grid_listenr.dart => grid_listener.dart} (100%) rename frontend/app_flowy/lib/workspace/application/{edit_pannel => edit_panel}/edit_context.dart (57%) create mode 100644 frontend/app_flowy/lib/workspace/application/edit_panel/edit_panel_bloc.dart delete mode 100644 frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.dart rename frontend/app_flowy/lib/workspace/presentation/widgets/{edit_pannel/edit_pannel.dart => edit_panel/edit_panel.dart} (66%) rename frontend/app_flowy/lib/workspace/presentation/widgets/{edit_pannel/pannel_animation.dart => edit_panel/panel_animation.dart} (100%) diff --git a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart index 48e88e56ac..8f78793a2c 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/cell/cell_service/context_builder.dart @@ -1,8 +1,10 @@ part of 'cell_service.dart'; typedef GridCellController = IGridCellController; -typedef GridSelectOptionCellController = IGridCellController; -typedef GridDateCellController = IGridCellController; +typedef GridSelectOptionCellController + = IGridCellController; +typedef GridDateCellController + = IGridCellController; typedef GridURLCellController = IGridCellController; class GridCellControllerBuilder { @@ -19,7 +21,8 @@ class GridCellControllerBuilder { _cellId = cellId; IGridCellController build() { - final cellFieldNotifier = GridCellFieldNotifier(notifier: _GridFieldChangedNotifierImpl(_fieldCache)); + final cellFieldNotifier = GridCellFieldNotifier( + notifier: _GridFieldChangedNotifierImpl(_fieldCache)); switch (_cellId.fieldType) { case FieldType.Checkbox: @@ -142,8 +145,10 @@ class IGridCellController extends Equatable { _cellDataLoader = cellDataLoader, _cellDataPersistence = cellDataPersistence, _fieldNotifier = fieldNotifier, - _fieldService = FieldService(gridId: cellId.gridId, fieldId: cellId.field.id), - _cacheKey = GridCellCacheKey(rowId: cellId.rowId, fieldId: cellId.field.id); + _fieldService = + FieldService(gridId: cellId.gridId, fieldId: cellId.field.id), + _cacheKey = + GridCellCacheKey(rowId: cellId.rowId, fieldId: cellId.field.id); IGridCellController clone() { return IGridCellController( @@ -164,7 +169,9 @@ class IGridCellController extends Equatable { FieldType get fieldType => cellId.field.fieldType; - VoidCallback? startListening({required void Function(T?) onCellChanged, VoidCallback? onCellFieldChanged}) { + VoidCallback? startListening( + {required void Function(T?) onCellChanged, + VoidCallback? onCellFieldChanged}) { if (isListening) { Log.error("Already started. It seems like you should call clone first"); return null; @@ -226,8 +233,11 @@ class IGridCellController extends Equatable { /// Return the FieldTypeOptionDataPB that can be parsed into corresponding class using the [parser]. /// [PD] is the type that the parser return. - Future> getFieldTypeOption(P parser) { - return _fieldService.getFieldTypeOptionData(fieldType: fieldType).then((result) { + Future> + getFieldTypeOption(P parser) { + return _fieldService + .getFieldTypeOptionData(fieldType: fieldType) + .then((result) { return result.fold( (data) => parser.fromBuffer(data.typeOptionData), (err) => right(err), @@ -239,7 +249,9 @@ class IGridCellController extends Equatable { /// You can set [dedeplicate] to true (default is false) to reduce the save operation. /// It's useful when you call this method when user editing the [TextField]. /// The default debounce interval is 300 milliseconds. - void saveCellData(D data, {bool deduplicate = false, void Function(Option)? resultCallback}) async { + void saveCellData(D data, + {bool deduplicate = false, + void Function(Option)? resultCallback}) async { if (deduplicate) { _loadDataOperation?.cancel(); @@ -288,7 +300,8 @@ class IGridCellController extends Equatable { } @override - List get props => [_cellsCache.get(_cacheKey) ?? "", cellId.rowId + cellId.field.id]; + List get props => + [_cellsCache.get(_cacheKey) ?? "", cellId.rowId + cellId.field.id]; } class _GridFieldChangedNotifierImpl extends GridFieldChangedNotifier { @@ -300,7 +313,7 @@ class _GridFieldChangedNotifierImpl extends GridFieldChangedNotifier { @override void dispose() { if (_onChangesetFn != null) { - _cache.removeListener(onChangsetListener: _onChangesetFn!); + _cache.removeListener(onChangesetListener: _onChangesetFn!); _onChangesetFn = null; } } diff --git a/frontend/app_flowy/lib/plugins/grid/application/field/grid_listenr.dart b/frontend/app_flowy/lib/plugins/grid/application/field/grid_listener.dart similarity index 100% rename from frontend/app_flowy/lib/plugins/grid/application/field/grid_listenr.dart rename to frontend/app_flowy/lib/plugins/grid/application/field/grid_listener.dart diff --git a/frontend/app_flowy/lib/plugins/grid/application/grid_service.dart b/frontend/app_flowy/lib/plugins/grid/application/grid_service.dart index 14fbf2bf62..dff03f636e 100644 --- a/frontend/app_flowy/lib/plugins/grid/application/grid_service.dart +++ b/frontend/app_flowy/lib/plugins/grid/application/grid_service.dart @@ -1,6 +1,6 @@ import 'dart:collection'; -import 'package:app_flowy/plugins/grid/application/field/grid_listenr.dart'; +import 'package:app_flowy/plugins/grid/application/field/grid_listener.dart'; import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/dispatch/dispatch.dart'; import 'package:flowy_sdk/log.dart'; @@ -132,7 +132,7 @@ class GridFieldCache { void removeListener({ FieldsCallback? onFieldsListener, - FieldChangesetCallback? onChangsetListener, + FieldChangesetCallback? onChangesetListener, }) { if (onFieldsListener != null) { final fn = _fieldsCallbackMap.remove(onFieldsListener); @@ -141,8 +141,8 @@ class GridFieldCache { } } - if (onChangsetListener != null) { - _changesetCallbackMap.remove(onChangsetListener); + if (onChangesetListener != null) { + _changesetCallbackMap.remove(onChangesetListener); } } @@ -225,7 +225,7 @@ class GridRowCacheFieldNotifierImpl extends GridRowCacheFieldNotifier { } if (_onChangesetFn != null) { - _cache.removeListener(onChangsetListener: _onChangesetFn!); + _cache.removeListener(onChangesetListener: _onChangesetFn!); _onChangesetFn = null; } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_cotainer.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_cotainer.dart index b88508837c..b2d174e3e2 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_cotainer.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/cell_cotainer.dart @@ -113,7 +113,6 @@ class CellEnterRegion extends StatelessWidget { class CellContainerNotifier extends ChangeNotifier { final CellEditable cellEditable; - bool mouted = false; VoidCallback? _onCellFocusListener; bool _isFocus = false; bool _onEnter = false; diff --git a/frontend/app_flowy/lib/startup/deps_resolver.dart b/frontend/app_flowy/lib/startup/deps_resolver.dart index 6627546c72..8b173a4002 100644 --- a/frontend/app_flowy/lib/startup/deps_resolver.dart +++ b/frontend/app_flowy/lib/startup/deps_resolver.dart @@ -6,7 +6,7 @@ import 'package:app_flowy/plugins/doc/application/prelude.dart'; import 'package:app_flowy/plugins/grid/application/prelude.dart'; import 'package:app_flowy/workspace/application/user/prelude.dart'; import 'package:app_flowy/workspace/application/workspace/prelude.dart'; -import 'package:app_flowy/workspace/application/edit_pannel/edit_pannel_bloc.dart'; +import 'package:app_flowy/workspace/application/edit_panel/edit_panel_bloc.dart'; import 'package:app_flowy/workspace/application/view/prelude.dart'; import 'package:app_flowy/workspace/application/menu/prelude.dart'; import 'package:app_flowy/workspace/application/settings/prelude.dart'; @@ -43,7 +43,7 @@ void _resolveUserDeps(GetIt getIt) { getIt.registerFactory(() => SignUpBloc(getIt())); getIt.registerFactory(() => SplashRoute()); - getIt.registerFactory(() => EditPannelBloc()); + getIt.registerFactory(() => EditPanelBloc()); getIt.registerFactory(() => SplashBloc()); getIt.registerLazySingleton(() => NetworkListener()); } diff --git a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_context.dart b/frontend/app_flowy/lib/workspace/application/edit_panel/edit_context.dart similarity index 57% rename from frontend/app_flowy/lib/workspace/application/edit_pannel/edit_context.dart rename to frontend/app_flowy/lib/workspace/application/edit_panel/edit_context.dart index 571461b365..6234858f60 100644 --- a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_context.dart +++ b/frontend/app_flowy/lib/workspace/application/edit_panel/edit_context.dart @@ -1,11 +1,12 @@ import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; -abstract class EditPannelContext extends Equatable { +abstract class EditPanelContext extends Equatable { final String identifier; final String title; final Widget child; - const EditPannelContext({required this.child, required this.identifier, required this.title}); + const EditPanelContext( + {required this.child, required this.identifier, required this.title}); @override List get props => [identifier]; diff --git a/frontend/app_flowy/lib/workspace/application/edit_panel/edit_panel_bloc.dart b/frontend/app_flowy/lib/workspace/application/edit_panel/edit_panel_bloc.dart new file mode 100644 index 0000000000..d739c25559 --- /dev/null +++ b/frontend/app_flowy/lib/workspace/application/edit_panel/edit_panel_bloc.dart @@ -0,0 +1,41 @@ +import 'package:app_flowy/workspace/application/edit_panel/edit_context.dart'; +import 'package:dartz/dartz.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + +part 'edit_panel_bloc.freezed.dart'; + +class EditPanelBloc extends Bloc { + EditPanelBloc() : super(EditPanelState.initial()) { + on((event, emit) async { + await event.map( + startEdit: (e) async { + emit(state.copyWith(isEditing: true, editContext: some(e.context))); + }, + endEdit: (value) async { + emit(state.copyWith(isEditing: false, editContext: none())); + }, + ); + }); + } +} + +@freezed +class EditPanelEvent with _$EditPanelEvent { + const factory EditPanelEvent.startEdit(EditPanelContext context) = _StartEdit; + + const factory EditPanelEvent.endEdit(EditPanelContext context) = _EndEdit; +} + +@freezed +class EditPanelState with _$EditPanelState { + const factory EditPanelState({ + required bool isEditing, + required Option editContext, + }) = _EditPanelState; + + factory EditPanelState.initial() => EditPanelState( + isEditing: false, + editContext: none(), + ); +} diff --git a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.dart b/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.dart deleted file mode 100644 index e1f2f5835d..0000000000 --- a/frontend/app_flowy/lib/workspace/application/edit_pannel/edit_pannel_bloc.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:app_flowy/workspace/application/edit_pannel/edit_context.dart'; -import 'package:dartz/dartz.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; - -part 'edit_pannel_bloc.freezed.dart'; - -class EditPannelBloc extends Bloc { - EditPannelBloc() : super(EditPannelState.initial()) { - on((event, emit) async { - await event.map( - startEdit: (e) async { - emit(state.copyWith(isEditing: true, editContext: some(e.context))); - }, - endEdit: (value) async { - emit(state.copyWith(isEditing: false, editContext: none())); - }, - ); - }); - } -} - -@freezed -class EditPannelEvent with _$EditPannelEvent { - const factory EditPannelEvent.startEdit(EditPannelContext context) = _StartEdit; - - const factory EditPannelEvent.endEdit(EditPannelContext context) = _EndEdit; -} - -@freezed -class EditPannelState with _$EditPannelState { - const factory EditPannelState({ - required bool isEditing, - required Option editContext, - }) = _EditPannelState; - - factory EditPannelState.initial() => EditPannelState( - isEditing: false, - editContext: none(), - ); -} diff --git a/frontend/app_flowy/lib/workspace/application/home/home_bloc.dart b/frontend/app_flowy/lib/workspace/application/home/home_bloc.dart index af637ea1c7..87bac230da 100644 --- a/frontend/app_flowy/lib/workspace/application/home/home_bloc.dart +++ b/frontend/app_flowy/lib/workspace/application/home/home_bloc.dart @@ -1,9 +1,10 @@ import 'package:app_flowy/user/application/user_listener.dart'; -import 'package:app_flowy/workspace/application/edit_pannel/edit_context.dart'; +import 'package:app_flowy/workspace/application/edit_panel/edit_context.dart'; import 'package:flowy_sdk/log.dart'; import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; -import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart' show CurrentWorkspaceSettingPB; +import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart' + show CurrentWorkspaceSettingPB; import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; @@ -24,7 +25,8 @@ class HomeBloc extends Bloc { onAuthChanged: (result) => _authDidChanged(result), onSettingUpdated: (result) { result.fold( - (setting) => add(HomeEvent.didReceiveWorkspaceSetting(setting)), + (setting) => + add(HomeEvent.didReceiveWorkspaceSetting(setting)), (r) => Log.error(r), ); }, @@ -33,11 +35,11 @@ class HomeBloc extends Bloc { showLoading: (e) async { emit(state.copyWith(isLoading: e.isLoading)); }, - setEditPannel: (e) async { - emit(state.copyWith(pannelContext: some(e.editContext))); + setEditPanel: (e) async { + emit(state.copyWith(panelContext: some(e.editContext))); }, - dismissEditPannel: (value) async { - emit(state.copyWith(pannelContext: none())); + dismissEditPanel: (value) async { + emit(state.copyWith(panelContext: none())); }, forceCollapse: (e) async { emit(state.copyWith(forceCollapse: e.forceCollapse)); @@ -51,8 +53,9 @@ class HomeBloc extends Bloc { collapseMenu: (e) { emit(state.copyWith(isMenuCollapsed: !state.isMenuCollapsed)); }, - editPannelResized: (e) { - final newOffset = (state.resizeOffset + e.offset).clamp(-50, 200).toDouble(); + editPanelResized: (e) { + final newOffset = + (state.resizeOffset + e.offset).clamp(-50, 200).toDouble(); emit(state.copyWith(resizeOffset: newOffset)); }, ); @@ -80,12 +83,14 @@ class HomeEvent with _$HomeEvent { const factory HomeEvent.initial() = _Initial; const factory HomeEvent.showLoading(bool isLoading) = _ShowLoading; const factory HomeEvent.forceCollapse(bool forceCollapse) = _ForceCollapse; - const factory HomeEvent.setEditPannel(EditPannelContext editContext) = _ShowEditPannel; - const factory HomeEvent.dismissEditPannel() = _DismissEditPannel; - const factory HomeEvent.didReceiveWorkspaceSetting(CurrentWorkspaceSettingPB setting) = _DidReceiveWorkspaceSetting; + const factory HomeEvent.setEditPanel(EditPanelContext editContext) = + _ShowEditPanel; + const factory HomeEvent.dismissEditPanel() = _DismissEditPanel; + const factory HomeEvent.didReceiveWorkspaceSetting( + CurrentWorkspaceSettingPB setting) = _DidReceiveWorkspaceSetting; const factory HomeEvent.unauthorized(String msg) = _Unauthorized; const factory HomeEvent.collapseMenu() = _CollapseMenu; - const factory HomeEvent.editPannelResized(double offset) = _EditPannelResized; + const factory HomeEvent.editPanelResized(double offset) = _EditPanelResized; } @freezed @@ -93,17 +98,18 @@ class HomeState with _$HomeState { const factory HomeState({ required bool isLoading, required bool forceCollapse, - required Option pannelContext, + required Option panelContext, required CurrentWorkspaceSettingPB workspaceSetting, required bool unauthorized, required bool isMenuCollapsed, required double resizeOffset, }) = _HomeState; - factory HomeState.initial(CurrentWorkspaceSettingPB workspaceSetting) => HomeState( + factory HomeState.initial(CurrentWorkspaceSettingPB workspaceSetting) => + HomeState( isLoading: false, forceCollapse: false, - pannelContext: none(), + panelContext: none(), workspaceSetting: workspaceSetting, unauthorized: false, isMenuCollapsed: false, diff --git a/frontend/app_flowy/lib/workspace/presentation/home/home_layout.dart b/frontend/app_flowy/lib/workspace/presentation/home/home_layout.dart index e7e02b9767..dde5091d44 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/home_layout.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/home_layout.dart @@ -11,16 +11,17 @@ import 'home_sizes.dart'; class HomeLayout { late double menuWidth; late bool showMenu; - late bool showEditPannel; - late double editPannelWidth; + late bool showEditPanel; + late double editPanelWidth; late double homePageLOffset; late double homePageROffset; late Duration animDuration; - HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint, bool forceCollapse) { + HomeLayout(BuildContext context, BoxConstraints homeScreenConstraint, + bool forceCollapse) { final homeBlocState = context.read().state; - showEditPannel = homeBlocState.pannelContext.isSome(); + showEditPanel = homeBlocState.panelContext.isSome(); menuWidth = Sizes.sideBarMed; if (context.widthPx >= PageBreaks.desktop) { @@ -38,7 +39,7 @@ class HomeLayout { homePageLOffset = showMenu ? menuWidth : 0.0; animDuration = .35.seconds; - editPannelWidth = HomeSizes.editPannelWidth; - homePageROffset = showEditPannel ? editPannelWidth : 0; + editPanelWidth = HomeSizes.editPanelWidth; + homePageROffset = showEditPanel ? editPanelWidth : 0; } } diff --git a/frontend/app_flowy/lib/workspace/presentation/home/home_screen.dart b/frontend/app_flowy/lib/workspace/presentation/home/home_screen.dart index 3aca4dd9ff..e38a2f4614 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/home_screen.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/home_screen.dart @@ -1,6 +1,6 @@ import 'package:app_flowy/startup/plugin/plugin.dart'; import 'package:app_flowy/workspace/application/home/home_bloc.dart'; -import 'package:app_flowy/workspace/presentation/widgets/edit_pannel/pannel_animation.dart'; +import 'package:app_flowy/workspace/presentation/widgets/edit_panel/panel_animation.dart'; import 'package:app_flowy/workspace/presentation/widgets/float_bubble/question_bubble.dart'; import 'package:app_flowy/startup/startup.dart'; import 'package:flowy_sdk/log.dart'; @@ -12,7 +12,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:styled_widget/styled_widget.dart'; -import '../widgets/edit_pannel/edit_pannel.dart'; +import '../widgets/edit_panel/edit_panel.dart'; import 'home_layout.dart'; import 'home_stack.dart'; @@ -64,9 +64,9 @@ class _HomeScreenState extends State { child: BlocBuilder( buildWhen: (previous, current) => previous != current, builder: (context, state) { - final collapasedNotifier = + final collapsedNotifier = getIt().collapsedNotifier; - collapasedNotifier.addPublishListener((isCollapsed) { + collapsedNotifier.addPublishListener((isCollapsed) { context .read() .add(HomeEvent.forceCollapse(isCollapsed)); @@ -94,7 +94,7 @@ class _HomeScreenState extends State { state: state, ); final homeMenuResizer = _buildHomeMenuResizer(context: context); - final editPannel = _buildEditPannel( + final editPanel = _buildEditPanel( homeState: state, layout: layout, context: context, @@ -104,7 +104,7 @@ class _HomeScreenState extends State { layout: layout, homeStack: homeStack, homeMenu: menu, - editPannel: editPannel, + editPanel: editPanel, bubble: bubble, homeMenuResizer: homeMenuResizer, ); @@ -142,23 +142,23 @@ class _HomeScreenState extends State { return FocusTraversalGroup(child: RepaintBoundary(child: homeMenu)); } - Widget _buildEditPannel( + Widget _buildEditPanel( {required HomeState homeState, required BuildContext context, required HomeLayout layout}) { final homeBloc = context.read(); return BlocBuilder( buildWhen: (previous, current) => - previous.pannelContext != current.pannelContext, + previous.panelContext != current.panelContext, builder: (context, state) { - return state.pannelContext.fold( + return state.panelContext.fold( () => const SizedBox(), - (pannelContext) => FocusTraversalGroup( + (panelContext) => FocusTraversalGroup( child: RepaintBoundary( - child: EditPannel( - pannelContext: pannelContext, + child: EditPanel( + panelContext: panelContext, onEndEdit: () => - homeBloc.add(const HomeEvent.dismissEditPannel()), + homeBloc.add(const HomeEvent.dismissEditPanel()), ), ), ), @@ -177,7 +177,7 @@ class _HomeScreenState extends State { onPanUpdate: ((details) { context .read() - .add(HomeEvent.editPannelResized(details.delta.dx)); + .add(HomeEvent.editPanelResized(details.delta.dx)); }), behavior: HitTestBehavior.translucent, child: SizedBox( @@ -191,7 +191,7 @@ class _HomeScreenState extends State { required HomeLayout layout, required Widget homeMenu, required Widget homeStack, - required Widget editPannel, + required Widget editPanel, required Widget bubble, required Widget homeMenuResizer, }) { @@ -226,14 +226,14 @@ class _HomeScreenState extends State { animate: true, ) .animate(layout.animDuration, Curves.easeOut), - editPannel + editPanel .animatedPanelX( duration: layout.animDuration.inMilliseconds * 0.001, - closeX: layout.editPannelWidth, - isClosed: !layout.showEditPannel, + closeX: layout.editPanelWidth, + isClosed: !layout.showEditPanel, ) .positioned( - right: 0, top: 0, bottom: 0, width: layout.editPannelWidth), + right: 0, top: 0, bottom: 0, width: layout.editPanelWidth), ], ); } diff --git a/frontend/app_flowy/lib/workspace/presentation/home/home_sizes.dart b/frontend/app_flowy/lib/workspace/presentation/home/home_sizes.dart index 350a1e49be..299d3fe03c 100644 --- a/frontend/app_flowy/lib/workspace/presentation/home/home_sizes.dart +++ b/frontend/app_flowy/lib/workspace/presentation/home/home_sizes.dart @@ -1,8 +1,8 @@ class HomeSizes { static double get menuAddButtonHeight => 60; static double get topBarHeight => 60; - static double get editPannelTopBarHeight => 60; - static double get editPannelWidth => 400; + static double get editPanelTopBarHeight => 60; + static double get editPanelWidth => 400; } class HomeInsets { diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/edit_pannel/edit_pannel.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/edit_panel.dart similarity index 66% rename from frontend/app_flowy/lib/workspace/presentation/widgets/edit_pannel/edit_pannel.dart rename to frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/edit_panel.dart index f9e5e0e6b5..ef0b61865e 100644 --- a/frontend/app_flowy/lib/workspace/presentation/widgets/edit_pannel/edit_pannel.dart +++ b/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/edit_panel.dart @@ -1,5 +1,5 @@ -import 'package:app_flowy/workspace/application/edit_pannel/edit_pannel_bloc.dart'; -import 'package:app_flowy/workspace/application/edit_pannel/edit_context.dart'; +import 'package:app_flowy/workspace/application/edit_panel/edit_panel_bloc.dart'; +import 'package:app_flowy/workspace/application/edit_panel/edit_context.dart'; import 'package:app_flowy/startup/startup.dart'; import 'package:app_flowy/workspace/presentation/home/home_sizes.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -9,12 +9,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:app_flowy/generated/locale_keys.g.dart'; -class EditPannel extends StatelessWidget { - final EditPannelContext pannelContext; +class EditPanel extends StatelessWidget { + final EditPanelContext panelContext; final VoidCallback onEndEdit; - const EditPannel({ + const EditPanel({ Key? key, - required this.pannelContext, + required this.panelContext, required this.onEndEdit, }) : super(key: key); @@ -23,15 +23,15 @@ class EditPannel extends StatelessWidget { return Container( color: Theme.of(context).colorScheme.secondary, child: BlocProvider( - create: (context) => getIt(), - child: BlocBuilder( + create: (context) => getIt(), + child: BlocBuilder( builder: (context, state) { return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - EditPannelTopBar(onClose: () => onEndEdit()), + EditPanelTopBar(onClose: () => onEndEdit()), Expanded( - child: pannelContext.child, + child: panelContext.child, ), ], ); @@ -42,13 +42,13 @@ class EditPannel extends StatelessWidget { } } -class EditPannelTopBar extends StatelessWidget { +class EditPanelTopBar extends StatelessWidget { final VoidCallback onClose; - const EditPannelTopBar({Key? key, required this.onClose}) : super(key: key); + const EditPanelTopBar({Key? key, required this.onClose}) : super(key: key); @override Widget build(BuildContext context) { return SizedBox( - height: HomeSizes.editPannelTopBarHeight, + height: HomeSizes.editPanelTopBarHeight, child: Padding( padding: const EdgeInsets.all(8.0), child: Row( diff --git a/frontend/app_flowy/lib/workspace/presentation/widgets/edit_pannel/pannel_animation.dart b/frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart similarity index 100% rename from frontend/app_flowy/lib/workspace/presentation/widgets/edit_pannel/pannel_animation.dart rename to frontend/app_flowy/lib/workspace/presentation/widgets/edit_panel/panel_animation.dart