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:
Nathan.fooo 2023-06-12 12:57:01 +08:00 committed by GitHub
parent b5d9a73194
commit 4f5672c2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 2 deletions

View File

@ -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(

View File

@ -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.

View File

@ -33,6 +33,7 @@ class AppFlowyBoardTest {
parentViewId: app.id,
name: "Test Board",
layoutType: builder.layoutType!,
openAfterCreate: true,
).then((result) {
return result.fold(
(view) async {

View File

@ -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 {

View File

@ -176,6 +176,7 @@ class AppFlowyGridTest {
parentViewId: app.id,
name: "Test Grid",
layoutType: builder.layoutType!,
openAfterCreate: true,
).then((result) {
return result.fold(
(view) async {