mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: create view interface (#2772)
* refactor: create view interface * chore: update doc Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io> --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
parent
b5d9a73194
commit
4f5672c2af
@ -113,6 +113,7 @@ class AppBloc extends Bloc<AppEvent, AppState> {
|
||||
layoutType: value.pluginBuilder.layoutType!,
|
||||
initialDataBytes: value.initialDataBytes,
|
||||
ext: value.ext ?? {},
|
||||
openAfterCreate: true,
|
||||
);
|
||||
result.fold(
|
||||
(view) => emit(
|
||||
|
@ -18,8 +18,11 @@ class ViewBackendService {
|
||||
required String name,
|
||||
String? desc,
|
||||
|
||||
/// If [openAfterCreate] is true, the view will be opened after created.
|
||||
bool openAfterCreate = true,
|
||||
/// The default value of [openAfterCreate] is false, meaning the view will
|
||||
/// not be opened nor set as the current view. However, if set to true, the
|
||||
/// view will be opened and set as the current view. Upon relaunching the
|
||||
/// app, this view will be opened
|
||||
bool openAfterCreate = false,
|
||||
|
||||
/// The initial data should be a JSON that represent the DocumentDataPB.
|
||||
/// Currently, only support create document with initial data.
|
||||
|
@ -33,6 +33,7 @@ class AppFlowyBoardTest {
|
||||
parentViewId: app.id,
|
||||
name: "Test Board",
|
||||
layoutType: builder.layoutType!,
|
||||
openAfterCreate: true,
|
||||
).then((result) {
|
||||
return result.fold(
|
||||
(view) async {
|
||||
|
@ -11,6 +11,7 @@ Future<GridTestContext> createTestFilterGrid(AppFlowyGridTest gridTest) async {
|
||||
parentViewId: app.id,
|
||||
name: "Filter Grid",
|
||||
layoutType: builder.layoutType!,
|
||||
openAfterCreate: true,
|
||||
).then((result) {
|
||||
return result.fold(
|
||||
(view) async {
|
||||
|
@ -176,6 +176,7 @@ class AppFlowyGridTest {
|
||||
parentViewId: app.id,
|
||||
name: "Test Grid",
|
||||
layoutType: builder.layoutType!,
|
||||
openAfterCreate: true,
|
||||
).then((result) {
|
||||
return result.fold(
|
||||
(view) async {
|
||||
|
Loading…
Reference in New Issue
Block a user