mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: integration tests (#3673)
* fix: fix integration tests * fix: initiate isScreenSmall properly
This commit is contained in:
parent
e59870e421
commit
4f40945458
@ -20,12 +20,14 @@ class HomeSettingBloc extends Bloc<HomeSettingEvent, HomeSettingState> {
|
||||
UserProfilePB user,
|
||||
WorkspaceSettingPB workspaceSetting,
|
||||
AppearanceSettingsCubit appearanceSettingsCubit,
|
||||
double screenWidthPx,
|
||||
) : _listener = UserWorkspaceListener(userProfile: user),
|
||||
_appearanceSettingsCubit = appearanceSettingsCubit,
|
||||
super(
|
||||
HomeSettingState.initial(
|
||||
workspaceSetting,
|
||||
appearanceSettingsCubit.state,
|
||||
screenWidthPx,
|
||||
),
|
||||
) {
|
||||
on<HomeSettingEvent>(
|
||||
@ -149,16 +151,18 @@ class HomeSettingState with _$HomeSettingState {
|
||||
factory HomeSettingState.initial(
|
||||
WorkspaceSettingPB workspaceSetting,
|
||||
AppearanceSettingsState appearanceSettingsState,
|
||||
) =>
|
||||
HomeSettingState(
|
||||
panelContext: none(),
|
||||
workspaceSetting: workspaceSetting,
|
||||
unauthorized: false,
|
||||
isMenuCollapsed: appearanceSettingsState.isMenuCollapsed,
|
||||
isScreenSmall: appearanceSettingsState.isMenuCollapsed,
|
||||
keepMenuCollapsed: false,
|
||||
resizeOffset: appearanceSettingsState.menuOffset,
|
||||
resizeStart: 0,
|
||||
resizeType: MenuResizeType.slide,
|
||||
);
|
||||
double screenWidthPx,
|
||||
) {
|
||||
return HomeSettingState(
|
||||
panelContext: none(),
|
||||
workspaceSetting: workspaceSetting,
|
||||
unauthorized: false,
|
||||
isMenuCollapsed: appearanceSettingsState.isMenuCollapsed,
|
||||
isScreenSmall: screenWidthPx < PageBreaks.tabletLandscape,
|
||||
keepMenuCollapsed: false,
|
||||
resizeOffset: appearanceSettingsState.menuOffset,
|
||||
resizeStart: 0,
|
||||
resizeType: MenuResizeType.slide,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import 'package:flowy_infra_ui/style_widget/container.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:sized_context/sized_context.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
|
||||
import '../widgets/edit_panel/edit_panel.dart';
|
||||
@ -75,11 +76,12 @@ class DesktopHomeScreen extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
BlocProvider<HomeSettingBloc>(
|
||||
create: (context) {
|
||||
create: (_) {
|
||||
return HomeSettingBloc(
|
||||
userProfile,
|
||||
workspaceSetting,
|
||||
context.read<AppearanceSettingsCubit>(),
|
||||
context.widthPx,
|
||||
)..add(const HomeSettingEvent.initial());
|
||||
},
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user