chore: config create field pannel

This commit is contained in:
appflowy 2022-03-24 17:09:05 +08:00
parent 694963a47d
commit 3fdf922f81
78 changed files with 964 additions and 2381 deletions

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.5 8L8.11538 9.5L13.5 4.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13 8.5V11.8889C13 12.1836 12.8829 12.4662 12.6746 12.6746C12.4662 12.8829 12.1836 13 11.8889 13H4.11111C3.81643 13 3.53381 12.8829 3.32544 12.6746C3.11706 12.4662 3 12.1836 3 11.8889V4.11111C3 3.81643 3.11706 3.53381 3.32544 3.32544C3.53381 3.11706 3.81643 3 4.11111 3H10.2222" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 561 B

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.5 8L8.11538 9.5L13.5 4.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C8.81896 2.5 9.59612 2.679 10.2945 3" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 421 B

View File

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.8889 3.5H4.11111C3.49746 3.5 3 3.94772 3 4.5V11.5C3 12.0523 3.49746 12.5 4.11111 12.5H11.8889C12.5025 12.5 13 12.0523 13 11.5V4.5C13 3.94772 12.5025 3.5 11.8889 3.5Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6 2.5V4.58181" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3 6.5H13" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 618 B

View File

@ -0,0 +1,8 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.5 4L12.5 4" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6.5 8H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M6.5 12H12.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="4" cy="4" r="0.5" fill="#333333"/>
<circle cx="4" cy="8" r="0.5" fill="#333333"/>
<circle cx="4" cy="12" r="0.5" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 512 B

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.201 6.4H3.001V12H2.081V7.384L0.953 7.704L0.729 6.92L2.201 6.4ZM3.91156 12V11.1L6.35156 8.61C6.9449 8.01667 7.24156 7.50333 7.24156 7.07C7.24156 6.73 7.13823 6.46667 6.93156 6.28C6.73156 6.08667 6.4749 5.99 6.16156 5.99C5.5749 5.99 5.14156 6.28 4.86156 6.86L3.89156 6.29C4.11156 5.82333 4.42156 5.47 4.82156 5.23C5.22156 4.99 5.6649 4.87 6.15156 4.87C6.7649 4.87 7.29156 5.06333 7.73156 5.45C8.17156 5.83667 8.39156 6.36333 8.39156 7.03C8.39156 7.74333 7.9949 8.50333 7.20156 9.31L5.62156 10.89H8.52156V12H3.91156ZM12.9025 7.032C13.5105 7.176 14.0025 7.46 14.3785 7.884C14.7625 8.3 14.9545 8.824 14.9545 9.456C14.9545 10.296 14.6705 10.956 14.1025 11.436C13.5345 11.916 12.8385 12.156 12.0145 12.156C11.3745 12.156 10.7985 12.008 10.2865 11.712C9.78253 11.416 9.41853 10.984 9.19453 10.416L10.3705 9.732C10.6185 10.452 11.1665 10.812 12.0145 10.812C12.4945 10.812 12.8745 10.692 13.1545 10.452C13.4345 10.204 13.5745 9.872 13.5745 9.456C13.5745 9.04 13.4345 8.712 13.1545 8.472C12.8745 8.232 12.4945 8.112 12.0145 8.112H11.7025L11.1505 7.284L12.9625 4.896H9.44653V3.6H14.6065V4.776L12.9025 7.032Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.78787 8.78787L6.51213 7.51213C6.32314 7.32314 6.45699 7 6.72426 7H9.27574C9.54301 7 9.67686 7.32314 9.48787 7.51213L8.21213 8.78787C8.09497 8.90503 7.90503 8.90503 7.78787 8.78787Z" fill="#333333"/>
<path d="M8 13C10.7614 13 13 10.7614 13 8C13 5.23858 10.7614 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13Z" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 499 B

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.15625 11.8359L6.43768 9.85414H2.46662L1.74805 11.8359H0.5L3.7903 3H5.11399L8.4043 11.8359H7.15625ZM2.87003 8.75596H6.03427L4.44584 4.40112L2.87003 8.75596Z" fill="#333333"/>
<path d="M14.4032 5.52454H15.5V11.8359H14.4032V10.7504C13.8569 11.5835 13.0627 12 12.0206 12C11.1381 12 10.386 11.6802 9.76403 11.0407C9.14211 10.3927 8.83114 9.60589 8.83114 8.68022C8.83114 7.75456 9.14211 6.97195 9.76403 6.3324C10.386 5.68443 11.1381 5.36045 12.0206 5.36045C13.0627 5.36045 13.8569 5.777 14.4032 6.6101V5.52454ZM12.1593 10.9397C12.798 10.9397 13.3317 10.7251 13.7603 10.2959C14.1889 9.85835 14.4032 9.31978 14.4032 8.68022C14.4032 8.04067 14.1889 7.50631 13.7603 7.07714C13.3317 6.63955 12.798 6.42076 12.1593 6.42076C11.5289 6.42076 10.9995 6.63955 10.5708 7.07714C10.1422 7.50631 9.92791 8.04067 9.92791 8.68022C9.92791 9.31978 10.1422 9.85835 10.5708 10.2959C10.9995 10.7251 11.5289 10.9397 12.1593 10.9397Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.39568 7.6963L6.91032 5.56599C6.65085 5.34358 6.25 5.52795 6.25 5.86969L6.25 10.1303C6.25 10.4721 6.65085 10.6564 6.91032 10.434L9.39568 8.3037C9.58192 8.14406 9.58192 7.85594 9.39568 7.6963Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 324 B

View File

@ -148,7 +148,13 @@
"insertLeft": "Insert Left",
"insertRight": "Insert Right",
"duplicate": "Duplicate",
"delete": "Delete"
"delete": "Delete",
"textFieldName": "Text",
"checkboxFieldName": "Number",
"dateFieldName": "Date",
"numberFieldName": "Number",
"singleSelectFieldName": "Select",
"multiSelectFieldName": "Multiselect"
}
}
}

View File

