mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: disable more button in row page
This commit is contained in:
parent
9f81b210e4
commit
83e8ea1dcb
@ -18,14 +18,21 @@ extension MobileRouter on BuildContext {
|
|||||||
ViewPB view, {
|
ViewPB view, {
|
||||||
Map<String, dynamic>? arguments,
|
Map<String, dynamic>? arguments,
|
||||||
bool addInRecent = true,
|
bool addInRecent = true,
|
||||||
|
bool showMoreButton = true,
|
||||||
}) async {
|
}) async {
|
||||||
// set the current view before pushing the new view
|
// set the current view before pushing the new view
|
||||||
getIt<MenuSharedState>().latestOpenView = view;
|
getIt<MenuSharedState>().latestOpenView = view;
|
||||||
unawaited(getIt<CachedRecentService>().updateRecentViews([view.id], true));
|
unawaited(getIt<CachedRecentService>().updateRecentViews([view.id], true));
|
||||||
|
final queryParameters = view.queryParameters(arguments);
|
||||||
|
|
||||||
|
if (view.layout == ViewLayoutPB.Document) {
|
||||||
|
queryParameters[MobileDocumentScreen.viewShowMoreButton] =
|
||||||
|
showMoreButton.toString();
|
||||||
|
}
|
||||||
|
|
||||||
final uri = Uri(
|
final uri = Uri(
|
||||||
path: view.routeName,
|
path: view.routeName,
|
||||||
queryParameters: view.queryParameters(arguments),
|
queryParameters: queryParameters,
|
||||||
).toString();
|
).toString();
|
||||||
await push(uri);
|
await push(uri);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ class MobileViewPage extends StatefulWidget {
|
|||||||
required this.viewLayout,
|
required this.viewLayout,
|
||||||
this.title,
|
this.title,
|
||||||
this.arguments,
|
this.arguments,
|
||||||
|
this.showMoreButton = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// view id
|
/// view id
|
||||||
@ -33,6 +34,7 @@ class MobileViewPage extends StatefulWidget {
|
|||||||
final ViewLayoutPB viewLayout;
|
final ViewLayoutPB viewLayout;
|
||||||
final String? title;
|
final String? title;
|
||||||
final Map<String, dynamic>? arguments;
|
final Map<String, dynamic>? arguments;
|
||||||
|
final bool showMoreButton;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<MobileViewPage> createState() => _MobileViewPageState();
|
State<MobileViewPage> createState() => _MobileViewPageState();
|
||||||
@ -215,13 +217,19 @@ class _MobileViewPageState extends State<MobileViewPage> {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
actions.addAll([
|
if (widget.showMoreButton) {
|
||||||
MobileViewPageMoreButton(
|
actions.addAll([
|
||||||
view: view,
|
MobileViewPageMoreButton(
|
||||||
isImmersiveMode: isImmersiveMode,
|
view: view,
|
||||||
appBarOpacity: _appBarOpacity,
|
isImmersiveMode: isImmersiveMode,
|
||||||
),
|
appBarOpacity: _appBarOpacity,
|
||||||
]);
|
),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
actions.addAll([
|
||||||
|
const HSpace(18.0),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,7 @@ class _OpenRowPageButtonState extends State<OpenRowPageButton> {
|
|||||||
await context.pushView(
|
await context.pushView(
|
||||||
view!,
|
view!,
|
||||||
addInRecent: false,
|
addInRecent: false,
|
||||||
|
showMoreButton: false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,15 +7,18 @@ class MobileDocumentScreen extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.id,
|
required this.id,
|
||||||
this.title,
|
this.title,
|
||||||
|
this.showMoreButton = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// view id
|
/// view id
|
||||||
final String id;
|
final String id;
|
||||||
final String? title;
|
final String? title;
|
||||||
|
final bool showMoreButton;
|
||||||
|
|
||||||
static const routeName = '/docs';
|
static const routeName = '/docs';
|
||||||
static const viewId = 'id';
|
static const viewId = 'id';
|
||||||
static const viewTitle = 'title';
|
static const viewTitle = 'title';
|
||||||
|
static const viewShowMoreButton = 'show_more_button';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -23,6 +26,7 @@ class MobileDocumentScreen extends StatelessWidget {
|
|||||||
id: id,
|
id: id,
|
||||||
title: title,
|
title: title,
|
||||||
viewLayout: ViewLayoutPB.Document,
|
viewLayout: ViewLayoutPB.Document,
|
||||||
|
showMoreButton: showMoreButton,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -493,9 +493,17 @@ GoRoute _mobileEditorScreenRoute() {
|
|||||||
pageBuilder: (context, state) {
|
pageBuilder: (context, state) {
|
||||||
final id = state.uri.queryParameters[MobileDocumentScreen.viewId]!;
|
final id = state.uri.queryParameters[MobileDocumentScreen.viewId]!;
|
||||||
final title = state.uri.queryParameters[MobileDocumentScreen.viewTitle];
|
final title = state.uri.queryParameters[MobileDocumentScreen.viewTitle];
|
||||||
|
final showMoreButton = bool.tryParse(
|
||||||
|
state.uri.queryParameters[MobileDocumentScreen.viewShowMoreButton] ??
|
||||||
|
'true',
|
||||||
|
);
|
||||||
|
|
||||||
return MaterialExtendedPage(
|
return MaterialExtendedPage(
|
||||||
child: MobileDocumentScreen(id: id, title: title),
|
child: MobileDocumentScreen(
|
||||||
|
id: id,
|
||||||
|
title: title,
|
||||||
|
showMoreButton: showMoreButton ?? true,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user