@ -103,15 +103,21 @@ class HomeDepsResolver {
getIt.registerFactoryParam<GridHeaderBloc, String, List<Field>>(
(gridId, fields) => GridHeaderBloc(
data: GridColumnData(fields: fields),
service: FieldService(),
data: GridHeaderData(gridId: gridId, fields: fields),
service: FieldService(gridId: gridId),
),
);
getIt.registerFactoryParam<FieldEditBloc, Field, void>(
(field, _) => FieldEditBloc(
field: field,
service: FieldService(),
getIt.registerFactoryParam<EditFieldBloc, GridFieldData, void>(
(data, _) => EditFieldBloc(
field: data.field,
service: FieldService(gridId: data.gridId),
),
);
getIt.registerFactoryParam<CreateFieldBloc, String, void>(
(gridId, _) => CreateFieldBloc(
service: FieldService(gridId: gridId),
),
);

View File

@ -1,7 +1,8 @@
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
class GridColumnData {
class GridHeaderData {
final String gridId;
final List<Field> fields;
GridColumnData({required this.fields});
GridHeaderData({required this.gridId, required this.fields});
}

View File

@ -0,0 +1,47 @@
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'field_service.dart';
import 'package:dartz/dartz.dart';
part 'create_field_bloc.freezed.dart';
class CreateFieldBloc extends Bloc<CreateFieldEvent, CreateFieldState> {
final FieldService service;
CreateFieldBloc({required this.service}) : super(CreateFieldState.initial()) {
on<CreateFieldEvent>(
(event, emit) async {
await event.map(
initial: (_InitialField value) {},
updateName: (_UpdateName value) {},
);
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed
class CreateFieldEvent with _$CreateFieldEvent {
const factory CreateFieldEvent.initial() = _InitialField;
const factory CreateFieldEvent.updateName(String newName) = _UpdateName;
}
@freezed
class CreateFieldState with _$CreateFieldState {
const factory CreateFieldState({
required String errorText,
required Option<Field> field,
}) = _CreateFieldState;
factory CreateFieldState.initial() => CreateFieldState(
field: none(),
errorText: '',
);
}

View File

@ -0,0 +1,54 @@
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'field_service.dart';
part 'edit_field_bloc.freezed.dart';
class EditFieldBloc extends Bloc<EditFieldEvent, EditFieldState> {
final FieldService service;
EditFieldBloc({required Field field, required this.service}) : super(EditFieldState.initial(field)) {
on<EditFieldEvent>(
(event, emit) async {
await event.map(
initial: (_InitialField value) {},
updateFieldName: (_UpdateFieldName value) {
//
},
hideField: (_HideField value) {},
deleteField: (_DeleteField value) {},
duplicateField: (_DuplicateField value) {},
);
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed
class EditFieldEvent with _$EditFieldEvent {
const factory EditFieldEvent.initial() = _InitialField;
const factory EditFieldEvent.updateFieldName(String name) = _UpdateFieldName;
const factory EditFieldEvent.hideField() = _HideField;
const factory EditFieldEvent.duplicateField() = _DuplicateField;
const factory EditFieldEvent.deleteField() = _DeleteField;
}
@freezed
class EditFieldState with _$EditFieldState {
const factory EditFieldState({
required Field field,
required String errorText,
}) = _EditFieldState;
factory EditFieldState.initial(Field field) => EditFieldState(
field: field,
errorText: '',
);
}

View File

@ -1,58 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'field_service.dart';
part 'field_edit_bloc.freezed.dart';
class FieldEditBloc extends Bloc<FieldEditEvent, FieldEditState> {
final FieldService service;
FieldEditBloc({required Field field, required this.service}) : super(FieldEditState.initial(field)) {
on<FieldEditEvent>(
(event, emit) async {
await event.map(
initial: (_InitialField value) {},
createField: (_CreateField value) {},
updateFieldName: (_UpdateFieldName value) {
//
},
hideField: (_HideField value) {},
deleteField: (_DeleteField value) {},
insertField: (_InsertField value) {},
duplicateField: (_DuplicateField value) {},
);
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed
class FieldEditEvent with _$FieldEditEvent {
const factory FieldEditEvent.initial() = _InitialField;
const factory FieldEditEvent.createField() = _CreateField;
const factory FieldEditEvent.updateFieldName(String name) = _UpdateFieldName;
const factory FieldEditEvent.hideField() = _HideField;
const factory FieldEditEvent.duplicateField() = _DuplicateField;
const factory FieldEditEvent.insertField({required bool onLeft}) = _InsertField;
const factory FieldEditEvent.deleteField() = _DeleteField;
}
@freezed
class FieldEditState with _$FieldEditState {
const factory FieldEditState({
required Field field,
required String errorText,
}) = _FieldEditState;
factory FieldEditState.initial(Field field) => FieldEditState(
field: field,
errorText: '',
);
}

View File

@ -1 +1,99 @@
class FieldService {}
import 'dart:typed_data';
import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid/protobuf.dart';
class FieldService {
final String gridId;
FieldService({required this.gridId});
Future<Either<Field, FlowyError>> getDefaultField(
String gridId,
) {
final payload = GridId.create()..value = gridId;
return GridEventCreateDefaultField(payload).send();
}
Future<Either<Unit, FlowyError>> createTextField(
String gridId,
Field field,
RichTextTypeOption typeOption,
String? startFieldId,
) {
final typeOptionData = typeOption.writeToBuffer();
return _createField(gridId, field, typeOptionData, startFieldId);
}
Future<Either<Unit, FlowyError>> createSingleSelectField(
String gridId,
Field field,
SingleSelectTypeOption typeOption,
String? startFieldId,
) {
final typeOptionData = typeOption.writeToBuffer();
return _createField(gridId, field, typeOptionData, startFieldId);
}
Future<Either<Unit, FlowyError>> createMultiSelectField(
String gridId,
Field field,
MultiSelectTypeOption typeOption,
String? startFieldId,
) {
final typeOptionData = typeOption.writeToBuffer();
return _createField(gridId, field, typeOptionData, startFieldId);
}
Future<Either<Unit, FlowyError>> createNumberField(
String gridId,
Field field,
NumberTypeOption typeOption,
String? startFieldId,
) {
final typeOptionData = typeOption.writeToBuffer();
return _createField(gridId, field, typeOptionData, startFieldId);
}
Future<Either<Unit, FlowyError>> createDateField(
String gridId,
Field field,
DateTypeOption typeOption,
String? startFieldId,
) {
final typeOptionData = typeOption.writeToBuffer();
return _createField(gridId, field, typeOptionData, startFieldId);
}
Future<Either<Unit, FlowyError>> _createField(
String gridId,
Field field,
Uint8List typeOptionData,
String? startFieldId,
) {
final payload = CreateFieldPayload.create()
..gridId = gridId
..field_2 = field
..typeOptionData = typeOptionData
..startFieldId = startFieldId ?? "";
return GridEventCreateField(payload).send();
}
}
class GridFieldData extends Equatable {
final String gridId;
final Field field;
const GridFieldData({
required this.gridId,
required this.field,
});
@override
List<Object> get props => [field.id];
}

View File

@ -11,7 +11,7 @@ class GridHeaderBloc extends Bloc<GridHeaderEvent, GridHeaderState> {
final FieldService service;
GridHeaderBloc({
required GridColumnData data,
required GridHeaderData data,
required this.service,
}) : super(GridHeaderState.initial(data.fields)) {
on<GridHeaderEvent>(
@ -19,6 +19,7 @@ class GridHeaderBloc extends Bloc<GridHeaderEvent, GridHeaderState> {
await event.map(
initial: (_InitialHeader value) async {},
createField: (_CreateField value) {},
insertField: (_InsertField value) {},
);
},
);
@ -34,6 +35,7 @@ class GridHeaderBloc extends Bloc<GridHeaderEvent, GridHeaderState> {
class GridHeaderEvent with _$GridHeaderEvent {
const factory GridHeaderEvent.initial() = _InitialHeader;
const factory GridHeaderEvent.createField() = _CreateField;
const factory GridHeaderEvent.insertField({required bool onLeft}) = _InsertField;
}
@freezed

View File

@ -31,9 +31,9 @@ class GridListener {
void _handleObservableType(GridNotification ty, Either<Uint8List, FlowyError> result) {
switch (ty) {
case GridNotification.DidUpdateRow:
case GridNotification.DidUpdateFields:
result.fold(
(payload) => fieldsUpdateNotifier.value = left(GridBlockId.fromBuffer(payload)),
(payload) => fieldsUpdateNotifier.value = left(RepeatedField.fromBuffer(payload).items),
(error) => fieldsUpdateNotifier.value = right(error),
);
break;

View File

@ -5,7 +5,8 @@ export 'grid_service.dart';
export 'data.dart';
export 'field/field_service.dart';
export 'field/grid_header_bloc.dart';
export 'field/field_edit_bloc.dart';
export 'field/edit_field_bloc.dart';
export 'field/create_field_bloc.dart';
export 'cell_bloc/text_cell_bloc.dart';
export 'cell_bloc/number_cell_bloc.dart';
export 'cell_bloc/selection_cell_bloc.dart';

View File

@ -0,0 +1,88 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/grid/field/create_field_bloc.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'field_name_input.dart';
import 'field_tyep_switcher.dart';
class CreateFieldPannel extends StatelessWidget {
const CreateFieldPannel({Key? key}) : super(key: key);
static void show(BuildContext context) {
const pannel = CreateFieldPannel();
FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer(
child: pannel,
constraints: BoxConstraints.loose(const Size(300, 200)),
),
identifier: pannel.identifier(),
anchorContext: context,
anchorDirection: AnchorDirection.bottomWithLeftAligned,
style: FlowyOverlayStyle(blur: false),
);
}
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => getIt<CreateFieldBloc>()..add(const CreateFieldEvent.initial()),
child: BlocBuilder<CreateFieldBloc, CreateFieldState>(
builder: (context, state) {
return state.field.fold(
() => const SizedBox(),
(field) => Column(children: [
const FlowyText.medium("Edit property"),
const VSpace(10),
_FieldNameTextField(field),
const VSpace(10),
_FieldTypeSwitcher(field),
]),
);
},
),
);
}
String identifier() {
return toString();
}
}
class _FieldTypeSwitcher extends StatelessWidget {
final Field field;
const _FieldTypeSwitcher(this.field, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FieldTypeSwitcher(
field: field,
onSelectField: _switchToFieldType,
);
}
void _switchToFieldType(FieldType fieldType) {
throw UnimplementedError();
}
}
class _FieldNameTextField extends StatelessWidget {
final Field field;
const _FieldNameTextField(this.field, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return FieldNameTextField(
name: field.name,
errorText: context.read<CreateFieldBloc>().state.errorText,
onNameChanged: (newName) {
context.read<CreateFieldBloc>().add(CreateFieldEvent.updateName(newName));
},
);
}
}

View File

@ -1,52 +1,47 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/grid/prelude.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' hide Row;
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';
import 'field_name_input.dart';
import 'field_operation_list.dart';
import 'field_tyep_switcher.dart';
class FieldEditor extends StatelessWidget {
final Field field;
const FieldEditor({required this.field, Key? key}) : super(key: key);
final GridFieldData fieldData;
const FieldEditor({required this.fieldData, Key? key}) : super(key: key);
static void show(BuildContext context, Field field) {
final editor = FieldEditor(field: field);
static void show(BuildContext context, GridFieldData fieldData) {
final editor = FieldEditor(fieldData: fieldData);
FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer(child: editor),
widget: OverlayContainer(
child: editor,
constraints: BoxConstraints.loose(const Size(300, 200)),
),
identifier: editor.identifier(),
anchorContext: context,
anchorDirection: AnchorDirection.bottomWithLeftAligned,
style: FlowyOverlayStyle(blur: false),
);
}
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return BlocProvider(
create: (context) => getIt<FieldEditBloc>(param1: field)..add(const FieldEditEvent.initial()),
child: Container(
color: theme.surface,
constraints: BoxConstraints.loose(const Size(300, 200)),
child: SingleChildScrollView(
child: Column(children: [
const FieldNameTextField(),
// FieldTypeSwitcher(),
const VSpace(10),
create: (context) => getIt<EditFieldBloc>(param1: fieldData)..add(const EditFieldEvent.initial()),
child: SingleChildScrollView(
child: Column(
children: [
const _FieldNameTextField(),
const VSpace(6),
const _FieldTypeSwitcher(),
const VSpace(6),
FieldOperationList(
onTap: () {
FlowyOverlay.of(context).remove(identifier());
},
onDismiss: () => FlowyOverlay.of(context).remove(identifier()),
),
]),
],
),
),
);
@ -57,152 +52,40 @@ class FieldEditor extends StatelessWidget {
}
}
class FieldNameTextField extends StatelessWidget {
const FieldNameTextField({Key? key}) : super(key: key);
class _FieldTypeSwitcher extends StatelessWidget {
const _FieldTypeSwitcher({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return BlocBuilder<FieldEditBloc, FieldEditState>(
return BlocBuilder<EditFieldBloc, EditFieldState>(
builder: (context, state) {
final field = context.read<EditFieldBloc>().state.field;
return FieldTypeSwitcher(field: field, onSelectField: _switchToFieldType);
},
);
}
void _switchToFieldType(FieldType fieldType) {
throw UnimplementedError();
}
}
class _FieldNameTextField extends StatelessWidget {
const _FieldNameTextField({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BlocBuilder<EditFieldBloc, EditFieldState>(
buildWhen: ((previous, current) => previous.field.name == current.field.name),
builder: (context, state) {
return RoundedInputField(
height: 36,
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
initialValue: state.field.name,
normalBorderColor: theme.shader4,
errorBorderColor: theme.red,
focusBorderColor: theme.main1,
cursorColor: theme.main1,
return FieldNameTextField(
name: state.field.name,
errorText: state.errorText,
onChanged: (value) {
context.read<FieldEditBloc>().add(FieldEditEvent.updateFieldName(value));
onNameChanged: (newName) {
context.read<EditFieldBloc>().add(EditFieldEvent.updateFieldName(newName));
},
);
},
);
}
}
class FieldTypeSwitcher extends StatelessWidget {
const FieldTypeSwitcher({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return FlowyButton(
text: FlowyText.medium(context.read<FieldEditBloc>().state.field.name, fontSize: 12),
hoverColor: theme.hover,
onTap: () {},
leftIcon: svg("editor/details", color: theme.iconColor),
);
}
}
class FieldOperationList extends StatelessWidget {
final VoidCallback onTap;
const FieldOperationList({required this.onTap, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final children = FieldAction.values
.map((action) => FieldActionItem(
action: action,
onTap: onTap,
))
.toList();
return GridView(
// https://api.flutter.dev/flutter/widgets/AnimatedList/shrinkWrap.html
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 4.0,
mainAxisSpacing: 8,
),
children: children,
);
}
}
class FieldActionItem extends StatelessWidget {
final VoidCallback onTap;
final FieldAction action;
const FieldActionItem({required this.action, required this.onTap, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return FlowyButton(
text: FlowyText.medium(action.title(), fontSize: 12),
hoverColor: theme.hover,
onTap: () {
action.run(context);
onTap();
},
leftIcon: svg(action.iconName(), color: theme.iconColor),
);
}
}
enum FieldAction {
hide,
insertLeft,
duplicate,
insertRight,
delete,
}
extension _FieldActionExtension on FieldAction {
String iconName() {
switch (this) {
case FieldAction.hide:
return 'grid/hide';
case FieldAction.insertLeft:
return 'grid/left';
case FieldAction.insertRight:
return 'grid/right';
case FieldAction.duplicate:
return 'grid/duplicate';
case FieldAction.delete:
return 'grid/delete';
}
}
String title() {
switch (this) {
case FieldAction.hide:
return LocaleKeys.grid_field_hide.tr();
case FieldAction.insertLeft:
return LocaleKeys.grid_field_insertLeft.tr();
case FieldAction.insertRight:
return LocaleKeys.grid_field_insertRight.tr();
case FieldAction.duplicate:
return LocaleKeys.grid_field_duplicate.tr();
case FieldAction.delete:
return LocaleKeys.grid_field_delete.tr();
}
}
void run(BuildContext context) {
final bloc = context.read<FieldEditBloc>();
switch (this) {
case FieldAction.hide:
bloc.add(const FieldEditEvent.hideField());
break;
case FieldAction.insertLeft:
bloc.add(const FieldEditEvent.insertField(onLeft: true));
break;
case FieldAction.insertRight:
bloc.add(const FieldEditEvent.insertField(onLeft: false));
break;
case FieldAction.duplicate:
bloc.add(const FieldEditEvent.duplicateField());
break;
case FieldAction.delete:
bloc.add(const FieldEditEvent.deleteField());
break;
}
}
}

View File

@ -0,0 +1,32 @@
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class FieldNameTextField extends StatelessWidget {
final void Function(String) onNameChanged;
final String name;
final String errorText;
const FieldNameTextField({
required this.name,
required this.errorText,
required this.onNameChanged,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return RoundedInputField(
height: 36,
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
initialValue: name,
normalBorderColor: theme.shader4,
errorBorderColor: theme.red,
focusBorderColor: theme.main1,
cursorColor: theme.main1,
errorText: errorText,
onChanged: onNameChanged,
);
}
}

View File

@ -0,0 +1,100 @@
import 'package:app_flowy/workspace/application/grid/field/edit_field_bloc.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class FieldOperationList extends StatelessWidget {
final VoidCallback onDismiss;
const FieldOperationList({required this.onDismiss, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final children = FieldAction.values
.map((action) => FieldActionItem(
action: action,
onTap: onDismiss,
))
.toList();
return GridView(
// https://api.flutter.dev/flutter/widgets/AnimatedList/shrinkWrap.html
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 4.0,
mainAxisSpacing: 8,
),
children: children,
);
}
}
class FieldActionItem extends StatelessWidget {
final VoidCallback onTap;
final FieldAction action;
const FieldActionItem({required this.action, required this.onTap, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return FlowyButton(
text: FlowyText.medium(action.title(), fontSize: 12),
hoverColor: theme.hover,
onTap: () {
action.run(context);
onTap();
},
leftIcon: svg(action.iconName(), color: theme.iconColor),
);
}
}
enum FieldAction {
hide,
// insertLeft,
duplicate,
// insertRight,
delete,
}
extension _FieldActionExtension on FieldAction {
String iconName() {
switch (this) {
case FieldAction.hide:
return 'grid/hide';
case FieldAction.duplicate:
return 'grid/duplicate';
case FieldAction.delete:
return 'grid/delete';
}
}
String title() {
switch (this) {
case FieldAction.hide:
return LocaleKeys.grid_field_hide.tr();
case FieldAction.duplicate:
return LocaleKeys.grid_field_duplicate.tr();
case FieldAction.delete:
return LocaleKeys.grid_field_delete.tr();
}
}
void run(BuildContext context) {
switch (this) {
case FieldAction.hide:
context.read<EditFieldBloc>().add(const EditFieldEvent.hideField());
break;
case FieldAction.duplicate:
context.read<EditFieldBloc>().add(const EditFieldEvent.duplicateField());
break;
case FieldAction.delete:
context.read<EditFieldBloc>().add(const EditFieldEvent.deleteField());
break;
}
}
}

View File

@ -0,0 +1,37 @@
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_type_list.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
typedef SelectFieldCallback = void Function(FieldType);
class FieldTypeSwitcher extends StatelessWidget {
final Field field;
final SelectFieldCallback onSelectField;
const FieldTypeSwitcher({
required this.field,
required this.onSelectField,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return SizedBox(
height: 36,
child: FlowyButton(
text: FlowyText.medium(field.name, fontSize: 12),
hoverColor: theme.hover,
onTap: () => FieldTypeList.show(context, onSelectField),
leftIcon: svg(field.fieldType.iconName(), color: theme.iconColor),
rightIcon: svg("grid/more", color: theme.iconColor),
),
);
}
}

View File

@ -0,0 +1,132 @@
import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/meta.pb.dart';
import 'package:flutter/material.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
typedef SelectFieldCallback = void Function(FieldType);
class FieldTypeList extends StatelessWidget {
final SelectFieldCallback onSelectField;
const FieldTypeList({required this.onSelectField, Key? key}) : super(key: key);
static void show(BuildContext context, SelectFieldCallback onSelectField) {
final list = FieldTypeList(onSelectField: onSelectField);
FlowyOverlay.of(context).insertWithAnchor(
widget: OverlayContainer(
child: list,
constraints: BoxConstraints.loose(const Size(140, 300)),
),
identifier: list.identifier(),
anchorContext: context,
anchorDirection: AnchorDirection.leftWithCenterAligned,
style: FlowyOverlayStyle(blur: false),
anchorOffset: const Offset(-20, 0),
);
}
@override
Widget build(BuildContext context) {
final cells = FieldType.values.map((fieldType) {
return FieldTypeCell(
fieldType: fieldType,
onSelectField: (fieldType) {
onSelectField(fieldType);
FlowyOverlay.of(context).remove(identifier());
},
);
}).toList();
return ListView.separated(
shrinkWrap: true,
controller: ScrollController(),
itemCount: cells.length,
separatorBuilder: (context, index) {
return const VSpace(10);
},
physics: StyledScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return cells[index];
},
);
}
String identifier() {
return toString();
}
}
class FieldTypeCell extends StatelessWidget {
final FieldType fieldType;
final SelectFieldCallback onSelectField;
const FieldTypeCell({
required this.fieldType,
required this.onSelectField,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return SizedBox(
height: 26,
child: FlowyButton(
text: FlowyText.medium(fieldType.title(), fontSize: 12),
hoverColor: theme.hover,
onTap: () => onSelectField(fieldType),
leftIcon: svg(fieldType.iconName(), color: theme.iconColor),
),
);
}
}
extension FieldTypeListExtension on FieldType {
String iconName() {
switch (this) {
case FieldType.Checkbox:
return "grid/field/checkbox";
case FieldType.DateTime:
return "grid/field/date";
case FieldType.MultiSelect:
return "grid/field/multi_select";
case FieldType.Number:
return "grid/field/number";
case FieldType.RichText:
return "grid/field/text";
case FieldType.SingleSelect:
return "grid/field/single_select";
default:
assert(false, "Unsupport field type");
return "grid/field/text";
}
}
String title() {
switch (this) {
case FieldType.Checkbox:
return LocaleKeys.grid_field_checkboxFieldName.tr();
case FieldType.DateTime:
return LocaleKeys.grid_field_dateFieldName.tr();
case FieldType.MultiSelect:
return LocaleKeys.grid_field_multiSelectFieldName.tr();
case FieldType.Number:
return LocaleKeys.grid_field_numberFieldName.tr();
case FieldType.RichText:
return LocaleKeys.grid_field_textFieldName.tr();
case FieldType.SingleSelect:
return LocaleKeys.grid_field_singleSelectFieldName.tr();
default:
assert(false, "Unsupport field type");
return LocaleKeys.grid_field_textFieldName.tr();
}
}
}

View File

@ -9,6 +9,7 @@ import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' hide Row;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'create_field_pannel.dart';
import 'header_cell.dart';
class GridHeaderDelegate extends SliverPersistentHeaderDelegate {
@ -46,19 +47,30 @@ class GridHeader extends StatelessWidget {
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
return BlocProvider(
create: (context) => getIt<GridHeaderBloc>(param1: gridId, param2: fields)..add(const GridHeaderEvent.initial()),
create: (context) {
final bloc = getIt<GridHeaderBloc>(param1: gridId, param2: fields);
bloc.add(const GridHeaderEvent.initial());
return bloc;
},
child: BlocBuilder<GridHeaderBloc, GridHeaderState>(
builder: (context, state) => Container(
color: theme.surface,
child: Row(
builder: (context, state) {
final cells = state.fields.map(
(field) => HeaderCell(
GridFieldData(gridId: gridId, field: field),
),
);
final row = Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const _HeaderLeading(),
...state.fields.map((field) => HeaderCell(field)),
...cells,
const _HeaderTrailing(),
],
),
),
);
return Container(color: theme.surface, child: row);
},
),
);
}
@ -102,7 +114,7 @@ class CreateFieldButton extends StatelessWidget {
return FlowyButton(
text: const FlowyText.medium('New column', fontSize: 12),
hoverColor: theme.hover,
onTap: () => context.read<GridHeaderBloc>().add(const GridHeaderEvent.createField()),
onTap: () => CreateFieldPannel.show(context),
leftIcon: svg("home/add"),
);
}

View File

@ -1,34 +1,33 @@
import 'package:app_flowy/workspace/application/grid/field/field_service.dart';
import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'field_editor.dart';
class HeaderCell extends StatelessWidget {
final Field field;
const HeaderCell(this.field, {Key? key}) : super(key: key);
final GridFieldData fieldData;
const HeaderCell(this.fieldData, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
final button = FlowyButton(
hoverColor: theme.hover,
onTap: () => FieldEditor.show(context, field),
onTap: () => FieldEditor.show(context, fieldData),
rightIcon: svg("editor/details", color: theme.iconColor),
text: Padding(padding: GridSize.cellContentInsets, child: FlowyText.medium(field.name, fontSize: 12)),
text: Padding(padding: GridSize.cellContentInsets, child: FlowyText.medium(fieldData.field.name, fontSize: 12)),
);
final borderSide = BorderSide(color: theme.shader4, width: 0.4);
final decoration = BoxDecoration(border: Border(top: borderSide, right: borderSide, bottom: borderSide));
return Container(
width: field.width.toDouble(),
width: fieldData.field.width.toDouble(),
decoration: decoration,
padding: GridSize.headerContentInsets,
child: button,

View File

@ -26,7 +26,7 @@ class FlowyButton extends StatelessWidget {
return InkWell(
onTap: onTap,
child: FlowyHover(
config: HoverDisplayConfig(borderRadius: Corners.s5Border, hoverColor: hoverColor),
config: HoverDisplayConfig(borderRadius: Corners.s6Border, hoverColor: hoverColor),
builder: (context, onHover) => _render(),
),
);

View File

@ -86,6 +86,23 @@ class GridEventCreateField {
}
}
class GridEventCreateDefaultField {
GridId request;
GridEventCreateDefaultField(this.request);
Future<Either<Field, FlowyError>> send() {
final request = FFIRequest.create()
..event = GridEvent.CreateDefaultField.toString()
..payload = requestToBytes(this.request);
return Dispatch.asyncRequest(request)
.then((bytesResult) => bytesResult.fold(
(okBytes) => left(Field.fromBuffer(okBytes)),
(errBytes) => right(FlowyError.fromBuffer(errBytes)),
));
}
}
class GridEventCreateRow {
CreateRowPayload request;
GridEventCreateRow(this.request);

View File

@ -1,458 +0,0 @@
///
// Generated code. Do not modify.
// source: cell_data.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
import 'cell_data.pbenum.dart';
export 'cell_data.pbenum.dart';
class RichTextDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RichTextDescription', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format')
..hasRequiredFields = false
;
RichTextDescription._() : super();
factory RichTextDescription({
$core.String? format,
}) {
final _result = create();
if (format != null) {
_result.format = format;
}
return _result;
}
factory RichTextDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory RichTextDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
RichTextDescription clone() => RichTextDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
RichTextDescription copyWith(void Function(RichTextDescription) updates) => super.copyWith((message) => updates(message as RichTextDescription)) as RichTextDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RichTextDescription create() => RichTextDescription._();
RichTextDescription createEmptyInstance() => create();
static $pb.PbList<RichTextDescription> createRepeated() => $pb.PbList<RichTextDescription>();
@$core.pragma('dart2js:noInline')
static RichTextDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RichTextDescription>(create);
static RichTextDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.String get format => $_getSZ(0);
@$pb.TagNumber(1)
set format($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasFormat() => $_has(0);
@$pb.TagNumber(1)
void clearFormat() => clearField(1);
}
class CheckboxDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckboxDescription', createEmptyInstance: create)
..aOB(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isSelected')
..hasRequiredFields = false
;
CheckboxDescription._() : super();
factory CheckboxDescription({
$core.bool? isSelected,
}) {
final _result = create();
if (isSelected != null) {
_result.isSelected = isSelected;
}
return _result;
}
factory CheckboxDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory CheckboxDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
CheckboxDescription clone() => CheckboxDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
CheckboxDescription copyWith(void Function(CheckboxDescription) updates) => super.copyWith((message) => updates(message as CheckboxDescription)) as CheckboxDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static CheckboxDescription create() => CheckboxDescription._();
CheckboxDescription createEmptyInstance() => create();
static $pb.PbList<CheckboxDescription> createRepeated() => $pb.PbList<CheckboxDescription>();
@$core.pragma('dart2js:noInline')
static CheckboxDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CheckboxDescription>(create);
static CheckboxDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get isSelected => $_getBF(0);
@$pb.TagNumber(1)
set isSelected($core.bool v) { $_setBool(0, v); }
@$pb.TagNumber(1)
$core.bool hasIsSelected() => $_has(0);
@$pb.TagNumber(1)
void clearIsSelected() => clearField(1);
}
class DateDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DateDescription', createEmptyInstance: create)
..e<DateFormat>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dateFormat', $pb.PbFieldType.OE, defaultOrMaker: DateFormat.Local, valueOf: DateFormat.valueOf, enumValues: DateFormat.values)
..e<TimeFormat>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timeFormat', $pb.PbFieldType.OE, defaultOrMaker: TimeFormat.TwelveHour, valueOf: TimeFormat.valueOf, enumValues: TimeFormat.values)
..hasRequiredFields = false
;
DateDescription._() : super();
factory DateDescription({
DateFormat? dateFormat,
TimeFormat? timeFormat,
}) {
final _result = create();
if (dateFormat != null) {
_result.dateFormat = dateFormat;
}
if (timeFormat != null) {
_result.timeFormat = timeFormat;
}
return _result;
}
factory DateDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory DateDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
DateDescription clone() => DateDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
DateDescription copyWith(void Function(DateDescription) updates) => super.copyWith((message) => updates(message as DateDescription)) as DateDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static DateDescription create() => DateDescription._();
DateDescription createEmptyInstance() => create();
static $pb.PbList<DateDescription> createRepeated() => $pb.PbList<DateDescription>();
@$core.pragma('dart2js:noInline')
static DateDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DateDescription>(create);
static DateDescription? _defaultInstance;
@$pb.TagNumber(1)
DateFormat get dateFormat => $_getN(0);
@$pb.TagNumber(1)
set dateFormat(DateFormat v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasDateFormat() => $_has(0);
@$pb.TagNumber(1)
void clearDateFormat() => clearField(1);
@$pb.TagNumber(2)
TimeFormat get timeFormat => $_getN(1);
@$pb.TagNumber(2)
set timeFormat(TimeFormat v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasTimeFormat() => $_has(1);
@$pb.TagNumber(2)
void clearTimeFormat() => clearField(2);
}
class SingleSelect extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SingleSelect', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
SingleSelect._() : super();
factory SingleSelect({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory SingleSelect.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SingleSelect.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SingleSelect clone() => SingleSelect()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SingleSelect copyWith(void Function(SingleSelect) updates) => super.copyWith((message) => updates(message as SingleSelect)) as SingleSelect; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SingleSelect create() => SingleSelect._();
SingleSelect createEmptyInstance() => create();
static $pb.PbList<SingleSelect> createRepeated() => $pb.PbList<SingleSelect>();
@$core.pragma('dart2js:noInline')
static SingleSelect getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SingleSelect>(create);
static SingleSelect? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class MultiSelect extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MultiSelect', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
MultiSelect._() : super();
factory MultiSelect({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory MultiSelect.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory MultiSelect.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
MultiSelect clone() => MultiSelect()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
MultiSelect copyWith(void Function(MultiSelect) updates) => super.copyWith((message) => updates(message as MultiSelect)) as MultiSelect; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static MultiSelect create() => MultiSelect._();
MultiSelect createEmptyInstance() => create();
static $pb.PbList<MultiSelect> createRepeated() => $pb.PbList<MultiSelect>();
@$core.pragma('dart2js:noInline')
static MultiSelect getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MultiSelect>(create);
static MultiSelect? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class SelectOption extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SelectOption', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'color')
..hasRequiredFields = false
;
SelectOption._() : super();
factory SelectOption({
$core.String? id,
$core.String? name,
$core.String? color,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (color != null) {
_result.color = color;
}
return _result;
}
factory SelectOption.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SelectOption.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SelectOption clone() => SelectOption()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SelectOption copyWith(void Function(SelectOption) updates) => super.copyWith((message) => updates(message as SelectOption)) as SelectOption; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SelectOption create() => SelectOption._();
SelectOption createEmptyInstance() => create();
static $pb.PbList<SelectOption> createRepeated() => $pb.PbList<SelectOption>();
@$core.pragma('dart2js:noInline')
static SelectOption getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SelectOption>(create);
static SelectOption? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
@$pb.TagNumber(1)
void clearId() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get color => $_getSZ(2);
@$pb.TagNumber(3)
set color($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasColor() => $_has(2);
@$pb.TagNumber(3)
void clearColor() => clearField(3);
}
class NumberDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NumberDescription', createEmptyInstance: create)
..e<FlowyMoney>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'money', $pb.PbFieldType.OE, defaultOrMaker: FlowyMoney.CNY, valueOf: FlowyMoney.valueOf, enumValues: FlowyMoney.values)
..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scale', $pb.PbFieldType.OU3)
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'symbol')
..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signPositive')
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..hasRequiredFields = false
;
NumberDescription._() : super();
factory NumberDescription({
FlowyMoney? money,
$core.int? scale,
$core.String? symbol,
$core.bool? signPositive,
$core.String? name,
}) {
final _result = create();
if (money != null) {
_result.money = money;
}
if (scale != null) {
_result.scale = scale;
}
if (symbol != null) {
_result.symbol = symbol;
}
if (signPositive != null) {
_result.signPositive = signPositive;
}
if (name != null) {
_result.name = name;
}
return _result;
}
factory NumberDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory NumberDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
NumberDescription clone() => NumberDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
NumberDescription copyWith(void Function(NumberDescription) updates) => super.copyWith((message) => updates(message as NumberDescription)) as NumberDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static NumberDescription create() => NumberDescription._();
NumberDescription createEmptyInstance() => create();
static $pb.PbList<NumberDescription> createRepeated() => $pb.PbList<NumberDescription>();
@$core.pragma('dart2js:noInline')
static NumberDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<NumberDescription>(create);
static NumberDescription? _defaultInstance;
@$pb.TagNumber(1)
FlowyMoney get money => $_getN(0);
@$pb.TagNumber(1)
set money(FlowyMoney v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasMoney() => $_has(0);
@$pb.TagNumber(1)
void clearMoney() => clearField(1);
@$pb.TagNumber(2)
$core.int get scale => $_getIZ(1);
@$pb.TagNumber(2)
set scale($core.int v) { $_setUnsignedInt32(1, v); }
@$pb.TagNumber(2)
$core.bool hasScale() => $_has(1);
@$pb.TagNumber(2)
void clearScale() => clearField(2);
@$pb.TagNumber(3)
$core.String get symbol => $_getSZ(2);
@$pb.TagNumber(3)
set symbol($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasSymbol() => $_has(2);
@$pb.TagNumber(3)
void clearSymbol() => clearField(3);
@$pb.TagNumber(4)
$core.bool get signPositive => $_getBF(3);
@$pb.TagNumber(4)
set signPositive($core.bool v) { $_setBool(3, v); }
@$pb.TagNumber(4)
$core.bool hasSignPositive() => $_has(3);
@$pb.TagNumber(4)
void clearSignPositive() => clearField(4);
@$pb.TagNumber(5)
$core.String get name => $_getSZ(4);
@$pb.TagNumber(5)
set name($core.String v) { $_setString(4, v); }
@$pb.TagNumber(5)
$core.bool hasName() => $_has(4);
@$pb.TagNumber(5)
void clearName() => clearField(5);
}

View File

@ -1,62 +0,0 @@
///
// Generated code. Do not modify.
// source: cell_data.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
// ignore_for_file: UNDEFINED_SHOWN_NAME
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class DateFormat extends $pb.ProtobufEnum {
static const DateFormat Local = DateFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Local');
static const DateFormat US = DateFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'US');
static const DateFormat ISO = DateFormat._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ISO');
static const DateFormat Friendly = DateFormat._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Friendly');
static const $core.List<DateFormat> values = <DateFormat> [
Local,
US,
ISO,
Friendly,
];
static final $core.Map<$core.int, DateFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static DateFormat? valueOf($core.int value) => _byValue[value];
const DateFormat._($core.int v, $core.String n) : super(v, n);
}
class TimeFormat extends $pb.ProtobufEnum {
static const TimeFormat TwelveHour = TimeFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwelveHour');
static const TimeFormat TwentyFourHour = TimeFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwentyFourHour');
static const $core.List<TimeFormat> values = <TimeFormat> [
TwelveHour,
TwentyFourHour,
];
static final $core.Map<$core.int, TimeFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static TimeFormat? valueOf($core.int value) => _byValue[value];
const TimeFormat._($core.int v, $core.String n) : super(v, n);
}
class FlowyMoney extends $pb.ProtobufEnum {
static const FlowyMoney CNY = FlowyMoney._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CNY');
static const FlowyMoney EUR = FlowyMoney._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EUR');
static const FlowyMoney USD = FlowyMoney._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'USD');
static const $core.List<FlowyMoney> values = <FlowyMoney> [
CNY,
EUR,
USD,
];
static final $core.Map<$core.int, FlowyMoney> _byValue = $pb.ProtobufEnum.initByValue(values);
static FlowyMoney? valueOf($core.int value) => _byValue[value];
const FlowyMoney._($core.int v, $core.String n) : super(v, n);
}

View File

@ -1,125 +0,0 @@
///
// Generated code. Do not modify.
// source: cell_data.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use dateFormatDescriptor instead')
const DateFormat$json = const {
'1': 'DateFormat',
'2': const [
const {'1': 'Local', '2': 0},
const {'1': 'US', '2': 1},
const {'1': 'ISO', '2': 2},
const {'1': 'Friendly', '2': 3},
],
};
/// Descriptor for `DateFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List dateFormatDescriptor = $convert.base64Decode('CgpEYXRlRm9ybWF0EgkKBUxvY2FsEAASBgoCVVMQARIHCgNJU08QAhIMCghGcmllbmRseRAD');
@$core.Deprecated('Use timeFormatDescriptor instead')
const TimeFormat$json = const {
'1': 'TimeFormat',
'2': const [
const {'1': 'TwelveHour', '2': 0},
const {'1': 'TwentyFourHour', '2': 1},
],
};
/// Descriptor for `TimeFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List timeFormatDescriptor = $convert.base64Decode('CgpUaW1lRm9ybWF0Eg4KClR3ZWx2ZUhvdXIQABISCg5Ud2VudHlGb3VySG91chAB');
@$core.Deprecated('Use flowyMoneyDescriptor instead')
const FlowyMoney$json = const {
'1': 'FlowyMoney',
'2': const [
const {'1': 'CNY', '2': 0},
const {'1': 'EUR', '2': 1},
const {'1': 'USD', '2': 2},
],
};
/// Descriptor for `FlowyMoney`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List flowyMoneyDescriptor = $convert.base64Decode('CgpGbG93eU1vbmV5EgcKA0NOWRAAEgcKA0VVUhABEgcKA1VTRBAC');
@$core.Deprecated('Use richTextDescriptionDescriptor instead')
const RichTextDescription$json = const {
'1': 'RichTextDescription',
'2': const [
const {'1': 'format', '3': 1, '4': 1, '5': 9, '10': 'format'},
],
};
/// Descriptor for `RichTextDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List richTextDescriptionDescriptor = $convert.base64Decode('ChNSaWNoVGV4dERlc2NyaXB0aW9uEhYKBmZvcm1hdBgBIAEoCVIGZm9ybWF0');
@$core.Deprecated('Use checkboxDescriptionDescriptor instead')
const CheckboxDescription$json = const {
'1': 'CheckboxDescription',
'2': const [
const {'1': 'is_selected', '3': 1, '4': 1, '5': 8, '10': 'isSelected'},
],
};
/// Descriptor for `CheckboxDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List checkboxDescriptionDescriptor = $convert.base64Decode('ChNDaGVja2JveERlc2NyaXB0aW9uEh8KC2lzX3NlbGVjdGVkGAEgASgIUgppc1NlbGVjdGVk');
@$core.Deprecated('Use dateDescriptionDescriptor instead')
const DateDescription$json = const {
'1': 'DateDescription',
'2': const [
const {'1': 'date_format', '3': 1, '4': 1, '5': 14, '6': '.DateFormat', '10': 'dateFormat'},
const {'1': 'time_format', '3': 2, '4': 1, '5': 14, '6': '.TimeFormat', '10': 'timeFormat'},
],
};
/// Descriptor for `DateDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dateDescriptionDescriptor = $convert.base64Decode('Cg9EYXRlRGVzY3JpcHRpb24SLAoLZGF0ZV9mb3JtYXQYASABKA4yCy5EYXRlRm9ybWF0UgpkYXRlRm9ybWF0EiwKC3RpbWVfZm9ybWF0GAIgASgOMgsuVGltZUZvcm1hdFIKdGltZUZvcm1hdA==');
@$core.Deprecated('Use singleSelectDescriptor instead')
const SingleSelect$json = const {
'1': 'SingleSelect',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `SingleSelect`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List singleSelectDescriptor = $convert.base64Decode('CgxTaW5nbGVTZWxlY3QSJwoHb3B0aW9ucxgBIAMoCzINLlNlbGVjdE9wdGlvblIHb3B0aW9ucxIjCg1kaXNhYmxlX2NvbG9yGAIgASgIUgxkaXNhYmxlQ29sb3I=');
@$core.Deprecated('Use multiSelectDescriptor instead')
const MultiSelect$json = const {
'1': 'MultiSelect',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `MultiSelect`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List multiSelectDescriptor = $convert.base64Decode('CgtNdWx0aVNlbGVjdBInCgdvcHRpb25zGAEgAygLMg0uU2VsZWN0T3B0aW9uUgdvcHRpb25zEiMKDWRpc2FibGVfY29sb3IYAiABKAhSDGRpc2FibGVDb2xvcg==');
@$core.Deprecated('Use selectOptionDescriptor instead')
const SelectOption$json = const {
'1': 'SelectOption',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
const {'1': 'color', '3': 3, '4': 1, '5': 9, '10': 'color'},
],
};
/// Descriptor for `SelectOption`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List selectOptionDescriptor = $convert.base64Decode('CgxTZWxlY3RPcHRpb24SDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSFAoFY29sb3IYAyABKAlSBWNvbG9y');
@$core.Deprecated('Use numberDescriptionDescriptor instead')
const NumberDescription$json = const {
'1': 'NumberDescription',
'2': const [
const {'1': 'money', '3': 1, '4': 1, '5': 14, '6': '.FlowyMoney', '10': 'money'},
const {'1': 'scale', '3': 2, '4': 1, '5': 13, '10': 'scale'},
const {'1': 'symbol', '3': 3, '4': 1, '5': 9, '10': 'symbol'},
const {'1': 'sign_positive', '3': 4, '4': 1, '5': 8, '10': 'signPositive'},
const {'1': 'name', '3': 5, '4': 1, '5': 9, '10': 'name'},
],
};
/// Descriptor for `NumberDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List numberDescriptionDescriptor = $convert.base64Decode('ChFOdW1iZXJEZXNjcmlwdGlvbhIhCgVtb25leRgBIAEoDjILLkZsb3d5TW9uZXlSBW1vbmV5EhQKBXNjYWxlGAIgASgNUgVzY2FsZRIWCgZzeW1ib2wYAyABKAlSBnN5bWJvbBIjCg1zaWduX3Bvc2l0aXZlGAQgASgIUgxzaWduUG9zaXRpdmUSEgoEbmFtZRgFIAEoCVIEbmFtZQ==');

View File

@ -1,58 +0,0 @@
///
// Generated code. Do not modify.
// source: checkbox_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class CheckboxTypeOption extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckboxTypeOption', createEmptyInstance: create)
..aOB(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isSelected')
..hasRequiredFields = false
;
CheckboxTypeOption._() : super();
factory CheckboxTypeOption({
$core.bool? isSelected,
}) {
final _result = create();
if (isSelected != null) {
_result.isSelected = isSelected;
}
return _result;
}
factory CheckboxTypeOption.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory CheckboxTypeOption.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
CheckboxTypeOption clone() => CheckboxTypeOption()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
CheckboxTypeOption copyWith(void Function(CheckboxTypeOption) updates) => super.copyWith((message) => updates(message as CheckboxTypeOption)) as CheckboxTypeOption; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static CheckboxTypeOption create() => CheckboxTypeOption._();
CheckboxTypeOption createEmptyInstance() => create();
static $pb.PbList<CheckboxTypeOption> createRepeated() => $pb.PbList<CheckboxTypeOption>();
@$core.pragma('dart2js:noInline')
static CheckboxTypeOption getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CheckboxTypeOption>(create);
static CheckboxTypeOption? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get isSelected => $_getBF(0);
@$pb.TagNumber(1)
set isSelected($core.bool v) { $_setBool(0, v); }
@$pb.TagNumber(1)
$core.bool hasIsSelected() => $_has(0);
@$pb.TagNumber(1)
void clearIsSelected() => clearField(1);
}

View File

@ -1,20 +0,0 @@
///
// Generated code. Do not modify.
// source: checkbox_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use checkboxTypeOptionDescriptor instead')
const CheckboxTypeOption$json = const {
'1': 'CheckboxTypeOption',
'2': const [
const {'1': 'is_selected', '3': 1, '4': 1, '5': 8, '10': 'isSelected'},
],
};
/// Descriptor for `CheckboxTypeOption`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List checkboxTypeOptionDescriptor = $convert.base64Decode('ChJDaGVja2JveFR5cGVPcHRpb24SHwoLaXNfc2VsZWN0ZWQYASABKAhSCmlzU2VsZWN0ZWQ=');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: checkbox_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'checkbox_description.pb.dart';

View File

@ -1,76 +0,0 @@
///
// Generated code. Do not modify.
// source: date_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
import 'date_description.pbenum.dart';
export 'date_description.pbenum.dart';
class DateDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DateDescription', createEmptyInstance: create)
..e<DateFormat>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dateFormat', $pb.PbFieldType.OE, defaultOrMaker: DateFormat.Local, valueOf: DateFormat.valueOf, enumValues: DateFormat.values)
..e<TimeFormat>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timeFormat', $pb.PbFieldType.OE, defaultOrMaker: TimeFormat.TwelveHour, valueOf: TimeFormat.valueOf, enumValues: TimeFormat.values)
..hasRequiredFields = false
;
DateDescription._() : super();
factory DateDescription({
DateFormat? dateFormat,
TimeFormat? timeFormat,
}) {
final _result = create();
if (dateFormat != null) {
_result.dateFormat = dateFormat;
}
if (timeFormat != null) {
_result.timeFormat = timeFormat;
}
return _result;
}
factory DateDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory DateDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
DateDescription clone() => DateDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
DateDescription copyWith(void Function(DateDescription) updates) => super.copyWith((message) => updates(message as DateDescription)) as DateDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static DateDescription create() => DateDescription._();
DateDescription createEmptyInstance() => create();
static $pb.PbList<DateDescription> createRepeated() => $pb.PbList<DateDescription>();
@$core.pragma('dart2js:noInline')
static DateDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DateDescription>(create);
static DateDescription? _defaultInstance;
@$pb.TagNumber(1)
DateFormat get dateFormat => $_getN(0);
@$pb.TagNumber(1)
set dateFormat(DateFormat v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasDateFormat() => $_has(0);
@$pb.TagNumber(1)
void clearDateFormat() => clearField(1);
@$pb.TagNumber(2)
TimeFormat get timeFormat => $_getN(1);
@$pb.TagNumber(2)
set timeFormat(TimeFormat v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasTimeFormat() => $_has(1);
@$pb.TagNumber(2)
void clearTimeFormat() => clearField(2);
}

View File

@ -1,45 +0,0 @@
///
// Generated code. Do not modify.
// source: date_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
// ignore_for_file: UNDEFINED_SHOWN_NAME
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class DateFormat extends $pb.ProtobufEnum {
static const DateFormat Local = DateFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Local');
static const DateFormat US = DateFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'US');
static const DateFormat ISO = DateFormat._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ISO');
static const DateFormat Friendly = DateFormat._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Friendly');
static const $core.List<DateFormat> values = <DateFormat> [
Local,
US,
ISO,
Friendly,
];
static final $core.Map<$core.int, DateFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static DateFormat? valueOf($core.int value) => _byValue[value];
const DateFormat._($core.int v, $core.String n) : super(v, n);
}
class TimeFormat extends $pb.ProtobufEnum {
static const TimeFormat TwelveHour = TimeFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwelveHour');
static const TimeFormat TwentyFourHour = TimeFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwentyFourHour');
static const $core.List<TimeFormat> values = <TimeFormat> [
TwelveHour,
TwentyFourHour,
];
static final $core.Map<$core.int, TimeFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static TimeFormat? valueOf($core.int value) => _byValue[value];
const TimeFormat._($core.int v, $core.String n) : super(v, n);
}

View File

@ -1,45 +0,0 @@
///
// Generated code. Do not modify.
// source: date_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use dateFormatDescriptor instead')
const DateFormat$json = const {
'1': 'DateFormat',
'2': const [
const {'1': 'Local', '2': 0},
const {'1': 'US', '2': 1},
const {'1': 'ISO', '2': 2},
const {'1': 'Friendly', '2': 3},
],
};
/// Descriptor for `DateFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List dateFormatDescriptor = $convert.base64Decode('CgpEYXRlRm9ybWF0EgkKBUxvY2FsEAASBgoCVVMQARIHCgNJU08QAhIMCghGcmllbmRseRAD');
@$core.Deprecated('Use timeFormatDescriptor instead')
const TimeFormat$json = const {
'1': 'TimeFormat',
'2': const [
const {'1': 'TwelveHour', '2': 0},
const {'1': 'TwentyFourHour', '2': 1},
],
};
/// Descriptor for `TimeFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List timeFormatDescriptor = $convert.base64Decode('CgpUaW1lRm9ybWF0Eg4KClR3ZWx2ZUhvdXIQABISCg5Ud2VudHlGb3VySG91chAB');
@$core.Deprecated('Use dateDescriptionDescriptor instead')
const DateDescription$json = const {
'1': 'DateDescription',
'2': const [
const {'1': 'date_format', '3': 1, '4': 1, '5': 14, '6': '.DateFormat', '10': 'dateFormat'},
const {'1': 'time_format', '3': 2, '4': 1, '5': 14, '6': '.TimeFormat', '10': 'timeFormat'},
],
};
/// Descriptor for `DateDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dateDescriptionDescriptor = $convert.base64Decode('Cg9EYXRlRGVzY3JpcHRpb24SLAoLZGF0ZV9mb3JtYXQYASABKA4yCy5EYXRlRm9ybWF0UgpkYXRlRm9ybWF0EiwKC3RpbWVfZm9ybWF0GAIgASgOMgsuVGltZUZvcm1hdFIKdGltZUZvcm1hdA==');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: date_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'date_description.pb.dart';

View File

@ -15,6 +15,7 @@ class GridEvent extends $pb.ProtobufEnum {
static const GridEvent GetFields = GridEvent._(10, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'GetFields');
static const GridEvent UpdateField = GridEvent._(11, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UpdateField');
static const GridEvent CreateField = GridEvent._(12, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CreateField');
static const GridEvent CreateDefaultField = GridEvent._(13, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CreateDefaultField');
static const GridEvent CreateRow = GridEvent._(21, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CreateRow');
static const GridEvent GetRow = GridEvent._(22, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'GetRow');
static const GridEvent UpdateCell = GridEvent._(30, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'UpdateCell');
@ -25,6 +26,7 @@ class GridEvent extends $pb.ProtobufEnum {
GetFields,
UpdateField,
CreateField,
CreateDefaultField,
CreateRow,
GetRow,
UpdateCell,

View File

@ -17,6 +17,7 @@ const GridEvent$json = const {
const {'1': 'GetFields', '2': 10},
const {'1': 'UpdateField', '2': 11},
const {'1': 'CreateField', '2': 12},
const {'1': 'CreateDefaultField', '2': 13},
const {'1': 'CreateRow', '2': 21},
const {'1': 'GetRow', '2': 22},
const {'1': 'UpdateCell', '2': 30},
@ -24,4 +25,4 @@ const GridEvent$json = const {
};
/// Descriptor for `GridEvent`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List gridEventDescriptor = $convert.base64Decode('CglHcmlkRXZlbnQSDwoLR2V0R3JpZERhdGEQABIRCg1HZXRHcmlkQmxvY2tzEAESDQoJR2V0RmllbGRzEAoSDwoLVXBkYXRlRmllbGQQCxIPCgtDcmVhdGVGaWVsZBAMEg0KCUNyZWF0ZVJvdxAVEgoKBkdldFJvdxAWEg4KClVwZGF0ZUNlbGwQHg==');
final $typed_data.Uint8List gridEventDescriptor = $convert.base64Decode('CglHcmlkRXZlbnQSDwoLR2V0R3JpZERhdGEQABIRCg1HZXRHcmlkQmxvY2tzEAESDQoJR2V0RmllbGRzEAoSDwoLVXBkYXRlRmllbGQQCxIPCgtDcmVhdGVGaWVsZBAMEhYKEkNyZWF0ZURlZmF1bHRGaWVsZBANEg0KCUNyZWF0ZVJvdxAVEgoKBkdldFJvdxAWEg4KClVwZGF0ZUNlbGwQHg==');

View File

@ -1,118 +0,0 @@
///
// Generated code. Do not modify.
// source: number_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
import 'number_description.pbenum.dart';
export 'number_description.pbenum.dart';
class NumberDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NumberDescription', createEmptyInstance: create)
..e<NumberFormat>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format', $pb.PbFieldType.OE, defaultOrMaker: NumberFormat.Number, valueOf: NumberFormat.valueOf, enumValues: NumberFormat.values)
..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scale', $pb.PbFieldType.OU3)
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'symbol')
..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signPositive')
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..hasRequiredFields = false
;
NumberDescription._() : super();
factory NumberDescription({
NumberFormat? format,
$core.int? scale,
$core.String? symbol,
$core.bool? signPositive,
$core.String? name,
}) {
final _result = create();
if (format != null) {
_result.format = format;
}
if (scale != null) {
_result.scale = scale;
}
if (symbol != null) {
_result.symbol = symbol;
}
if (signPositive != null) {
_result.signPositive = signPositive;
}
if (name != null) {
_result.name = name;
}
return _result;
}
factory NumberDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory NumberDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
NumberDescription clone() => NumberDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
NumberDescription copyWith(void Function(NumberDescription) updates) => super.copyWith((message) => updates(message as NumberDescription)) as NumberDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static NumberDescription create() => NumberDescription._();
NumberDescription createEmptyInstance() => create();
static $pb.PbList<NumberDescription> createRepeated() => $pb.PbList<NumberDescription>();
@$core.pragma('dart2js:noInline')
static NumberDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<NumberDescription>(create);
static NumberDescription? _defaultInstance;
@$pb.TagNumber(1)
NumberFormat get format => $_getN(0);
@$pb.TagNumber(1)
set format(NumberFormat v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasFormat() => $_has(0);
@$pb.TagNumber(1)
void clearFormat() => clearField(1);
@$pb.TagNumber(2)
$core.int get scale => $_getIZ(1);
@$pb.TagNumber(2)
set scale($core.int v) { $_setUnsignedInt32(1, v); }
@$pb.TagNumber(2)
$core.bool hasScale() => $_has(1);
@$pb.TagNumber(2)
void clearScale() => clearField(2);
@$pb.TagNumber(3)
$core.String get symbol => $_getSZ(2);
@$pb.TagNumber(3)
set symbol($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasSymbol() => $_has(2);
@$pb.TagNumber(3)
void clearSymbol() => clearField(3);
@$pb.TagNumber(4)
$core.bool get signPositive => $_getBF(3);
@$pb.TagNumber(4)
set signPositive($core.bool v) { $_setBool(3, v); }
@$pb.TagNumber(4)
$core.bool hasSignPositive() => $_has(3);
@$pb.TagNumber(4)
void clearSignPositive() => clearField(4);
@$pb.TagNumber(5)
$core.String get name => $_getSZ(4);
@$pb.TagNumber(5)
set name($core.String v) { $_setString(4, v); }
@$pb.TagNumber(5)
$core.bool hasName() => $_has(4);
@$pb.TagNumber(5)
void clearName() => clearField(5);
}

View File

@ -1,30 +0,0 @@
///
// Generated code. Do not modify.
// source: number_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
// ignore_for_file: UNDEFINED_SHOWN_NAME
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class NumberFormat extends $pb.ProtobufEnum {
static const NumberFormat Number = NumberFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Number');
static const NumberFormat USD = NumberFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'USD');
static const NumberFormat CNY = NumberFormat._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CNY');
static const NumberFormat EUR = NumberFormat._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EUR');
static const $core.List<NumberFormat> values = <NumberFormat> [
Number,
USD,
CNY,
EUR,
];
static final $core.Map<$core.int, NumberFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static NumberFormat? valueOf($core.int value) => _byValue[value];
const NumberFormat._($core.int v, $core.String n) : super(v, n);
}

View File

@ -1,37 +0,0 @@
///
// Generated code. Do not modify.
// source: number_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use numberFormatDescriptor instead')
const NumberFormat$json = const {
'1': 'NumberFormat',
'2': const [
const {'1': 'Number', '2': 0},
const {'1': 'USD', '2': 1},
const {'1': 'CNY', '2': 2},
const {'1': 'EUR', '2': 3},
],
};
/// Descriptor for `NumberFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List numberFormatDescriptor = $convert.base64Decode('CgxOdW1iZXJGb3JtYXQSCgoGTnVtYmVyEAASBwoDVVNEEAESBwoDQ05ZEAISBwoDRVVSEAM=');
@$core.Deprecated('Use numberDescriptionDescriptor instead')
const NumberDescription$json = const {
'1': 'NumberDescription',
'2': const [
const {'1': 'format', '3': 1, '4': 1, '5': 14, '6': '.NumberFormat', '10': 'format'},
const {'1': 'scale', '3': 2, '4': 1, '5': 13, '10': 'scale'},
const {'1': 'symbol', '3': 3, '4': 1, '5': 9, '10': 'symbol'},
const {'1': 'sign_positive', '3': 4, '4': 1, '5': 8, '10': 'signPositive'},
const {'1': 'name', '3': 5, '4': 1, '5': 9, '10': 'name'},
],
};
/// Descriptor for `NumberDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List numberDescriptionDescriptor = $convert.base64Decode('ChFOdW1iZXJEZXNjcmlwdGlvbhIlCgZmb3JtYXQYASABKA4yDS5OdW1iZXJGb3JtYXRSBmZvcm1hdBIUCgVzY2FsZRgCIAEoDVIFc2NhbGUSFgoGc3ltYm9sGAMgASgJUgZzeW1ib2wSIwoNc2lnbl9wb3NpdGl2ZRgEIAEoCFIMc2lnblBvc2l0aXZlEhIKBG5hbWUYBSABKAlSBG5hbWU=');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: number_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'number_description.pb.dart';

View File

@ -1,8 +1,8 @@
// Auto-generated, do not edit
export './number_type_option.pb.dart';
export './text_description.pb.dart';
export './dart_notification.pb.dart';
export './selection_type_option.pb.dart';
export './checkbox_type_option.pb.dart';
export './event_map.pb.dart';
export './text_type_option.pb.dart';
export './date_type_option.pb.dart';

View File

@ -1,196 +0,0 @@
///
// Generated code. Do not modify.
// source: selection_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class SingleSelectDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SingleSelectDescription', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
SingleSelectDescription._() : super();
factory SingleSelectDescription({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory SingleSelectDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SingleSelectDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SingleSelectDescription clone() => SingleSelectDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SingleSelectDescription copyWith(void Function(SingleSelectDescription) updates) => super.copyWith((message) => updates(message as SingleSelectDescription)) as SingleSelectDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SingleSelectDescription create() => SingleSelectDescription._();
SingleSelectDescription createEmptyInstance() => create();
static $pb.PbList<SingleSelectDescription> createRepeated() => $pb.PbList<SingleSelectDescription>();
@$core.pragma('dart2js:noInline')
static SingleSelectDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SingleSelectDescription>(create);
static SingleSelectDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class MultiSelectDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MultiSelectDescription', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
MultiSelectDescription._() : super();
factory MultiSelectDescription({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory MultiSelectDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory MultiSelectDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
MultiSelectDescription clone() => MultiSelectDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
MultiSelectDescription copyWith(void Function(MultiSelectDescription) updates) => super.copyWith((message) => updates(message as MultiSelectDescription)) as MultiSelectDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static MultiSelectDescription create() => MultiSelectDescription._();
MultiSelectDescription createEmptyInstance() => create();
static $pb.PbList<MultiSelectDescription> createRepeated() => $pb.PbList<MultiSelectDescription>();
@$core.pragma('dart2js:noInline')
static MultiSelectDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MultiSelectDescription>(create);
static MultiSelectDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class SelectOption extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SelectOption', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'color')
..hasRequiredFields = false
;
SelectOption._() : super();
factory SelectOption({
$core.String? id,
$core.String? name,
$core.String? color,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (color != null) {
_result.color = color;
}
return _result;
}
factory SelectOption.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SelectOption.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SelectOption clone() => SelectOption()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SelectOption copyWith(void Function(SelectOption) updates) => super.copyWith((message) => updates(message as SelectOption)) as SelectOption; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SelectOption create() => SelectOption._();
SelectOption createEmptyInstance() => create();
static $pb.PbList<SelectOption> createRepeated() => $pb.PbList<SelectOption>();
@$core.pragma('dart2js:noInline')
static SelectOption getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SelectOption>(create);
static SelectOption? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
@$pb.TagNumber(1)
void clearId() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get color => $_getSZ(2);
@$pb.TagNumber(3)
set color($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasColor() => $_has(2);
@$pb.TagNumber(3)
void clearColor() => clearField(3);
}

View File

@ -1,7 +0,0 @@
///
// Generated code. Do not modify.
// source: selection_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields

View File

@ -1,44 +0,0 @@
///
// Generated code. Do not modify.
// source: selection_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use singleSelectDescriptionDescriptor instead')
const SingleSelectDescription$json = const {
'1': 'SingleSelectDescription',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `SingleSelectDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List singleSelectDescriptionDescriptor = $convert.base64Decode('ChdTaW5nbGVTZWxlY3REZXNjcmlwdGlvbhInCgdvcHRpb25zGAEgAygLMg0uU2VsZWN0T3B0aW9uUgdvcHRpb25zEiMKDWRpc2FibGVfY29sb3IYAiABKAhSDGRpc2FibGVDb2xvcg==');
@$core.Deprecated('Use multiSelectDescriptionDescriptor instead')
const MultiSelectDescription$json = const {
'1': 'MultiSelectDescription',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `MultiSelectDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List multiSelectDescriptionDescriptor = $convert.base64Decode('ChZNdWx0aVNlbGVjdERlc2NyaXB0aW9uEicKB29wdGlvbnMYASADKAsyDS5TZWxlY3RPcHRpb25SB29wdGlvbnMSIwoNZGlzYWJsZV9jb2xvchgCIAEoCFIMZGlzYWJsZUNvbG9y');
@$core.Deprecated('Use selectOptionDescriptor instead')
const SelectOption$json = const {
'1': 'SelectOption',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
const {'1': 'color', '3': 3, '4': 1, '5': 9, '10': 'color'},
],
};
/// Descriptor for `SelectOption`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List selectOptionDescriptor = $convert.base64Decode('CgxTZWxlY3RPcHRpb24SDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSFAoFY29sb3IYAyABKAlSBWNvbG9y');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: selection_description.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'selection_description.pb.dart';

View File

@ -0,0 +1,58 @@
///
// Generated code. Do not modify.
// source: text_type_option.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class RichTextTypeOption extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RichTextTypeOption', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format')
..hasRequiredFields = false
;
RichTextTypeOption._() : super();
factory RichTextTypeOption({
$core.String? format,
}) {
final _result = create();
if (format != null) {
_result.format = format;
}
return _result;
}
factory RichTextTypeOption.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory RichTextTypeOption.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
RichTextTypeOption clone() => RichTextTypeOption()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
RichTextTypeOption copyWith(void Function(RichTextTypeOption) updates) => super.copyWith((message) => updates(message as RichTextTypeOption)) as RichTextTypeOption; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RichTextTypeOption create() => RichTextTypeOption._();
RichTextTypeOption createEmptyInstance() => create();
static $pb.PbList<RichTextTypeOption> createRepeated() => $pb.PbList<RichTextTypeOption>();
@$core.pragma('dart2js:noInline')
static RichTextTypeOption getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RichTextTypeOption>(create);
static RichTextTypeOption? _defaultInstance;
@$pb.TagNumber(1)
$core.String get format => $_getSZ(0);
@$pb.TagNumber(1)
set format($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasFormat() => $_has(0);
@$pb.TagNumber(1)
void clearFormat() => clearField(1);
}

View File

@ -1,6 +1,6 @@
///
// Generated code. Do not modify.
// source: checkbox_description.proto
// source: text_type_option.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields

View File

@ -0,0 +1,20 @@
///
// Generated code. Do not modify.
// source: text_type_option.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use richTextTypeOptionDescriptor instead')
const RichTextTypeOption$json = const {
'1': 'RichTextTypeOption',
'2': const [
const {'1': 'format', '3': 1, '4': 1, '5': 9, '10': 'format'},
],
};
/// Descriptor for `RichTextTypeOption`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List richTextTypeOptionDescriptor = $convert.base64Decode('ChJSaWNoVGV4dFR5cGVPcHRpb24SFgoGZm9ybWF0GAEgASgJUgZmb3JtYXQ=');

View File

@ -1,9 +1,9 @@
///
// Generated code. Do not modify.
// source: cell_data.proto
// source: text_type_option.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'cell_data.pb.dart';
export 'text_type_option.pb.dart';

View File

@ -1,458 +0,0 @@
///
// Generated code. Do not modify.
// source: type_options.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
import 'type_options.pbenum.dart';
export 'type_options.pbenum.dart';
class RichTextDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'RichTextDescription', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format')
..hasRequiredFields = false
;
RichTextDescription._() : super();
factory RichTextDescription({
$core.String? format,
}) {
final _result = create();
if (format != null) {
_result.format = format;
}
return _result;
}
factory RichTextDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory RichTextDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
RichTextDescription clone() => RichTextDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
RichTextDescription copyWith(void Function(RichTextDescription) updates) => super.copyWith((message) => updates(message as RichTextDescription)) as RichTextDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static RichTextDescription create() => RichTextDescription._();
RichTextDescription createEmptyInstance() => create();
static $pb.PbList<RichTextDescription> createRepeated() => $pb.PbList<RichTextDescription>();
@$core.pragma('dart2js:noInline')
static RichTextDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<RichTextDescription>(create);
static RichTextDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.String get format => $_getSZ(0);
@$pb.TagNumber(1)
set format($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasFormat() => $_has(0);
@$pb.TagNumber(1)
void clearFormat() => clearField(1);
}
class CheckboxDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CheckboxDescription', createEmptyInstance: create)
..aOB(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'isSelected')
..hasRequiredFields = false
;
CheckboxDescription._() : super();
factory CheckboxDescription({
$core.bool? isSelected,
}) {
final _result = create();
if (isSelected != null) {
_result.isSelected = isSelected;
}
return _result;
}
factory CheckboxDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory CheckboxDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
CheckboxDescription clone() => CheckboxDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
CheckboxDescription copyWith(void Function(CheckboxDescription) updates) => super.copyWith((message) => updates(message as CheckboxDescription)) as CheckboxDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static CheckboxDescription create() => CheckboxDescription._();
CheckboxDescription createEmptyInstance() => create();
static $pb.PbList<CheckboxDescription> createRepeated() => $pb.PbList<CheckboxDescription>();
@$core.pragma('dart2js:noInline')
static CheckboxDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CheckboxDescription>(create);
static CheckboxDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.bool get isSelected => $_getBF(0);
@$pb.TagNumber(1)
set isSelected($core.bool v) { $_setBool(0, v); }
@$pb.TagNumber(1)
$core.bool hasIsSelected() => $_has(0);
@$pb.TagNumber(1)
void clearIsSelected() => clearField(1);
}
class DateDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DateDescription', createEmptyInstance: create)
..e<DateFormat>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'dateFormat', $pb.PbFieldType.OE, defaultOrMaker: DateFormat.Local, valueOf: DateFormat.valueOf, enumValues: DateFormat.values)
..e<TimeFormat>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'timeFormat', $pb.PbFieldType.OE, defaultOrMaker: TimeFormat.TwelveHour, valueOf: TimeFormat.valueOf, enumValues: TimeFormat.values)
..hasRequiredFields = false
;
DateDescription._() : super();
factory DateDescription({
DateFormat? dateFormat,
TimeFormat? timeFormat,
}) {
final _result = create();
if (dateFormat != null) {
_result.dateFormat = dateFormat;
}
if (timeFormat != null) {
_result.timeFormat = timeFormat;
}
return _result;
}
factory DateDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory DateDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
DateDescription clone() => DateDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
DateDescription copyWith(void Function(DateDescription) updates) => super.copyWith((message) => updates(message as DateDescription)) as DateDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static DateDescription create() => DateDescription._();
DateDescription createEmptyInstance() => create();
static $pb.PbList<DateDescription> createRepeated() => $pb.PbList<DateDescription>();
@$core.pragma('dart2js:noInline')
static DateDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<DateDescription>(create);
static DateDescription? _defaultInstance;
@$pb.TagNumber(1)
DateFormat get dateFormat => $_getN(0);
@$pb.TagNumber(1)
set dateFormat(DateFormat v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasDateFormat() => $_has(0);
@$pb.TagNumber(1)
void clearDateFormat() => clearField(1);
@$pb.TagNumber(2)
TimeFormat get timeFormat => $_getN(1);
@$pb.TagNumber(2)
set timeFormat(TimeFormat v) { setField(2, v); }
@$pb.TagNumber(2)
$core.bool hasTimeFormat() => $_has(1);
@$pb.TagNumber(2)
void clearTimeFormat() => clearField(2);
}
class SingleSelectDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SingleSelectDescription', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
SingleSelectDescription._() : super();
factory SingleSelectDescription({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory SingleSelectDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SingleSelectDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SingleSelectDescription clone() => SingleSelectDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SingleSelectDescription copyWith(void Function(SingleSelectDescription) updates) => super.copyWith((message) => updates(message as SingleSelectDescription)) as SingleSelectDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SingleSelectDescription create() => SingleSelectDescription._();
SingleSelectDescription createEmptyInstance() => create();
static $pb.PbList<SingleSelectDescription> createRepeated() => $pb.PbList<SingleSelectDescription>();
@$core.pragma('dart2js:noInline')
static SingleSelectDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SingleSelectDescription>(create);
static SingleSelectDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class MultiSelectDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'MultiSelectDescription', createEmptyInstance: create)
..pc<SelectOption>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'options', $pb.PbFieldType.PM, subBuilder: SelectOption.create)
..aOB(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'disableColor')
..hasRequiredFields = false
;
MultiSelectDescription._() : super();
factory MultiSelectDescription({
$core.Iterable<SelectOption>? options,
$core.bool? disableColor,
}) {
final _result = create();
if (options != null) {
_result.options.addAll(options);
}
if (disableColor != null) {
_result.disableColor = disableColor;
}
return _result;
}
factory MultiSelectDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory MultiSelectDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
MultiSelectDescription clone() => MultiSelectDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
MultiSelectDescription copyWith(void Function(MultiSelectDescription) updates) => super.copyWith((message) => updates(message as MultiSelectDescription)) as MultiSelectDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static MultiSelectDescription create() => MultiSelectDescription._();
MultiSelectDescription createEmptyInstance() => create();
static $pb.PbList<MultiSelectDescription> createRepeated() => $pb.PbList<MultiSelectDescription>();
@$core.pragma('dart2js:noInline')
static MultiSelectDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<MultiSelectDescription>(create);
static MultiSelectDescription? _defaultInstance;
@$pb.TagNumber(1)
$core.List<SelectOption> get options => $_getList(0);
@$pb.TagNumber(2)
$core.bool get disableColor => $_getBF(1);
@$pb.TagNumber(2)
set disableColor($core.bool v) { $_setBool(1, v); }
@$pb.TagNumber(2)
$core.bool hasDisableColor() => $_has(1);
@$pb.TagNumber(2)
void clearDisableColor() => clearField(2);
}
class SelectOption extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SelectOption', createEmptyInstance: create)
..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id')
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'color')
..hasRequiredFields = false
;
SelectOption._() : super();
factory SelectOption({
$core.String? id,
$core.String? name,
$core.String? color,
}) {
final _result = create();
if (id != null) {
_result.id = id;
}
if (name != null) {
_result.name = name;
}
if (color != null) {
_result.color = color;
}
return _result;
}
factory SelectOption.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory SelectOption.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
SelectOption clone() => SelectOption()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
SelectOption copyWith(void Function(SelectOption) updates) => super.copyWith((message) => updates(message as SelectOption)) as SelectOption; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static SelectOption create() => SelectOption._();
SelectOption createEmptyInstance() => create();
static $pb.PbList<SelectOption> createRepeated() => $pb.PbList<SelectOption>();
@$core.pragma('dart2js:noInline')
static SelectOption getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SelectOption>(create);
static SelectOption? _defaultInstance;
@$pb.TagNumber(1)
$core.String get id => $_getSZ(0);
@$pb.TagNumber(1)
set id($core.String v) { $_setString(0, v); }
@$pb.TagNumber(1)
$core.bool hasId() => $_has(0);
@$pb.TagNumber(1)
void clearId() => clearField(1);
@$pb.TagNumber(2)
$core.String get name => $_getSZ(1);
@$pb.TagNumber(2)
set name($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasName() => $_has(1);
@$pb.TagNumber(2)
void clearName() => clearField(2);
@$pb.TagNumber(3)
$core.String get color => $_getSZ(2);
@$pb.TagNumber(3)
set color($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasColor() => $_has(2);
@$pb.TagNumber(3)
void clearColor() => clearField(3);
}
class NumberDescription extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NumberDescription', createEmptyInstance: create)
..e<MoneySymbol>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'money', $pb.PbFieldType.OE, defaultOrMaker: MoneySymbol.CNY, valueOf: MoneySymbol.valueOf, enumValues: MoneySymbol.values)
..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'scale', $pb.PbFieldType.OU3)
..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'symbol')
..aOB(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signPositive')
..aOS(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
..hasRequiredFields = false
;
NumberDescription._() : super();
factory NumberDescription({
MoneySymbol? money,
$core.int? scale,
$core.String? symbol,
$core.bool? signPositive,
$core.String? name,
}) {
final _result = create();
if (money != null) {
_result.money = money;
}
if (scale != null) {
_result.scale = scale;
}
if (symbol != null) {
_result.symbol = symbol;
}
if (signPositive != null) {
_result.signPositive = signPositive;
}
if (name != null) {
_result.name = name;
}
return _result;
}
factory NumberDescription.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory NumberDescription.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
NumberDescription clone() => NumberDescription()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
NumberDescription copyWith(void Function(NumberDescription) updates) => super.copyWith((message) => updates(message as NumberDescription)) as NumberDescription; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static NumberDescription create() => NumberDescription._();
NumberDescription createEmptyInstance() => create();
static $pb.PbList<NumberDescription> createRepeated() => $pb.PbList<NumberDescription>();
@$core.pragma('dart2js:noInline')
static NumberDescription getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<NumberDescription>(create);
static NumberDescription? _defaultInstance;
@$pb.TagNumber(1)
MoneySymbol get money => $_getN(0);
@$pb.TagNumber(1)
set money(MoneySymbol v) { setField(1, v); }
@$pb.TagNumber(1)
$core.bool hasMoney() => $_has(0);
@$pb.TagNumber(1)
void clearMoney() => clearField(1);
@$pb.TagNumber(2)
$core.int get scale => $_getIZ(1);
@$pb.TagNumber(2)
set scale($core.int v) { $_setUnsignedInt32(1, v); }
@$pb.TagNumber(2)
$core.bool hasScale() => $_has(1);
@$pb.TagNumber(2)
void clearScale() => clearField(2);
@$pb.TagNumber(3)
$core.String get symbol => $_getSZ(2);
@$pb.TagNumber(3)
set symbol($core.String v) { $_setString(2, v); }
@$pb.TagNumber(3)
$core.bool hasSymbol() => $_has(2);
@$pb.TagNumber(3)
void clearSymbol() => clearField(3);
@$pb.TagNumber(4)
$core.bool get signPositive => $_getBF(3);
@$pb.TagNumber(4)
set signPositive($core.bool v) { $_setBool(3, v); }
@$pb.TagNumber(4)
$core.bool hasSignPositive() => $_has(3);
@$pb.TagNumber(4)
void clearSignPositive() => clearField(4);
@$pb.TagNumber(5)
$core.String get name => $_getSZ(4);
@$pb.TagNumber(5)
set name($core.String v) { $_setString(4, v); }
@$pb.TagNumber(5)
$core.bool hasName() => $_has(4);
@$pb.TagNumber(5)
void clearName() => clearField(5);
}

View File

@ -1,62 +0,0 @@
///
// Generated code. Do not modify.
// source: type_options.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields
// ignore_for_file: UNDEFINED_SHOWN_NAME
import 'dart:core' as $core;
import 'package:protobuf/protobuf.dart' as $pb;
class DateFormat extends $pb.ProtobufEnum {
static const DateFormat Local = DateFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Local');
static const DateFormat US = DateFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'US');
static const DateFormat ISO = DateFormat._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ISO');
static const DateFormat Friendly = DateFormat._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Friendly');
static const $core.List<DateFormat> values = <DateFormat> [
Local,
US,
ISO,
Friendly,
];
static final $core.Map<$core.int, DateFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static DateFormat? valueOf($core.int value) => _byValue[value];
const DateFormat._($core.int v, $core.String n) : super(v, n);
}
class TimeFormat extends $pb.ProtobufEnum {
static const TimeFormat TwelveHour = TimeFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwelveHour');
static const TimeFormat TwentyFourHour = TimeFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TwentyFourHour');
static const $core.List<TimeFormat> values = <TimeFormat> [
TwelveHour,
TwentyFourHour,
];
static final $core.Map<$core.int, TimeFormat> _byValue = $pb.ProtobufEnum.initByValue(values);
static TimeFormat? valueOf($core.int value) => _byValue[value];
const TimeFormat._($core.int v, $core.String n) : super(v, n);
}
class MoneySymbol extends $pb.ProtobufEnum {
static const MoneySymbol CNY = MoneySymbol._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CNY');
static const MoneySymbol EUR = MoneySymbol._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'EUR');
static const MoneySymbol USD = MoneySymbol._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'USD');
static const $core.List<MoneySymbol> values = <MoneySymbol> [
CNY,
EUR,
USD,
];
static final $core.Map<$core.int, MoneySymbol> _byValue = $pb.ProtobufEnum.initByValue(values);
static MoneySymbol? valueOf($core.int value) => _byValue[value];
const MoneySymbol._($core.int v, $core.String n) : super(v, n);
}

View File

@ -1,125 +0,0 @@
///
// Generated code. Do not modify.
// source: type_options.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
import 'dart:core' as $core;
import 'dart:convert' as $convert;
import 'dart:typed_data' as $typed_data;
@$core.Deprecated('Use dateFormatDescriptor instead')
const DateFormat$json = const {
'1': 'DateFormat',
'2': const [
const {'1': 'Local', '2': 0},
const {'1': 'US', '2': 1},
const {'1': 'ISO', '2': 2},
const {'1': 'Friendly', '2': 3},
],
};
/// Descriptor for `DateFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List dateFormatDescriptor = $convert.base64Decode('CgpEYXRlRm9ybWF0EgkKBUxvY2FsEAASBgoCVVMQARIHCgNJU08QAhIMCghGcmllbmRseRAD');
@$core.Deprecated('Use timeFormatDescriptor instead')
const TimeFormat$json = const {
'1': 'TimeFormat',
'2': const [
const {'1': 'TwelveHour', '2': 0},
const {'1': 'TwentyFourHour', '2': 1},
],
};
/// Descriptor for `TimeFormat`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List timeFormatDescriptor = $convert.base64Decode('CgpUaW1lRm9ybWF0Eg4KClR3ZWx2ZUhvdXIQABISCg5Ud2VudHlGb3VySG91chAB');
@$core.Deprecated('Use moneySymbolDescriptor instead')
const MoneySymbol$json = const {
'1': 'MoneySymbol',
'2': const [
const {'1': 'CNY', '2': 0},
const {'1': 'EUR', '2': 1},
const {'1': 'USD', '2': 2},
],
};
/// Descriptor for `MoneySymbol`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List moneySymbolDescriptor = $convert.base64Decode('CgtNb25leVN5bWJvbBIHCgNDTlkQABIHCgNFVVIQARIHCgNVU0QQAg==');
@$core.Deprecated('Use richTextDescriptionDescriptor instead')
const RichTextDescription$json = const {
'1': 'RichTextDescription',
'2': const [
const {'1': 'format', '3': 1, '4': 1, '5': 9, '10': 'format'},
],
};
/// Descriptor for `RichTextDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List richTextDescriptionDescriptor = $convert.base64Decode('ChNSaWNoVGV4dERlc2NyaXB0aW9uEhYKBmZvcm1hdBgBIAEoCVIGZm9ybWF0');
@$core.Deprecated('Use checkboxDescriptionDescriptor instead')
const CheckboxDescription$json = const {
'1': 'CheckboxDescription',
'2': const [
const {'1': 'is_selected', '3': 1, '4': 1, '5': 8, '10': 'isSelected'},
],
};
/// Descriptor for `CheckboxDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List checkboxDescriptionDescriptor = $convert.base64Decode('ChNDaGVja2JveERlc2NyaXB0aW9uEh8KC2lzX3NlbGVjdGVkGAEgASgIUgppc1NlbGVjdGVk');
@$core.Deprecated('Use dateDescriptionDescriptor instead')
const DateDescription$json = const {
'1': 'DateDescription',
'2': const [
const {'1': 'date_format', '3': 1, '4': 1, '5': 14, '6': '.DateFormat', '10': 'dateFormat'},
const {'1': 'time_format', '3': 2, '4': 1, '5': 14, '6': '.TimeFormat', '10': 'timeFormat'},
],
};
/// Descriptor for `DateDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List dateDescriptionDescriptor = $convert.base64Decode('Cg9EYXRlRGVzY3JpcHRpb24SLAoLZGF0ZV9mb3JtYXQYASABKA4yCy5EYXRlRm9ybWF0UgpkYXRlRm9ybWF0EiwKC3RpbWVfZm9ybWF0GAIgASgOMgsuVGltZUZvcm1hdFIKdGltZUZvcm1hdA==');
@$core.Deprecated('Use singleSelectDescriptionDescriptor instead')
const SingleSelectDescription$json = const {
'1': 'SingleSelectDescription',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `SingleSelectDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List singleSelectDescriptionDescriptor = $convert.base64Decode('ChdTaW5nbGVTZWxlY3REZXNjcmlwdGlvbhInCgdvcHRpb25zGAEgAygLMg0uU2VsZWN0T3B0aW9uUgdvcHRpb25zEiMKDWRpc2FibGVfY29sb3IYAiABKAhSDGRpc2FibGVDb2xvcg==');
@$core.Deprecated('Use multiSelectDescriptionDescriptor instead')
const MultiSelectDescription$json = const {
'1': 'MultiSelectDescription',
'2': const [
const {'1': 'options', '3': 1, '4': 3, '5': 11, '6': '.SelectOption', '10': 'options'},
const {'1': 'disable_color', '3': 2, '4': 1, '5': 8, '10': 'disableColor'},
],
};
/// Descriptor for `MultiSelectDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List multiSelectDescriptionDescriptor = $convert.base64Decode('ChZNdWx0aVNlbGVjdERlc2NyaXB0aW9uEicKB29wdGlvbnMYASADKAsyDS5TZWxlY3RPcHRpb25SB29wdGlvbnMSIwoNZGlzYWJsZV9jb2xvchgCIAEoCFIMZGlzYWJsZUNvbG9y');
@$core.Deprecated('Use selectOptionDescriptor instead')
const SelectOption$json = const {
'1': 'SelectOption',
'2': const [
const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
const {'1': 'color', '3': 3, '4': 1, '5': 9, '10': 'color'},
],
};
/// Descriptor for `SelectOption`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List selectOptionDescriptor = $convert.base64Decode('CgxTZWxlY3RPcHRpb24SDgoCaWQYASABKAlSAmlkEhIKBG5hbWUYAiABKAlSBG5hbWUSFAoFY29sb3IYAyABKAlSBWNvbG9y');
@$core.Deprecated('Use numberDescriptionDescriptor instead')
const NumberDescription$json = const {
'1': 'NumberDescription',
'2': const [
const {'1': 'money', '3': 1, '4': 1, '5': 14, '6': '.MoneySymbol', '10': 'money'},
const {'1': 'scale', '3': 2, '4': 1, '5': 13, '10': 'scale'},
const {'1': 'symbol', '3': 3, '4': 1, '5': 9, '10': 'symbol'},
const {'1': 'sign_positive', '3': 4, '4': 1, '5': 8, '10': 'signPositive'},
const {'1': 'name', '3': 5, '4': 1, '5': 9, '10': 'name'},
],
};
/// Descriptor for `NumberDescription`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List numberDescriptionDescriptor = $convert.base64Decode('ChFOdW1iZXJEZXNjcmlwdGlvbhIiCgVtb25leRgBIAEoDjIMLk1vbmV5U3ltYm9sUgVtb25leRIUCgVzY2FsZRgCIAEoDVIFc2NhbGUSFgoGc3ltYm9sGAMgASgJUgZzeW1ib2wSIwoNc2lnbl9wb3NpdGl2ZRgEIAEoCFIMc2lnblBvc2l0aXZlEhIKBG5hbWUYBSABKAlSBG5hbWU=');

View File

@ -1,9 +0,0 @@
///
// Generated code. Do not modify.
// source: type_options.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package
export 'type_options.pb.dart';

View File

@ -112,6 +112,7 @@ flutter:
- assets/images/home/
- assets/images/editor/
- assets/images/grid/
- assets/images/grid/field/
- assets/translations/
# - images/a_dot_ham.jpeg

View File

@ -71,6 +71,17 @@ pub(crate) async fn create_field_handler(
Ok(())
}
#[tracing::instrument(level = "debug", skip(data, manager), err)]
pub(crate) async fn create_default_field_handler(
data: Data<GridId>,
manager: AppData<Arc<GridManager>>,
) -> DataResult<Field, FlowyError> {
let grid_id: GridId = data.into_inner();
let editor = manager.get_grid_editor(grid_id.as_ref())?;
let field = editor.make_default_field().await?;
data_result(field)
}
#[tracing::instrument(level = "debug", skip(data, manager), err)]
pub(crate) async fn get_row_handler(
data: Data<QueryRowPayload>,

View File

@ -13,6 +13,7 @@ pub fn create(grid_manager: Arc<GridManager>) -> Module {
.event(GridEvent::GetFields, get_fields_handler)
.event(GridEvent::UpdateField, update_field_handler)
.event(GridEvent::CreateField, create_field_handler)
.event(GridEvent::CreateDefaultField, create_default_field_handler)
.event(GridEvent::CreateRow, create_row_handler)
.event(GridEvent::GetRow, get_row_handler)
.event(GridEvent::UpdateCell, update_cell_handler);
@ -38,6 +39,9 @@ pub enum GridEvent {
#[event(input = "CreateFieldPayload")]
CreateField = 12,
#[event(input = "GridId", output = "Field")]
CreateDefaultField = 13,
#[event(input = "CreateRowPayload", output = "Row")]
CreateRow = 21,

View File

@ -30,6 +30,7 @@ pub enum GridEvent {
GetFields = 10,
UpdateField = 11,
CreateField = 12,
CreateDefaultField = 13,
CreateRow = 21,
GetRow = 22,
UpdateCell = 30,
@ -47,6 +48,7 @@ impl ::protobuf::ProtobufEnum for GridEvent {
10 => ::std::option::Option::Some(GridEvent::GetFields),
11 => ::std::option::Option::Some(GridEvent::UpdateField),
12 => ::std::option::Option::Some(GridEvent::CreateField),
13 => ::std::option::Option::Some(GridEvent::CreateDefaultField),
21 => ::std::option::Option::Some(GridEvent::CreateRow),
22 => ::std::option::Option::Some(GridEvent::GetRow),
30 => ::std::option::Option::Some(GridEvent::UpdateCell),
@ -61,6 +63,7 @@ impl ::protobuf::ProtobufEnum for GridEvent {
GridEvent::GetFields,
GridEvent::UpdateField,
GridEvent::CreateField,
GridEvent::CreateDefaultField,
GridEvent::CreateRow,
GridEvent::GetRow,
GridEvent::UpdateCell,
@ -92,11 +95,11 @@ impl ::protobuf::reflect::ProtobufValue for GridEvent {
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x0fevent_map.proto*\x8b\x01\n\tGridEvent\x12\x0f\n\x0bGetGridData\x10\
\n\x0fevent_map.proto*\xa3\x01\n\tGridEvent\x12\x0f\n\x0bGetGridData\x10\
\0\x12\x11\n\rGetGridBlocks\x10\x01\x12\r\n\tGetFields\x10\n\x12\x0f\n\
\x0bUpdateField\x10\x0b\x12\x0f\n\x0bCreateField\x10\x0c\x12\r\n\tCreate\
Row\x10\x15\x12\n\n\x06GetRow\x10\x16\x12\x0e\n\nUpdateCell\x10\x1eb\x06\
proto3\
\x0bUpdateField\x10\x0b\x12\x0f\n\x0bCreateField\x10\x0c\x12\x16\n\x12Cr\
eateDefaultField\x10\r\x12\r\n\tCreateRow\x10\x15\x12\n\n\x06GetRow\x10\
\x16\x12\x0e\n\nUpdateCell\x10\x1eb\x06proto3\
";
static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

View File

@ -4,9 +4,6 @@
mod number_type_option;
pub use number_type_option::*;
mod text_description;
pub use text_description::*;
mod dart_notification;
pub use dart_notification::*;
@ -19,5 +16,8 @@ pub use checkbox_type_option::*;
mod event_map;
pub use event_map::*;
mod text_type_option;
pub use text_type_option::*;
mod date_type_option;
pub use date_type_option::*;

View File

@ -17,7 +17,7 @@
#![allow(trivial_casts)]
#![allow(unused_imports)]
#![allow(unused_results)]
//! Generated file from `text_description.proto`
//! Generated file from `text_type_option.proto`
/// Generated files are compatible only with the same version
/// of protobuf runtime.
@ -183,7 +183,7 @@ impl ::protobuf::reflect::ProtobufValue for RichTextTypeOption {
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x16text_description.proto\",\n\x12RichTextTypeOption\x12\x16\n\x06for\
\n\x16text_type_option.proto\",\n\x12RichTextTypeOption\x12\x16\n\x06for\
mat\x18\x01\x20\x01(\tR\x06formatb\x06proto3\
";

View File

@ -6,6 +6,7 @@ enum GridEvent {
GetFields = 10;
UpdateField = 11;
CreateField = 12;
CreateDefaultField = 13;
CreateRow = 21;
GetRow = 22;
UpdateCell = 30;

View File

@ -1,19 +1,25 @@
use crate::services::field::type_options::*;
use flowy_grid_data_model::entities::{FieldMeta, FieldType};
pub struct FieldBuilder {
field_meta: FieldMeta,
type_options_builder: Box<dyn TypeOptionsBuilder>,
type_option_builder: Box<dyn TypeOptionsBuilder>,
}
impl FieldBuilder {
pub fn new<T: TypeOptionsBuilder + 'static>(type_options_builder: T) -> Self {
let field_meta = FieldMeta::new("Name", "", FieldType::RichText);
pub fn new<T: TypeOptionsBuilder + 'static>(type_option_builder: T) -> Self {
let field_meta = FieldMeta::new("", "", type_option_builder.field_type());
Self {
field_meta,
type_options_builder: Box::new(type_options_builder),
type_option_builder: Box::new(type_option_builder),
}
}
pub fn from_field_type(field_type: &FieldType) -> Self {
let type_option_builder = type_option_builder_from_type(field_type);
Self::new(type_option_builder)
}
pub fn name(mut self, name: &str) -> Self {
self.field_meta.name = name.to_owned();
self
@ -24,11 +30,6 @@ impl FieldBuilder {
self
}
pub fn field_type(mut self, field_type: FieldType) -> Self {
self.field_meta.field_type = field_type;
self
}
pub fn visibility(mut self, visibility: bool) -> Self {
self.field_meta.visibility = visibility;
self
@ -45,9 +46,8 @@ impl FieldBuilder {
}
pub fn build(mut self) -> FieldMeta {
assert_eq!(self.field_meta.field_type, self.type_options_builder.field_type());
let type_options = self.type_options_builder.build();
debug_assert_eq!(self.field_meta.field_type, self.type_option_builder.field_type());
let type_options = self.type_option_builder.build();
self.field_meta.type_option = type_options;
self.field_meta
}
@ -57,3 +57,27 @@ pub trait TypeOptionsBuilder {
fn field_type(&self) -> FieldType;
fn build(&self) -> String;
}
pub fn type_option_builder_from_type(field_type: &FieldType) -> Box<dyn TypeOptionsBuilder> {
match field_type {
FieldType::RichText => Box::new(RichTextTypeOptionBuilder::default()),
FieldType::Number => Box::new(NumberTypeOptionBuilder::default()),
FieldType::DateTime => Box::new(DateTypeOptionBuilder::default()),
FieldType::SingleSelect => Box::new(SingleSelectTypeOptionBuilder::default()),
FieldType::MultiSelect => Box::new(MultiSelectTypeOptionBuilder::default()),
FieldType::Checkbox => Box::new(CheckboxTypeOptionBuilder::default()),
}
}
impl<T> TypeOptionsBuilder for Box<T>
where
T: TypeOptionsBuilder + ?Sized,
{
fn field_type(&self) -> FieldType {
(**self).field_type()
}
fn build(&self) -> String {
(**self).build()
}
}

View File

@ -7,15 +7,15 @@ use flowy_grid_data_model::entities::{FieldMeta, FieldType};
use serde::{Deserialize, Serialize};
#[derive(Default)]
pub struct CheckboxTypeOptionsBuilder(CheckboxTypeOption);
impl CheckboxTypeOptionsBuilder {
pub struct CheckboxTypeOptionBuilder(CheckboxTypeOption);
impl CheckboxTypeOptionBuilder {
pub fn set_selected(mut self, is_selected: bool) -> Self {
self.0.is_selected = is_selected;
self
}
}
impl TypeOptionsBuilder for CheckboxTypeOptionsBuilder {
impl TypeOptionsBuilder for CheckboxTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}
@ -66,7 +66,7 @@ mod tests {
#[test]
fn checkout_box_description_test() {
let description = CheckboxTypeOption::default();
let type_option = CheckboxTypeOption::default();
assert_eq!(description.serialize_cell_data("true").unwrap(), "1".to_owned());
assert_eq!(description.serialize_cell_data("1").unwrap(), "1".to_owned());
assert_eq!(description.serialize_cell_data("yes").unwrap(), "1".to_owned());

View File

@ -63,8 +63,8 @@ impl CellDataSerde for DateTypeOption {
}
#[derive(Default)]
pub struct DateTypeOptionsBuilder(DateTypeOption);
impl DateTypeOptionsBuilder {
pub struct DateTypeOptionBuilder(DateTypeOption);
impl DateTypeOptionBuilder {
pub fn date_format(mut self, date_format: DateFormat) -> Self {
self.0.date_format = date_format;
self
@ -75,7 +75,7 @@ impl DateTypeOptionsBuilder {
self
}
}
impl TypeOptionsBuilder for DateTypeOptionsBuilder {
impl TypeOptionsBuilder for DateTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}
@ -258,7 +258,7 @@ mod tests {
#[test]
#[should_panic]
fn date_description_invalid_data_test() {
let description = DateTypeOption::default();
let type_option = DateTypeOption::default();
description.serialize_cell_data("he").unwrap();
}
}

View File

@ -2,10 +2,10 @@ mod checkbox_type_option;
mod date_type_option;
mod number_type_option;
mod selection_type_option;
mod text_description;
mod text_type_option;
pub use checkbox_type_option::*;
pub use date_type_option::*;
pub use number_type_option::*;
pub use selection_type_option::*;
pub use text_description::*;
pub use text_type_option::*;

View File

@ -19,9 +19,9 @@ lazy_static! {
}
#[derive(Default)]
pub struct NumberTypeOptionsBuilder(NumberTypeOption);
pub struct NumberTypeOptionBuilder(NumberTypeOption);
impl NumberTypeOptionsBuilder {
impl NumberTypeOptionBuilder {
pub fn name(mut self, name: &str) -> Self {
self.0.name = name.to_string();
self
@ -43,7 +43,7 @@ impl NumberTypeOptionsBuilder {
}
}
impl TypeOptionsBuilder for NumberTypeOptionsBuilder {
impl TypeOptionsBuilder for NumberTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}

View File

@ -33,15 +33,15 @@ impl CellDataSerde for SingleSelectTypeOption {
}
#[derive(Default)]
pub struct SingleSelectTypeOptionsBuilder(SingleSelectTypeOption);
pub struct SingleSelectTypeOptionBuilder(SingleSelectTypeOption);
impl SingleSelectTypeOptionsBuilder {
impl SingleSelectTypeOptionBuilder {
pub fn option(mut self, opt: SelectOption) -> Self {
self.0.options.push(opt);
self
}
}
impl TypeOptionsBuilder for SingleSelectTypeOptionsBuilder {
impl TypeOptionsBuilder for SingleSelectTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}
@ -72,15 +72,15 @@ impl CellDataSerde for MultiSelectTypeOption {
}
#[derive(Default)]
pub struct MultiSelectTypeOptionsBuilder(MultiSelectTypeOption);
impl MultiSelectTypeOptionsBuilder {
pub struct MultiSelectTypeOptionBuilder(MultiSelectTypeOption);
impl MultiSelectTypeOptionBuilder {
pub fn option(mut self, opt: SelectOption) -> Self {
self.0.options.push(opt);
self
}
}
impl TypeOptionsBuilder for MultiSelectTypeOptionsBuilder {
impl TypeOptionsBuilder for MultiSelectTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}
@ -157,10 +157,10 @@ mod tests {
#[test]
#[should_panic]
fn selection_description_test() {
let description = SingleSelectTypeOption::default();
let type_option = SingleSelectTypeOption::default();
assert_eq!(description.serialize_cell_data("1,2,3").unwrap(), "1".to_owned());
let description = MultiSelectDescription::default();
let type_option = MultiSelectDescription::default();
assert_eq!(description.serialize_cell_data("1,2,3").unwrap(), "1,2,3".to_owned());
}
}

View File

@ -8,9 +8,9 @@ use flowy_grid_data_model::entities::{FieldMeta, FieldType};
use serde::{Deserialize, Serialize};
#[derive(Default)]
pub struct RichTextTypeOptionsBuilder(RichTextTypeOption);
pub struct RichTextTypeOptionBuilder(RichTextTypeOption);
impl TypeOptionsBuilder for RichTextTypeOptionsBuilder {
impl TypeOptionsBuilder for RichTextTypeOptionBuilder {
fn field_type(&self) -> FieldType {
self.0.field_type()
}

View File

@ -1,25 +1,19 @@
use crate::dart_notification::{send_dart_notification, GridNotification};
use crate::manager::GridUser;
use crate::services::block_meta_editor::GridBlockMetaEditorManager;
use crate::services::field::{type_option_builder_from_type, FieldBuilder};
use crate::services::row::*;
use bytes::Bytes;
use flowy_error::{FlowyError, FlowyResult};
use flowy_grid_data_model::entities::{
CellMetaChangeset, Field, FieldChangeset, FieldMeta, Grid, GridBlockMeta, GridBlockMetaChangeset, GridBlockOrder,
RepeatedField, RepeatedFieldOrder, RepeatedGridBlock, RepeatedRow, Row, RowMeta, RowMetaChangeset, RowOrder,
};
use flowy_grid_data_model::entities::*;
use flowy_grid_data_model::parser::CreateFieldParams;
use flowy_revision::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder};
use flowy_sync::client_grid::{GridChangeset, GridMetaPad};
use flowy_sync::entities::revision::Revision;
use flowy_sync::util::make_delta_from_revisions;
use std::collections::HashMap;
use crate::dart_notification::{send_dart_notification, GridNotification};
use crate::services::row::{
make_grid_block_from_block_metas, make_grid_blocks, make_row_meta_from_context, make_rows_from_row_metas,
serialize_cell_data, CreateRowMetaBuilder, CreateRowMetaPayload, GridBlockMetaData,
};
use flowy_grid_data_model::parser::CreateFieldParams;
use flowy_revision::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder};
use lib_infra::future::FutureResult;
use lib_ot::core::PlainTextAttributes;
use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::RwLock;
@ -55,12 +49,25 @@ impl ClientGridEditor {
}))
}
pub async fn create_field(&self, params: CreateFieldParams) -> FlowyResult<()> {
pub async fn create_field(&self, mut params: CreateFieldParams) -> FlowyResult<()> {
if params.type_option_data.is_empty() {
params.type_option_data = type_option_builder_from_type(&params.field.field_type)
.build()
.as_bytes()
.to_vec();
}
let _ = self.modify(|grid| Ok(grid.create_field(params)?)).await?;
let _ = self.notify_did_update_fields().await?;
Ok(())
}
pub async fn make_default_field(&self) -> FlowyResult<Field> {
let field_type = FieldType::default();
let field_meta = FieldBuilder::from_field_type(&field_type).build();
Ok(field_meta.into())
}
pub async fn contain_field(&self, field_id: &str) -> bool {
self.pad.read().await.contain_field(field_id)
}

View File

@ -3,22 +3,17 @@ use flowy_grid_data_model::entities::{BuildGridContext, FieldType};
use flowy_sync::client_grid::GridBuilder;
pub fn make_default_grid() -> BuildGridContext {
let text_field = FieldBuilder::new(RichTextTypeOptionsBuilder::default())
let text_field = FieldBuilder::new(RichTextTypeOptionBuilder::default())
.name("Name")
.visibility(true)
.field_type(FieldType::RichText)
.build();
let single_select = SingleSelectTypeOptionsBuilder::default()
let single_select = SingleSelectTypeOptionBuilder::default()
.option(SelectOption::new("Done"))
.option(SelectOption::new("Unknown"))
.option(SelectOption::new("Progress"));
let single_select_field = FieldBuilder::new(single_select)
.name("Status")
.visibility(true)
.field_type(FieldType::SingleSelect)
.build();
let single_select_field = FieldBuilder::new(single_select).name("Status").visibility(true).build();
GridBuilder::default()
.add_field(text_field)

View File

@ -253,13 +253,13 @@ async fn grid_row_add_cells_test() {
builder.add_cell(&field.id, data).unwrap();
}
FieldType::SingleSelect => {
let description = SingleSelectTypeOption::from(field);
let type_option = SingleSelectTypeOption::from(field);
let options = description.options.first().unwrap();
let data = description.serialize_cell_data(&options.id).unwrap();
builder.add_cell(&field.id, data).unwrap();
}
FieldType::MultiSelect => {
let description = MultiSelectTypeOption::from(field);
let type_option = MultiSelectTypeOption::from(field);
let options = description
.options
.iter()
@ -382,11 +382,11 @@ async fn grid_cell_update() {
FieldType::Number => "123".to_string(),
FieldType::DateTime => "123".to_string(),
FieldType::SingleSelect => {
let description = SingleSelectTypeOption::from(field_meta);
let type_option = SingleSelectTypeOption::from(field_meta);
description.options.first().unwrap().id.clone()
}
FieldType::MultiSelect => {
let description = MultiSelectTypeOption::from(field_meta);
let type_option = MultiSelectTypeOption::from(field_meta);
description.options.first().unwrap().id.clone()
}
FieldType::Checkbox => "1".to_string(),

View File

@ -248,10 +248,9 @@ async fn get_row_metas(editor: &Arc<ClientGridEditor>) -> Vec<Arc<RowMeta>> {
}
pub fn create_text_field(grid_id: &str) -> (CreateFieldParams, FieldMeta) {
let field_meta = FieldBuilder::new(RichTextTypeOptionsBuilder::default())
let field_meta = FieldBuilder::new(RichTextTypeOptionBuilder::default())
.name("Name")
.visibility(true)
.field_type(FieldType::RichText)
.build();
let cloned_field_meta = field_meta.clone();
@ -276,16 +275,11 @@ pub fn create_text_field(grid_id: &str) -> (CreateFieldParams, FieldMeta) {
}
pub fn create_single_select_field(grid_id: &str) -> (CreateFieldParams, FieldMeta) {
let single_select = SingleSelectTypeOptionsBuilder::default()
let single_select = SingleSelectTypeOptionBuilder::default()
.option(SelectOption::new("Done"))
.option(SelectOption::new("Progress"));
let field_meta = FieldBuilder::new(single_select)
.name("Name")
.visibility(true)
.field_type(FieldType::SingleSelect)
.build();
let field_meta = FieldBuilder::new(single_select).name("Name").visibility(true).build();
let cloned_field_meta = field_meta.clone();
let field = Field {
@ -308,60 +302,42 @@ pub fn create_single_select_field(grid_id: &str) -> (CreateFieldParams, FieldMet
}
fn make_template_1_grid() -> BuildGridContext {
let text_field = FieldBuilder::new(RichTextTypeOptionsBuilder::default())
let text_field = FieldBuilder::new(RichTextTypeOptionBuilder::default())
.name("Name")
.visibility(true)
.field_type(FieldType::RichText)
.build();
// Single Select
let single_select = SingleSelectTypeOptionsBuilder::default()
let single_select = SingleSelectTypeOptionBuilder::default()
.option(SelectOption::new("Live"))
.option(SelectOption::new("Completed"))
.option(SelectOption::new("Planned"))
.option(SelectOption::new("Paused"));
let single_select_field = FieldBuilder::new(single_select)
.name("Status")
.visibility(true)
.field_type(FieldType::SingleSelect)
.build();
let single_select_field = FieldBuilder::new(single_select).name("Status").visibility(true).build();
// MultiSelect
let multi_select = MultiSelectTypeOptionsBuilder::default()
let multi_select = MultiSelectTypeOptionBuilder::default()
.option(SelectOption::new("Google"))
.option(SelectOption::new("Facebook"))
.option(SelectOption::new("Twitter"));
let multi_select_field = FieldBuilder::new(multi_select)
.name("Platform")
.visibility(true)
.field_type(FieldType::MultiSelect)
.build();
// Number
let number = NumberTypeOptionsBuilder::default().set_format(NumberFormat::USD);
let number_field = FieldBuilder::new(number)
.name("Price")
.visibility(true)
.field_type(FieldType::Number)
.build();
let number = NumberTypeOptionBuilder::default().set_format(NumberFormat::USD);
let number_field = FieldBuilder::new(number).name("Price").visibility(true).build();
// Date
let date = DateTypeOptionsBuilder::default()
let date = DateTypeOptionBuilder::default()
.date_format(DateFormat::US)
.time_format(TimeFormat::TwentyFourHour);
let date_field = FieldBuilder::new(date)
.name("Time")
.visibility(true)
.field_type(FieldType::DateTime)
.build();
let date_field = FieldBuilder::new(date).name("Time").visibility(true).build();
// Checkbox
let checkbox = CheckboxTypeOptionsBuilder::default();
let checkbox_field = FieldBuilder::new(checkbox)
.name("is done")
.visibility(true)
.field_type(FieldType::Checkbox)
.build();
let checkbox = CheckboxTypeOptionBuilder::default();
let checkbox_field = FieldBuilder::new(checkbox).name("is done").visibility(true).build();
GridBuilder::default()
.add_field(text_field)

View File

@ -102,10 +102,6 @@ impl TryInto<CreateFieldParams> for CreateFieldPayload {
Some(id) => Some(NotEmptyUuid::parse(id).map_err(|_| ErrorCode::FieldIdIsEmpty)?.0),
};
if self.type_option_data.is_empty() {
return Err(ErrorCode::TypeOptionIsEmpty);
}
Ok(CreateFieldParams {
grid_id: grid_id.0,
field: self.field,

View File

@ -45,16 +45,18 @@ impl GridMetaPad {
..
} = params;
// Check if the field exists or not
if grid
.fields
.iter()
.find(|field_meta| field_meta.id == field.id)
.is_some()
{
tracing::warn!("Create grid field");
tracing::warn!("Duplicate grid field");
return Ok(None);
}
// Parse type option
let type_option =
String::from_utf8(type_option_data).map_err(|e| CollaborateError::internal().context(e))?;