feat: migrate flowy-database (#2373)

* feat: add flowy-database2

* chore: config type option data

* chore: impl type option

* feat: config group

* fix: group compile

* feat: add sort

* chore: setting

* chore: insert with specific type

* chore: custom group

* chore: rename any map

* chore: use group setting

* chore: update

* chore: open database event

* chore: update database editor

* chore: update

* chore: update view editor

* chore: update

* chore: update view editor

* chore: sort feat

* chore: update handler

* chore: update

* chore: config handler event

* feat: impl handlers

* feat: impl handlers

* chore: layout setting

* feat: impl handlers

* chore: remove flowy-folder ref

* chore: integrate flowy-database2

* feat: get cell

* chore: create database with data

* chore: create view

* chore: fix dart compile

* fix: some bugs

* chore: update

* chore: merge develop

* chore: fix warning

* chore: integrate rocksdb

* fix: rocksdb compile errros

* fix: update cell

* chore: update the bundle identifier

* fix: create row

* fix: switch to field

* fix: duplicate grid

* test: migrate tests

* test: migrate tests

* test: update test

* test: migrate tests

* chore: add patch
This commit is contained in:
Nathan.fooo 2023-04-28 14:08:53 +08:00 committed by GitHub
parent 243f062d4f
commit 32bd0ffca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
316 changed files with 24152 additions and 837 deletions

View File

@ -13,7 +13,7 @@
"preLaunchTask": "AF: Build Appflowy Core", "preLaunchTask": "AF: Build Appflowy Core",
"env": { "env": {
"RUST_LOG": "trace", "RUST_LOG": "trace",
// "RUST_LOG": "debug" "RUST_BACKTRACE": 1,
}, },
"cwd": "${workspaceRoot}/appflowy_flutter" "cwd": "${workspaceRoot}/appflowy_flutter"
}, },
@ -24,7 +24,7 @@
"program": "./lib/main.dart", "program": "./lib/main.dart",
"type": "dart", "type": "dart",
"env": { "env": {
"RUST_LOG": "debug" "RUST_LOG": "debug",
}, },
"cwd": "${workspaceRoot}/appflowy_flutter" "cwd": "${workspaceRoot}/appflowy_flutter"
}, },

View File

@ -59,6 +59,7 @@ BUILD_FLAG = "debug"
FLUTTER_OUTPUT_DIR = "Debug" FLUTTER_OUTPUT_DIR = "Debug"
PRODUCT_EXT = "app" PRODUCT_EXT = "app"
BUILD_ARCHS = "arm64" BUILD_ARCHS = "arm64"
CRATE_TYPE = "staticlib"
[env.development-mac-x86_64] [env.development-mac-x86_64]
RUST_LOG = "info" RUST_LOG = "info"
@ -68,6 +69,7 @@ BUILD_FLAG = "debug"
FLUTTER_OUTPUT_DIR = "Debug" FLUTTER_OUTPUT_DIR = "Debug"
PRODUCT_EXT = "app" PRODUCT_EXT = "app"
BUILD_ARCHS = "x86_64" BUILD_ARCHS = "x86_64"
CRATE_TYPE = "staticlib"
[env.production-mac-arm64] [env.production-mac-arm64]
BUILD_FLAG = "release" BUILD_FLAG = "release"
@ -77,6 +79,7 @@ FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app" PRODUCT_EXT = "app"
APP_ENVIRONMENT = "production" APP_ENVIRONMENT = "production"
BUILD_ARCHS = "arm64" BUILD_ARCHS = "arm64"
CRATE_TYPE = "staticlib"
[env.production-mac-x86_64] [env.production-mac-x86_64]
BUILD_FLAG = "release" BUILD_FLAG = "release"
@ -86,6 +89,7 @@ FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "app" PRODUCT_EXT = "app"
APP_ENVIRONMENT = "production" APP_ENVIRONMENT = "production"
BUILD_ARCHS = "x86_64" BUILD_ARCHS = "x86_64"
CRATE_TYPE = "staticlib"
[env.development-windows-x86] [env.development-windows-x86]
TARGET_OS = "windows" TARGET_OS = "windows"

View File

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/rust_stream.dart'; import 'package:appflowy_backend/rust_stream.dart';
import 'notification_helper.dart'; import 'notification_helper.dart';

View File

@ -13,7 +13,7 @@ class DatabaseCell {
/// We use [fieldId + rowId] to identify the cell. /// We use [fieldId + rowId] to identify the cell.
class CellCacheKey { class CellCacheKey {
final String fieldId; final String fieldId;
final String rowId; final Int64 rowId;
CellCacheKey({ CellCacheKey({
required this.fieldId, required this.fieldId,
required this.rowId, required this.rowId,
@ -28,7 +28,7 @@ class CellCache {
final String viewId; final String viewId;
/// fieldId: {cacheKey: GridCell} /// fieldId: {cacheKey: GridCell}
final Map<String, Map<String, dynamic>> _cellDataByFieldId = {}; final Map<String, Map<Int64, dynamic>> _cellDataByFieldId = {};
CellCache({ CellCache({
required this.viewId, required this.viewId,
}); });

View File

@ -1,10 +1,11 @@
import 'dart:async'; import 'dart:async';
import 'package:appflowy/plugins/database_view/application/field/field_listener.dart'; import 'package:appflowy/plugins/database_view/application/field/field_listener.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../field/field_controller.dart'; import '../field/field_controller.dart';
import '../field/field_service.dart'; import '../field/field_service.dart';
@ -38,7 +39,7 @@ class CellController<T, D> extends Equatable {
String get viewId => cellId.viewId; String get viewId => cellId.viewId;
String get rowId => cellId.rowId; Int64 get rowId => cellId.rowId;
String get fieldId => cellId.fieldInfo.id; String get fieldId => cellId.fieldInfo.id;

View File

@ -1,7 +1,7 @@
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'cell_controller.dart'; import 'cell_controller.dart';
import 'cell_service.dart'; import 'cell_service.dart';

View File

@ -1,7 +1,8 @@
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
@ -9,7 +10,7 @@ import 'dart:typed_data';
typedef UpdateFieldNotifiedValue = Either<Unit, FlowyError>; typedef UpdateFieldNotifiedValue = Either<Unit, FlowyError>;
class CellListener { class CellListener {
final String rowId; final Int64 rowId;
final String fieldId; final String fieldId;
PublishNotifier<UpdateFieldNotifiedValue>? _updateCellNotifier = PublishNotifier<UpdateFieldNotifiedValue>? _updateCellNotifier =
PublishNotifier(); PublishNotifier();

View File

@ -1,14 +1,15 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/cell_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:fixnum/fixnum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option_entities.pb.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:convert' show utf8; import 'dart:convert' show utf8;
@ -30,7 +31,7 @@ class CellBackendService {
..viewId = cellId.viewId ..viewId = cellId.viewId
..fieldId = cellId.fieldId ..fieldId = cellId.fieldId
..rowId = cellId.rowId ..rowId = cellId.rowId
..typeCellData = data; ..cellChangeset = data;
return DatabaseEventUpdateCell(payload).send(); return DatabaseEventUpdateCell(payload).send();
} }
@ -51,7 +52,7 @@ class CellBackendService {
class CellIdentifier with _$CellIdentifier { class CellIdentifier with _$CellIdentifier {
const factory CellIdentifier({ const factory CellIdentifier({
required String viewId, required String viewId,
required String rowId, required Int64 rowId,
required FieldInfo fieldInfo, required FieldInfo fieldInfo,
}) = _CellIdentifier; }) = _CellIdentifier;

View File

@ -2,17 +2,18 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/application/layout/calendar_setting_listener.dart'; import 'package:appflowy/plugins/database_view/application/layout/calendar_setting_listener.dart';
import 'package:appflowy/plugins/database_view/application/view/view_cache.dart'; import 'package:appflowy/plugins/database_view/application/view/view_cache.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/calendar_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'dart:async'; import 'dart:async';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:fixnum/fixnum.dart';
import 'database_view_service.dart'; import 'database_view_service.dart';
import 'defines.dart'; import 'defines.dart';
import 'layout/layout_setting_listener.dart'; import 'layout/layout_setting_listener.dart';
@ -156,7 +157,7 @@ class DatabaseController {
} }
Future<Either<RowPB, FlowyError>> createRow({ Future<Either<RowPB, FlowyError>> createRow({
String? startRowId, Int64? startRowId,
String? groupId, String? groupId,
void Function(RowDataBuilder builder)? withCells, void Function(RowDataBuilder builder)? withCells,
}) { }) {
@ -198,7 +199,7 @@ class DatabaseController {
} }
Future<void> updateCalenderLayoutSetting( Future<void> updateCalenderLayoutSetting(
CalendarLayoutSettingsPB layoutSetting, CalendarLayoutSettingPB layoutSetting,
) async { ) async {
await _databaseViewBackendSvc await _databaseViewBackendSvc
.updateLayoutSetting(calendarLayoutSetting: layoutSetting) .updateLayoutSetting(calendarLayoutSetting: layoutSetting)

View File

@ -1,5 +1,5 @@
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';

View File

@ -1,14 +1,15 @@
import 'package:appflowy_backend/protobuf/flowy-database/calendar_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/calendar_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:fixnum/fixnum.dart';
class DatabaseViewBackendService { class DatabaseViewBackendService {
final String viewId; final String viewId;
@ -24,14 +25,12 @@ class DatabaseViewBackendService {
} }
Future<Either<RowPB, FlowyError>> createRow({ Future<Either<RowPB, FlowyError>> createRow({
String? startRowId, Int64? startRowId,
String? groupId, String? groupId,
Map<String, String>? cellDataByFieldId, Map<String, String>? cellDataByFieldId,
}) { }) {
var payload = CreateRowPayloadPB.create()..viewId = viewId; var payload = CreateRowPayloadPB.create()..viewId = viewId;
if (startRowId != null) { payload.startRowId = startRowId ?? Int64(0);
payload.startRowId = startRowId;
}
if (groupId != null) { if (groupId != null) {
payload.groupId = groupId; payload.groupId = groupId;
@ -45,9 +44,9 @@ class DatabaseViewBackendService {
} }
Future<Either<Unit, FlowyError>> moveRow({ Future<Either<Unit, FlowyError>> moveRow({
required String fromRowId, required Int64 fromRowId,
required String toGroupId, required String toGroupId,
String? toRowId, Int64? toRowId,
}) { }) {
var payload = MoveGroupRowPayloadPB.create() var payload = MoveGroupRowPayloadPB.create()
..viewId = viewId ..viewId = viewId
@ -96,17 +95,13 @@ class DatabaseViewBackendService {
} }
Future<Either<Unit, FlowyError>> updateLayoutSetting({ Future<Either<Unit, FlowyError>> updateLayoutSetting({
CalendarLayoutSettingsPB? calendarLayoutSetting, CalendarLayoutSettingPB? calendarLayoutSetting,
}) { }) {
final layoutSetting = LayoutSettingPB.create(); final payload = LayoutSettingChangesetPB.create()..viewId = viewId;
if (calendarLayoutSetting != null) { if (calendarLayoutSetting != null) {
layoutSetting.calendar = calendarLayoutSetting; payload.calendar = calendarLayoutSetting;
} }
final payload = UpdateLayoutSettingPB.create()
..viewId = viewId
..layoutSetting = layoutSetting;
return DatabaseEventSetLayoutSetting(payload).send(); return DatabaseEventSetLayoutSetting(payload).send();
} }

View File

@ -1,7 +1,8 @@
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:fixnum/fixnum.dart';
import '../grid/presentation/widgets/filter/filter_info.dart'; import '../grid/presentation/widgets/filter/filter_info.dart';
import 'field/field_controller.dart'; import 'field/field_controller.dart';
@ -11,12 +12,12 @@ typedef OnFieldsChanged = void Function(UnmodifiableListView<FieldInfo>);
typedef OnFiltersChanged = void Function(List<FilterInfo>); typedef OnFiltersChanged = void Function(List<FilterInfo>);
typedef OnDatabaseChanged = void Function(DatabasePB); typedef OnDatabaseChanged = void Function(DatabasePB);
typedef OnRowsCreated = void Function(List<String> ids); typedef OnRowsCreated = void Function(List<Int64> ids);
typedef OnRowsUpdated = void Function(List<String> ids); typedef OnRowsUpdated = void Function(List<Int64> ids);
typedef OnRowsDeleted = void Function(List<String> ids); typedef OnRowsDeleted = void Function(List<Int64> ids);
typedef OnRowsChanged = void Function( typedef OnRowsChanged = void Function(
UnmodifiableListView<RowInfo> rows, UnmodifiableListView<RowInfo> rows,
UnmodifiableMapView<String, RowInfo> rowByRowId, UnmodifiableMapView<Int64, RowInfo> rowByRowId,
RowsChangedReason reason, RowsChangedReason reason,
); );

View File

@ -1,5 +1,5 @@
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'field_service.dart'; import 'field_service.dart';

View File

@ -1,5 +1,5 @@
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,13 +1,13 @@
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database/filter_changeset.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/filter_changeset.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../../grid/presentation/widgets/filter/filter_info.dart'; import '../../grid/presentation/widgets/filter/filter_info.dart';
import '../../grid/presentation/widgets/sort/sort_info.dart'; import '../../grid/presentation/widgets/sort/sort_info.dart';
@ -94,7 +94,7 @@ class FieldController {
_updatedFieldCallbacks = {}; _updatedFieldCallbacks = {};
// Group callbacks // Group callbacks
final Map<String, GroupConfigurationPB> _groupConfigurationByFieldId = {}; final Map<String, GroupSettingPB> _groupConfigurationByFieldId = {};
// Filter callbacks // Filter callbacks
final Map<OnReceiveFilters, VoidCallback> _filterCallbacks = {}; final Map<OnReceiveFilters, VoidCallback> _filterCallbacks = {};
@ -401,7 +401,7 @@ class FieldController {
void _updateSetting(DatabaseViewSettingPB setting) { void _updateSetting(DatabaseViewSettingPB setting) {
_groupConfigurationByFieldId.clear(); _groupConfigurationByFieldId.clear();
for (final configuration in setting.groupConfigurations.items) { for (final configuration in setting.groupSettings.items) {
_groupConfigurationByFieldId[configuration.fieldId] = configuration; _groupConfigurationByFieldId[configuration.fieldId] = configuration;
} }

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'field_service.dart'; import 'field_service.dart';

View File

@ -1,11 +1,11 @@
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
typedef UpdateFieldNotifiedValue = Either<FieldPB, FlowyError>; typedef UpdateFieldNotifiedValue = Either<FieldPB, FlowyError>;

View File

@ -1,8 +1,8 @@
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
part 'field_service.freezed.dart'; part 'field_service.freezed.dart';

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,5 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';
@ -41,8 +40,8 @@ class DateTypeOptionBloc
} }
DateTypeOptionPB _updateTypeOption({ DateTypeOptionPB _updateTypeOption({
DateFormat? dateFormat, DateFormatPB? dateFormat,
TimeFormat? timeFormat, TimeFormatPB? timeFormat,
bool? includeTime, bool? includeTime,
}) { }) {
state.typeOption.freeze(); state.typeOption.freeze();
@ -64,9 +63,9 @@ class DateTypeOptionBloc
@freezed @freezed
class DateTypeOptionEvent with _$DateTypeOptionEvent { class DateTypeOptionEvent with _$DateTypeOptionEvent {
const factory DateTypeOptionEvent.didSelectDateFormat(DateFormat format) = const factory DateTypeOptionEvent.didSelectDateFormat(DateFormatPB format) =
_DidSelectDateFormat; _DidSelectDateFormat;
const factory DateTypeOptionEvent.didSelectTimeFormat(TimeFormat format) = const factory DateTypeOptionEvent.didSelectTimeFormat(TimeFormatPB format) =
_DidSelectTimeFormat; _DidSelectTimeFormat;
const factory DateTypeOptionEvent.includeTime(bool includeTime) = const factory DateTypeOptionEvent.includeTime(bool includeTime) =
_IncludeTime; _IncludeTime;

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';

View File

@ -1,6 +1,5 @@
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/multi_select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'dart:async'; import 'dart:async';
import 'select_option_type_option_bloc.dart'; import 'select_option_type_option_bloc.dart';
import 'type_option_context.dart'; import 'type_option_context.dart';

View File

@ -1,5 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/number_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_type_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';
@ -22,7 +21,7 @@ class NumberTypeOptionBloc
); );
} }
NumberTypeOptionPB _updateNumberFormat(NumberFormat format) { NumberTypeOptionPB _updateNumberFormat(NumberFormatPB format) {
state.typeOption.freeze(); state.typeOption.freeze();
return state.typeOption.rebuild((typeOption) { return state.typeOption.rebuild((typeOption) {
typeOption.format = format; typeOption.format = format;
@ -32,7 +31,7 @@ class NumberTypeOptionBloc
@freezed @freezed
class NumberTypeOptionEvent with _$NumberTypeOptionEvent { class NumberTypeOptionEvent with _$NumberTypeOptionEvent {
const factory NumberTypeOptionEvent.didSelectFormat(NumberFormat format) = const factory NumberTypeOptionEvent.didSelectFormat(NumberFormatPB format) =
_DidSelectFormat; _DidSelectFormat;
} }

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/number_entities.pbenum.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
part 'number_format_bloc.freezed.dart'; part 'number_format_bloc.freezed.dart';
@ -9,7 +9,8 @@ class NumberFormatBloc extends Bloc<NumberFormatEvent, NumberFormatState> {
(event, emit) async { (event, emit) async {
event.map( event.map(
setFilter: (_SetFilter value) { setFilter: (_SetFilter value) {
final List<NumberFormat> formats = List.from(NumberFormat.values); final List<NumberFormatPB> formats =
List.from(NumberFormatPB.values);
if (value.filter.isNotEmpty) { if (value.filter.isNotEmpty) {
formats.retainWhere( formats.retainWhere(
(element) => element (element) => element
@ -34,92 +35,92 @@ class NumberFormatEvent with _$NumberFormatEvent {
@freezed @freezed
class NumberFormatState with _$NumberFormatState { class NumberFormatState with _$NumberFormatState {
const factory NumberFormatState({ const factory NumberFormatState({
required List<NumberFormat> formats, required List<NumberFormatPB> formats,
required String filter, required String filter,
}) = _NumberFormatState; }) = _NumberFormatState;
factory NumberFormatState.initial() { factory NumberFormatState.initial() {
return const NumberFormatState( return const NumberFormatState(
formats: NumberFormat.values, formats: NumberFormatPB.values,
filter: "", filter: "",
); );
} }
} }
extension NumberFormatExtension on NumberFormat { extension NumberFormatExtension on NumberFormatPB {
String title() { String title() {
switch (this) { switch (this) {
case NumberFormat.ArgentinePeso: case NumberFormatPB.ArgentinePeso:
return "Argentine peso"; return "Argentine peso";
case NumberFormat.Baht: case NumberFormatPB.Baht:
return "Baht"; return "Baht";
case NumberFormat.CanadianDollar: case NumberFormatPB.CanadianDollar:
return "Canadian dollar"; return "Canadian dollar";
case NumberFormat.ChileanPeso: case NumberFormatPB.ChileanPeso:
return "Chilean peso"; return "Chilean peso";
case NumberFormat.ColombianPeso: case NumberFormatPB.ColombianPeso:
return "Colombian peso"; return "Colombian peso";
case NumberFormat.DanishKrone: case NumberFormatPB.DanishKrone:
return "Danish krone"; return "Danish krone";
case NumberFormat.Dirham: case NumberFormatPB.Dirham:
return "Dirham"; return "Dirham";
case NumberFormat.EUR: case NumberFormatPB.EUR:
return "Euro"; return "Euro";
case NumberFormat.Forint: case NumberFormatPB.Forint:
return "Forint"; return "Forint";
case NumberFormat.Franc: case NumberFormatPB.Franc:
return "Franc"; return "Franc";
case NumberFormat.HongKongDollar: case NumberFormatPB.HongKongDollar:
return "Hone Kong dollar"; return "Hone Kong dollar";
case NumberFormat.Koruna: case NumberFormatPB.Koruna:
return "Koruna"; return "Koruna";
case NumberFormat.Krona: case NumberFormatPB.Krona:
return "Krona"; return "Krona";
case NumberFormat.Leu: case NumberFormatPB.Leu:
return "Leu"; return "Leu";
case NumberFormat.Lira: case NumberFormatPB.Lira:
return "Lira"; return "Lira";
case NumberFormat.MexicanPeso: case NumberFormatPB.MexicanPeso:
return "Mexican peso"; return "Mexican peso";
case NumberFormat.NewTaiwanDollar: case NumberFormatPB.NewTaiwanDollar:
return "New Taiwan dollar"; return "New Taiwan dollar";
case NumberFormat.NewZealandDollar: case NumberFormatPB.NewZealandDollar:
return "New Zealand dollar"; return "New Zealand dollar";
case NumberFormat.NorwegianKrone: case NumberFormatPB.NorwegianKrone:
return "Norwegian krone"; return "Norwegian krone";
case NumberFormat.Num: case NumberFormatPB.Num:
return "Number"; return "Number";
case NumberFormat.Percent: case NumberFormatPB.Percent:
return "Percent"; return "Percent";
case NumberFormat.PhilippinePeso: case NumberFormatPB.PhilippinePeso:
return "Philippine peso"; return "Philippine peso";
case NumberFormat.Pound: case NumberFormatPB.Pound:
return "Pound"; return "Pound";
case NumberFormat.Rand: case NumberFormatPB.Rand:
return "Rand"; return "Rand";
case NumberFormat.Real: case NumberFormatPB.Real:
return "Real"; return "Real";
case NumberFormat.Ringgit: case NumberFormatPB.Ringgit:
return "Ringgit"; return "Ringgit";
case NumberFormat.Riyal: case NumberFormatPB.Riyal:
return "Riyal"; return "Riyal";
case NumberFormat.Ruble: case NumberFormatPB.Ruble:
return "Ruble"; return "Ruble";
case NumberFormat.Rupee: case NumberFormatPB.Rupee:
return "Rupee"; return "Rupee";
case NumberFormat.Rupiah: case NumberFormatPB.Rupiah:
return "Rupiah"; return "Rupiah";
case NumberFormat.Shekel: case NumberFormatPB.Shekel:
return "Skekel"; return "Skekel";
case NumberFormat.USD: case NumberFormatPB.USD:
return "US dollar"; return "US dollar";
case NumberFormat.UruguayanPeso: case NumberFormatPB.UruguayanPeso:
return "Uruguayan peso"; return "Uruguayan peso";
case NumberFormat.Won: case NumberFormatPB.Won:
return "Won"; return "Won";
case NumberFormat.Yen: case NumberFormatPB.Yen:
return "Yen"; return "Yen";
case NumberFormat.Yuan: case NumberFormatPB.Yuan:
return "Yuan"; return "Yuan";
default: default:
throw UnimplementedError; throw UnimplementedError;
@ -128,13 +129,13 @@ extension NumberFormatExtension on NumberFormat {
// String iconName() { // String iconName() {
// switch (this) { // switch (this) {
// case NumberFormat.CNY: // case NumberFormatPB.CNY:
// return "grid/field/yen"; // return "grid/field/yen";
// case NumberFormat.EUR: // case NumberFormatPB.EUR:
// return "grid/field/euro"; // return "grid/field/euro";
// case NumberFormat.Number: // case NumberFormatPB.Number:
// return "grid/field/numbers"; // return "grid/field/numbers";
// case NumberFormat.USD: // case NumberFormatPB.USD:
// return "grid/field/us_dollar"; // return "grid/field/us_dollar";
// default: // default:
// throw UnimplementedError; // throw UnimplementedError;

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,6 +1,5 @@
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/single_select_type_option.pb.dart';
import 'dart:async'; import 'dart:async';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';
import 'select_option_type_option_bloc.dart'; import 'select_option_type_option_bloc.dart';

View File

@ -1,17 +1,14 @@
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/number_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/text_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-database/multi_select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/single_select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option.pb.dart';
import 'package:protobuf/protobuf.dart'; import 'package:protobuf/protobuf.dart';
import 'type_option_data_controller.dart'; import 'type_option_data_controller.dart';
abstract class TypeOptionParser<T> { abstract class TypeOptionParser<T> {

View File

@ -1,7 +1,7 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:protobuf/protobuf.dart' hide FieldInfo; import 'package:protobuf/protobuf.dart' hide FieldInfo;
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';

View File

@ -1,8 +1,8 @@
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/cell_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/cell_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
class TypeOptionBackendService { class TypeOptionBackendService {
final String viewId; final String viewId;

View File

@ -3,10 +3,10 @@ import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/filter_changeset.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/filter_changeset.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
typedef UpdateFilterNotifiedValue typedef UpdateFilterNotifiedValue
= Either<FilterChangesetNotificationPB, FlowyError>; = Either<FilterChangesetNotificationPB, FlowyError>;

View File

@ -1,17 +1,17 @@
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checklist_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/number_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/text_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:fixnum/fixnum.dart' as $fixnum; import 'package:fixnum/fixnum.dart' as $fixnum;
class FilterBackendService { class FilterBackendService {

View File

@ -3,10 +3,10 @@ import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group_changeset.pb.dart';
typedef GroupUpdateValue = Either<GroupChangesetPB, FlowyError>; typedef GroupUpdateValue = Either<GroupChangesetPB, FlowyError>;
typedef GroupByNewFieldValue = Either<List<GroupPB>, FlowyError>; typedef GroupByNewFieldValue = Either<List<GroupPB>, FlowyError>;

View File

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
typedef NewLayoutFieldValue = Either<LayoutSettingPB, FlowyError>; typedef NewLayoutFieldValue = Either<LayoutSettingPB, FlowyError>;

View File

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
typedef LayoutSettingsValue<T> = Either<T, FlowyError>; typedef LayoutSettingsValue<T> = Either<T, FlowyError>;

View File

@ -1,7 +1,8 @@
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
@ -42,7 +43,7 @@ class RowCache {
return UnmodifiableListView(visibleRows); return UnmodifiableListView(visibleRows);
} }
UnmodifiableMapView<String, RowInfo> get rowByRowId { UnmodifiableMapView<Int64, RowInfo> get rowByRowId {
return UnmodifiableMapView(_rowList.rowInfoByRowId); return UnmodifiableMapView(_rowList.rowInfoByRowId);
} }
@ -65,7 +66,7 @@ class RowCache {
}); });
} }
RowInfo? getRow(String rowId) { RowInfo? getRow(Int64 rowId) {
return _rowList.get(rowId); return _rowList.get(rowId);
} }
@ -115,7 +116,7 @@ class RowCache {
} }
} }
void _deleteRows(List<String> deletedRowIds) { void _deleteRows(List<Int64> deletedRowIds) {
for (final rowId in deletedRowIds) { for (final rowId in deletedRowIds) {
final deletedRow = _rowList.remove(rowId); final deletedRow = _rowList.remove(rowId);
if (deletedRow != null) { if (deletedRow != null) {
@ -156,7 +157,7 @@ class RowCache {
} }
} }
void _hideRows(List<String> invisibleRows) { void _hideRows(List<Int64> invisibleRows) {
for (final rowId in invisibleRows) { for (final rowId in invisibleRows) {
final deletedRow = _rowList.remove(rowId); final deletedRow = _rowList.remove(rowId);
if (deletedRow != null) { if (deletedRow != null) {
@ -183,7 +184,7 @@ class RowCache {
} }
RowUpdateCallback addListener({ RowUpdateCallback addListener({
required String rowId, required Int64 rowId,
void Function(CellByFieldId, RowsChangedReason)? onCellUpdated, void Function(CellByFieldId, RowsChangedReason)? onCellUpdated,
bool Function()? listenWhen, bool Function()? listenWhen,
}) { }) {
@ -219,7 +220,7 @@ class RowCache {
_rowChangeReasonNotifier.removeListener(callback); _rowChangeReasonNotifier.removeListener(callback);
} }
CellByFieldId loadGridCells(String rowId) { CellByFieldId loadGridCells(Int64 rowId) {
final RowPB? data = _rowList.get(rowId)?.rowPB; final RowPB? data = _rowList.get(rowId)?.rowPB;
if (data == null) { if (data == null) {
_loadRow(rowId); _loadRow(rowId);
@ -227,7 +228,7 @@ class RowCache {
return _makeGridCells(rowId, data); return _makeGridCells(rowId, data);
} }
Future<void> _loadRow(String rowId) async { Future<void> _loadRow(Int64 rowId) async {
final payload = RowIdPB.create() final payload = RowIdPB.create()
..viewId = viewId ..viewId = viewId
..rowId = rowId; ..rowId = rowId;
@ -239,7 +240,7 @@ class RowCache {
); );
} }
CellByFieldId _makeGridCells(String rowId, RowPB? row) { CellByFieldId _makeGridCells(Int64 rowId, RowPB? row) {
// ignore: prefer_collection_literals // ignore: prefer_collection_literals
var cellDataMap = CellByFieldId(); var cellDataMap = CellByFieldId();
for (final field in _delegate.fields) { for (final field in _delegate.fields) {
@ -319,7 +320,7 @@ typedef InsertedIndexs = List<InsertedIndex>;
typedef DeletedIndexs = List<DeletedIndex>; typedef DeletedIndexs = List<DeletedIndex>;
// key: id of the row // key: id of the row
// value: UpdatedIndex // value: UpdatedIndex
typedef UpdatedIndexMap = LinkedHashMap<String, UpdatedIndex>; typedef UpdatedIndexMap = LinkedHashMap<Int64, UpdatedIndex>;
@freezed @freezed
class RowsChangedReason with _$RowsChangedReason { class RowsChangedReason with _$RowsChangedReason {
@ -337,7 +338,7 @@ class RowsChangedReason with _$RowsChangedReason {
class InsertedIndex { class InsertedIndex {
final int index; final int index;
final String rowId; final Int64 rowId;
InsertedIndex({ InsertedIndex({
required this.index, required this.index,
required this.rowId, required this.rowId,
@ -355,7 +356,7 @@ class DeletedIndex {
class UpdatedIndex { class UpdatedIndex {
final int index; final int index;
final String rowId; final Int64 rowId;
UpdatedIndex({ UpdatedIndex({
required this.index, required this.index,
required this.rowId, required this.rowId,

View File

@ -1,3 +1,4 @@
import 'package:fixnum/fixnum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../cell/cell_service.dart'; import '../cell/cell_service.dart';
import 'row_cache.dart'; import 'row_cache.dart';
@ -5,7 +6,7 @@ import 'row_cache.dart';
typedef OnRowChanged = void Function(CellByFieldId, RowsChangedReason); typedef OnRowChanged = void Function(CellByFieldId, RowsChangedReason);
class RowController { class RowController {
final String rowId; final Int64 rowId;
final String viewId; final String viewId;
final List<VoidCallback> _onRowChangedListeners = []; final List<VoidCallback> _onRowChangedListeners = [];
final RowCache _rowCache; final RowCache _rowCache;

View File

@ -1,5 +1,6 @@
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:fixnum/fixnum.dart';
import 'row_cache.dart'; import 'row_cache.dart';
class RowList { class RowList {
@ -9,13 +10,13 @@ class RowList {
List<RowInfo> get rows => List.from(_rowInfos); List<RowInfo> get rows => List.from(_rowInfos);
/// Use Map for faster access the raw row data. /// Use Map for faster access the raw row data.
final HashMap<String, RowInfo> rowInfoByRowId = HashMap(); final HashMap<Int64, RowInfo> rowInfoByRowId = HashMap();
RowInfo? get(String rowId) { RowInfo? get(Int64 rowId) {
return rowInfoByRowId[rowId]; return rowInfoByRowId[rowId];
} }
int? indexOfRow(String rowId) { int? indexOfRow(Int64 rowId) {
final rowInfo = rowInfoByRowId[rowId]; final rowInfo = rowInfoByRowId[rowId];
if (rowInfo != null) { if (rowInfo != null) {
return _rowInfos.indexOf(rowInfo); return _rowInfos.indexOf(rowInfo);
@ -56,7 +57,7 @@ class RowList {
} }
} }
DeletedIndex? remove(String rowId) { DeletedIndex? remove(Int64 rowId) {
final rowInfo = rowInfoByRowId[rowId]; final rowInfo = rowInfoByRowId[rowId];
if (rowInfo != null) { if (rowInfo != null) {
final index = _rowInfos.indexOf(rowInfo); final index = _rowInfos.indexOf(rowInfo);
@ -145,7 +146,7 @@ class RowList {
} }
} }
void moveRow(String rowId, int oldIndex, int newIndex) { void moveRow(Int64 rowId, int oldIndex, int newIndex) {
final index = _rowInfos.indexWhere( final index = _rowInfos.indexWhere(
(rowInfo) => rowInfo.rowPB.id == rowId, (rowInfo) => rowInfo.rowPB.id == rowId,
); );
@ -156,7 +157,7 @@ class RowList {
} }
} }
bool contains(String rowId) { bool contains(Int64 rowId) {
return rowInfoByRowId[rowId] != null; return rowInfoByRowId[rowId] != null;
} }
} }

View File

@ -1,7 +1,8 @@
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:fixnum/fixnum.dart';
class RowBackendService { class RowBackendService {
final String viewId; final String viewId;
@ -10,7 +11,7 @@ class RowBackendService {
required this.viewId, required this.viewId,
}); });
Future<Either<RowPB, FlowyError>> createRow(String rowId) { Future<Either<RowPB, FlowyError>> createRow(Int64 rowId) {
final payload = CreateRowPayloadPB.create() final payload = CreateRowPayloadPB.create()
..viewId = viewId ..viewId = viewId
..startRowId = rowId; ..startRowId = rowId;
@ -18,7 +19,7 @@ class RowBackendService {
return DatabaseEventCreateRow(payload).send(); return DatabaseEventCreateRow(payload).send();
} }
Future<Either<OptionalRowPB, FlowyError>> getRow(String rowId) { Future<Either<OptionalRowPB, FlowyError>> getRow(Int64 rowId) {
final payload = RowIdPB.create() final payload = RowIdPB.create()
..viewId = viewId ..viewId = viewId
..rowId = rowId; ..rowId = rowId;
@ -26,7 +27,7 @@ class RowBackendService {
return DatabaseEventGetRow(payload).send(); return DatabaseEventGetRow(payload).send();
} }
Future<Either<Unit, FlowyError>> deleteRow(String rowId) { Future<Either<Unit, FlowyError>> deleteRow(Int64 rowId) {
final payload = RowIdPB.create() final payload = RowIdPB.create()
..viewId = viewId ..viewId = viewId
..rowId = rowId; ..rowId = rowId;
@ -34,7 +35,7 @@ class RowBackendService {
return DatabaseEventDeleteRow(payload).send(); return DatabaseEventDeleteRow(payload).send();
} }
Future<Either<Unit, FlowyError>> duplicateRow(String rowId) { Future<Either<Unit, FlowyError>> duplicateRow(Int64 rowId) {
final payload = RowIdPB.create() final payload = RowIdPB.create()
..viewId = viewId ..viewId = viewId
..rowId = rowId; ..rowId = rowId;

View File

@ -1,7 +1,7 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy/plugins/database_view/application/setting/setting_service.dart'; import 'package:appflowy/plugins/database_view/application/setting/setting_service.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,5 +1,5 @@
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'setting_listener.dart'; import 'setting_listener.dart';
import 'setting_service.dart'; import 'setting_service.dart';

View File

@ -4,8 +4,8 @@ import 'package:appflowy/core/grid_notification.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
typedef UpdateSettingNotifiedValue = Either<DatabaseViewSettingPB, FlowyError>; typedef UpdateSettingNotifiedValue = Either<DatabaseViewSettingPB, FlowyError>;

View File

@ -1,10 +1,10 @@
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
class SettingBackendService { class SettingBackendService {
final String viewId; final String viewId;

View File

@ -4,8 +4,8 @@ import 'package:appflowy/core/grid_notification.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
typedef SortNotifiedValue = Either<SortChangesetNotificationPB, FlowyError>; typedef SortNotifiedValue = Either<SortChangesetNotificationPB, FlowyError>;

View File

@ -1,11 +1,11 @@
import 'package:appflowy_backend/protobuf/flowy-database/database_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart'; import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
class SortBackendService { class SortBackendService {
final String viewId; final String viewId;

View File

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:fixnum/fixnum.dart';
import '../defines.dart'; import '../defines.dart';
import '../field/field_controller.dart'; import '../field/field_controller.dart';
import '../row/row_cache.dart'; import '../row/row_cache.dart';
@ -39,7 +40,7 @@ class DatabaseViewCache {
UnmodifiableListView<RowInfo> get rowInfos => _rowCache.rowInfos; UnmodifiableListView<RowInfo> get rowInfos => _rowCache.rowInfos;
RowCache get rowCache => _rowCache; RowCache get rowCache => _rowCache;
RowInfo? getRow(String rowId) => _rowCache.getRow(rowId); RowInfo? getRow(Int64 rowId) => _rowCache.getRow(rowId);
DatabaseViewCache({ DatabaseViewCache({
required this.viewId, required this.viewId,

View File

@ -1,12 +1,12 @@
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/notification.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/view_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/view_entities.pb.dart';
typedef RowsVisibilityNotifierValue typedef RowsVisibilityNotifierValue
= Either<RowsVisibilityChangesetPB, FlowyError>; = Either<RowsVisibilityChangesetPB, FlowyError>;

View File

@ -7,7 +7,8 @@ import 'package:equatable/equatable.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
@ -196,7 +197,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
} }
} }
RowCache? getRowCache(String blockId) { RowCache? getRowCache() {
return _databaseController.rowCache; return _databaseController.rowCache;
} }
@ -310,7 +311,7 @@ class BoardEvent with _$BoardEvent {
GroupPB group, GroupPB group,
RowPB row, RowPB row,
) = _StartEditRow; ) = _StartEditRow;
const factory BoardEvent.endEditingRow(String rowId) = _EndEditRow; const factory BoardEvent.endEditingRow(Int64 rowId) = _EndEditRow;
const factory BoardEvent.didReceiveError(FlowyError error) = _DidReceiveError; const factory BoardEvent.didReceiveError(FlowyError error) = _DidReceiveError;
const factory BoardEvent.didReceiveGridUpdate( const factory BoardEvent.didReceiveGridUpdate(
DatabasePB grid, DatabasePB grid,
@ -384,7 +385,7 @@ class GroupItem extends AppFlowyGroupItem {
} }
@override @override
String get id => row.id; String get id => row.id.toString();
} }
class GroupControllerDelegateImpl extends GroupControllerDelegate { class GroupControllerDelegateImpl extends GroupControllerDelegate {
@ -422,8 +423,8 @@ class GroupControllerDelegateImpl extends GroupControllerDelegate {
} }
@override @override
void removeRow(GroupPB group, String rowId) { void removeRow(GroupPB group, Int64 rowId) {
controller.removeGroupItem(group.groupId, rowId); controller.removeGroupItem(group.groupId, rowId.toString());
} }
@override @override

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
class BoardGroupService { class BoardGroupService {
final String viewId; final String viewId;

View File

@ -1,16 +1,17 @@
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:appflowy/core/grid_notification.dart'; import 'package:appflowy/core/grid_notification.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flowy_infra/notifier.dart'; import 'package:flowy_infra/notifier.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
typedef OnGroupError = void Function(FlowyError); typedef OnGroupError = void Function(FlowyError);
abstract class GroupControllerDelegate { abstract class GroupControllerDelegate {
void removeRow(GroupPB group, String rowId); void removeRow(GroupPB group, Int64 rowId);
void insertRow(GroupPB group, RowPB row, int? index); void insertRow(GroupPB group, RowPB row, int? index);
void updateRow(GroupPB group, RowPB row); void updateRow(GroupPB group, RowPB row);
void addNewRow(GroupPB group, RowPB row, int? index); void addNewRow(GroupPB group, RowPB row, int? index);

View File

@ -8,8 +8,8 @@ import 'package:appflowy/plugins/database_view/application/row/row_cache.dart';
import 'package:appflowy/plugins/database_view/application/row/row_data_controller.dart'; import 'package:appflowy/plugins/database_view/application/row/row_data_controller.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart'; import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:appflowy_board/appflowy_board.dart'; import 'package:appflowy_board/appflowy_board.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
@ -232,7 +232,7 @@ class _BoardContentState extends State<BoardContent> {
final groupItem = afGroupItem as GroupItem; final groupItem = afGroupItem as GroupItem;
final groupData = afGroupData.customData as GroupData; final groupData = afGroupData.customData as GroupData;
final rowPB = groupItem.row; final rowPB = groupItem.row;
final rowCache = context.read<BoardBloc>().getRowCache(rowPB.blockId); final rowCache = context.read<BoardBloc>().getRowCache();
/// Return placeholder widget if the rowCache is null. /// Return placeholder widget if the rowCache is null.
if (rowCache == null) return SizedBox(key: ObjectKey(groupItem)); if (rowCache == null) return SizedBox(key: ObjectKey(groupItem));

View File

@ -4,9 +4,10 @@ import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:calendar_view/calendar_view.dart'; import 'package:calendar_view/calendar_view.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
@ -39,7 +40,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
await _openDatabase(emit); await _openDatabase(emit);
_loadAllEvents(); _loadAllEvents();
}, },
didReceiveCalendarSettings: (CalendarLayoutSettingsPB settings) { didReceiveCalendarSettings: (CalendarLayoutSettingPB settings) {
emit(state.copyWith(settings: Some(settings))); emit(state.copyWith(settings: Some(settings)));
}, },
didReceiveDatabaseUpdate: (DatabasePB database) { didReceiveDatabaseUpdate: (DatabasePB database) {
@ -48,7 +49,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
didLoadAllEvents: (events) { didLoadAllEvents: (events) {
emit(state.copyWith(initialEvents: events, allEvents: events)); emit(state.copyWith(initialEvents: events, allEvents: events));
}, },
didReceiveNewLayoutField: (CalendarLayoutSettingsPB layoutSettings) { didReceiveNewLayoutField: (CalendarLayoutSettingPB layoutSettings) {
_loadAllEvents(); _loadAllEvents();
emit(state.copyWith(settings: Some(layoutSettings))); emit(state.copyWith(settings: Some(layoutSettings)));
}, },
@ -56,7 +57,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
await _createEvent(date, title); await _createEvent(date, title);
}, },
updateCalendarLayoutSetting: updateCalendarLayoutSetting:
(CalendarLayoutSettingsPB layoutSetting) async { (CalendarLayoutSettingPB layoutSetting) async {
await _updateCalendarLayoutSetting(layoutSetting); await _updateCalendarLayoutSetting(layoutSetting);
}, },
didUpdateEvent: (CalendarEventData<CalendarDayEvent> eventData) { didUpdateEvent: (CalendarEventData<CalendarDayEvent> eventData) {
@ -82,7 +83,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
), ),
); );
}, },
didDeleteEvents: (List<String> deletedRowIds) { didDeleteEvents: (List<Int64> deletedRowIds) {
var events = [...state.allEvents]; var events = [...state.allEvents];
events.retainWhere( events.retainWhere(
(element) => !deletedRowIds.contains(element.event!.cellId.rowId), (element) => !deletedRowIds.contains(element.event!.cellId.rowId),
@ -139,7 +140,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
return state.settings.fold( return state.settings.fold(
() => null, () => null,
(settings) async { (settings) async {
final dateField = _getCalendarFieldInfo(settings.layoutFieldId); final dateField = _getCalendarFieldInfo(settings.fieldId);
final titleField = _getTitleFieldInfo(); final titleField = _getTitleFieldInfo();
if (dateField != null && titleField != null) { if (dateField != null && titleField != null) {
final result = await _databaseController.createRow( final result = await _databaseController.createRow(
@ -159,12 +160,12 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
} }
Future<void> _updateCalendarLayoutSetting( Future<void> _updateCalendarLayoutSetting(
CalendarLayoutSettingsPB layoutSetting, CalendarLayoutSettingPB layoutSetting,
) async { ) async {
return _databaseController.updateCalenderLayoutSetting(layoutSetting); return _databaseController.updateCalenderLayoutSetting(layoutSetting);
} }
Future<CalendarEventData<CalendarDayEvent>?> _loadEvent(String rowId) async { Future<CalendarEventData<CalendarDayEvent>?> _loadEvent(Int64 rowId) async {
final payload = RowIdPB(viewId: viewId, rowId: rowId); final payload = RowIdPB(viewId: viewId, rowId: rowId);
return DatabaseEventGetCalendarEvent(payload).send().then((result) { return DatabaseEventGetCalendarEvent(payload).send().then((result) {
return result.fold( return result.fold(
@ -305,7 +306,7 @@ class CalendarEvent with _$CalendarEvent {
// Called after loading the calendar layout setting from the backend // Called after loading the calendar layout setting from the backend
const factory CalendarEvent.didReceiveCalendarSettings( const factory CalendarEvent.didReceiveCalendarSettings(
CalendarLayoutSettingsPB settings, CalendarLayoutSettingPB settings,
) = _ReceiveCalendarSettings; ) = _ReceiveCalendarSettings;
// Called after loading all the current evnets // Called after loading all the current evnets
@ -323,7 +324,7 @@ class CalendarEvent with _$CalendarEvent {
) = _DidReceiveNewEvent; ) = _DidReceiveNewEvent;
// Called when deleting events // Called when deleting events
const factory CalendarEvent.didDeleteEvents(List<String> rowIds) = const factory CalendarEvent.didDeleteEvents(List<Int64> rowIds) =
_DidDeleteEvents; _DidDeleteEvents;
// Called when creating a new event // Called when creating a new event
@ -332,14 +333,14 @@ class CalendarEvent with _$CalendarEvent {
// Called when updating the calendar's layout settings // Called when updating the calendar's layout settings
const factory CalendarEvent.updateCalendarLayoutSetting( const factory CalendarEvent.updateCalendarLayoutSetting(
CalendarLayoutSettingsPB layoutSetting, CalendarLayoutSettingPB layoutSetting,
) = _UpdateCalendarLayoutSetting; ) = _UpdateCalendarLayoutSetting;
const factory CalendarEvent.didReceiveDatabaseUpdate(DatabasePB database) = const factory CalendarEvent.didReceiveDatabaseUpdate(DatabasePB database) =
_ReceiveDatabaseUpdate; _ReceiveDatabaseUpdate;
const factory CalendarEvent.didReceiveNewLayoutField( const factory CalendarEvent.didReceiveNewLayoutField(
CalendarLayoutSettingsPB layoutSettings, CalendarLayoutSettingPB layoutSettings,
) = _DidReceiveNewLayoutField; ) = _DidReceiveNewLayoutField;
} }
@ -350,9 +351,9 @@ class CalendarState with _$CalendarState {
required Events allEvents, required Events allEvents,
required Events initialEvents, required Events initialEvents,
CalendarEventData<CalendarDayEvent>? newEvent, CalendarEventData<CalendarDayEvent>? newEvent,
required List<String> deleteEventIds, required List<Int64> deleteEventIds,
CalendarEventData<CalendarDayEvent>? updateEvent, CalendarEventData<CalendarDayEvent>? updateEvent,
required Option<CalendarLayoutSettingsPB> settings, required Option<CalendarLayoutSettingPB> settings,
required DatabaseLoadingState loadingState, required DatabaseLoadingState loadingState,
required Option<FlowyError> noneOrError, required Option<FlowyError> noneOrError,
}) = _CalendarState; }) = _CalendarState;
@ -390,6 +391,6 @@ class CalendarDayEvent {
final CalendarEventPB event; final CalendarEventPB event;
final CellIdentifier cellId; final CellIdentifier cellId;
String get eventId => cellId.rowId; Int64 get eventId => cellId.rowId;
CalendarDayEvent({required this.cellId, required this.event}); CalendarDayEvent({required this.cellId, required this.event});
} }

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
@ -9,7 +9,7 @@ typedef DayOfWeek = int;
class CalendarSettingBloc class CalendarSettingBloc
extends Bloc<CalendarSettingEvent, CalendarSettingState> { extends Bloc<CalendarSettingEvent, CalendarSettingState> {
CalendarSettingBloc({required CalendarLayoutSettingsPB? layoutSettings}) CalendarSettingBloc({required CalendarLayoutSettingPB? layoutSettings})
: super(CalendarSettingState.initial(layoutSettings)) { : super(CalendarSettingState.initial(layoutSettings)) {
on<CalendarSettingEvent>((event, emit) { on<CalendarSettingEvent>((event, emit) {
event.when( event.when(
@ -28,11 +28,11 @@ class CalendarSettingBloc
class CalendarSettingState with _$CalendarSettingState { class CalendarSettingState with _$CalendarSettingState {
const factory CalendarSettingState({ const factory CalendarSettingState({
required Option<CalendarSettingAction> selectedAction, required Option<CalendarSettingAction> selectedAction,
required Option<CalendarLayoutSettingsPB> layoutSetting, required Option<CalendarLayoutSettingPB> layoutSetting,
}) = _CalendarSettingState; }) = _CalendarSettingState;
factory CalendarSettingState.initial( factory CalendarSettingState.initial(
CalendarLayoutSettingsPB? layoutSettings, CalendarLayoutSettingPB? layoutSettings,
) => ) =>
CalendarSettingState( CalendarSettingState(
selectedAction: none(), selectedAction: none(),
@ -46,7 +46,7 @@ class CalendarSettingEvent with _$CalendarSettingEvent {
CalendarSettingAction action, CalendarSettingAction action,
) = _PerformAction; ) = _PerformAction;
const factory CalendarSettingEvent.updateLayoutSetting( const factory CalendarSettingEvent.updateLayoutSetting(
CalendarLayoutSettingsPB setting, CalendarLayoutSettingPB setting,
) = _UpdateLayoutSetting; ) = _UpdateLayoutSetting;
} }

View File

@ -4,7 +4,7 @@ import 'package:appflowy/plugins/database_view/widgets/card/card_cell_builder.da
import 'package:appflowy/plugins/database_view/widgets/card/cells/text_card_cell.dart'; import 'package:appflowy/plugins/database_view/widgets/card/cells/text_card_cell.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cell_builder.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cell_builder.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart'; import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';

View File

@ -6,8 +6,7 @@ import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.da
import 'package:appflowy/startup/startup.dart'; import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart'; import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle_style.dart'; import 'package:appflowy/workspace/presentation/widgets/toggle/toggle_style.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart' import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
hide DateFormat;
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
@ -22,7 +21,7 @@ import 'calendar_setting.dart';
/// calendar /// calendar
class CalendarLayoutSetting extends StatefulWidget { class CalendarLayoutSetting extends StatefulWidget {
final CalendarSettingContext settingContext; final CalendarSettingContext settingContext;
final Function(CalendarLayoutSettingsPB? layoutSettings) onUpdated; final Function(CalendarLayoutSettingPB? layoutSettings) onUpdated;
const CalendarLayoutSetting({ const CalendarLayoutSetting({
required this.onUpdated, required this.onUpdated,
@ -47,7 +46,7 @@ class _CalendarLayoutSettingState extends State<CalendarLayoutSetting> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocBuilder<CalendarSettingBloc, CalendarSettingState>( return BlocBuilder<CalendarSettingBloc, CalendarSettingState>(
builder: (context, state) { builder: (context, state) {
final CalendarLayoutSettingsPB? settings = state.layoutSetting final CalendarLayoutSettingPB? settings = state.layoutSetting
.foldLeft(null, (previous, settings) => settings); .foldLeft(null, (previous, settings) => settings);
if (settings == null) { if (settings == null) {
@ -95,7 +94,7 @@ class _CalendarLayoutSettingState extends State<CalendarLayoutSetting> {
return LayoutDateField( return LayoutDateField(
fieldController: widget.settingContext.fieldController, fieldController: widget.settingContext.fieldController,
viewId: widget.settingContext.viewId, viewId: widget.settingContext.viewId,
fieldId: settings.layoutFieldId, fieldId: settings.fieldId,
popoverMutex: popoverMutex, popoverMutex: popoverMutex,
onUpdated: (fieldId) { onUpdated: (fieldId) {
_updateLayoutSettings( _updateLayoutSettings(
@ -128,7 +127,7 @@ class _CalendarLayoutSettingState extends State<CalendarLayoutSetting> {
} }
List<CalendarLayoutSettingAction> _availableCalendarSettings( List<CalendarLayoutSettingAction> _availableCalendarSettings(
CalendarLayoutSettingsPB layoutSettings, CalendarLayoutSettingPB layoutSettings,
) { ) {
List<CalendarLayoutSettingAction> settings = [ List<CalendarLayoutSettingAction> settings = [
CalendarLayoutSettingAction.layoutField, CalendarLayoutSettingAction.layoutField,
@ -162,13 +161,13 @@ class _CalendarLayoutSettingState extends State<CalendarLayoutSetting> {
void _updateLayoutSettings( void _updateLayoutSettings(
BuildContext context, { BuildContext context, {
required Function(CalendarLayoutSettingsPB? layoutSettings) onUpdated, required Function(CalendarLayoutSettingPB? layoutSettings) onUpdated,
bool? showWeekends, bool? showWeekends,
bool? showWeekNumbers, bool? showWeekNumbers,
int? firstDayOfWeek, int? firstDayOfWeek,
String? layoutFieldId, String? layoutFieldId,
}) { }) {
CalendarLayoutSettingsPB setting = context CalendarLayoutSettingPB setting = context
.read<CalendarSettingBloc>() .read<CalendarSettingBloc>()
.state .state
.layoutSetting .layoutSetting
@ -185,7 +184,7 @@ class _CalendarLayoutSettingState extends State<CalendarLayoutSetting> {
setting.firstDayOfWeek = firstDayOfWeek; setting.firstDayOfWeek = firstDayOfWeek;
} }
if (layoutFieldId != null) { if (layoutFieldId != null) {
setting.layoutFieldId = layoutFieldId; setting.fieldId = layoutFieldId;
} }
}); });
context context

View File

@ -2,7 +2,7 @@ import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy/plugins/database_view/calendar/application/calendar_setting_bloc.dart'; import 'package:appflowy/plugins/database_view/calendar/application/calendar_setting_bloc.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/button.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/scrolling/styled_list.dart';
@ -19,8 +19,8 @@ import 'calendar_layout_setting.dart';
/// contents with the submenu when a category is selected. /// contents with the submenu when a category is selected.
class CalendarSetting extends StatelessWidget { class CalendarSetting extends StatelessWidget {
final CalendarSettingContext settingContext; final CalendarSettingContext settingContext;
final CalendarLayoutSettingsPB? layoutSettings; final CalendarLayoutSettingPB? layoutSettings;
final Function(CalendarLayoutSettingsPB? layoutSettings) onUpdated; final Function(CalendarLayoutSettingPB? layoutSettings) onUpdated;
const CalendarSetting({ const CalendarSetting({
required this.onUpdated, required this.onUpdated,

View File

@ -1,8 +1,8 @@
import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart';
import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,8 +1,8 @@
import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart';
import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checklist_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -2,13 +2,13 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_filter.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_filter.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checklist_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_filter.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_filter.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/number_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/text_filter.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -2,8 +2,8 @@ import 'package:appflowy/plugins/database_view/application/filter/filter_listene
import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,6 +1,6 @@
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -1,8 +1,8 @@
import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_listener.dart';
import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart'; import 'package:appflowy/plugins/database_view/application/filter/filter_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/filter_info.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/text_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -5,7 +5,8 @@ import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/protobuf.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import '../../application/field/field_controller.dart'; import '../../application/field/field_controller.dart';
@ -65,7 +66,7 @@ class GridBloc extends Bloc<GridEvent, GridState> {
return super.close(); return super.close();
} }
RowCache? getRowCache(String blockId, String rowId) { RowCache? getRowCache(Int64 rowId) {
return databaseController.rowCache; return databaseController.rowCache;
} }

View File

@ -1,6 +1,6 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,7 +1,7 @@
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbserver.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,9 +1,9 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy/plugins/database_view/application/sort/sort_service.dart'; import 'package:appflowy/plugins/database_view/application/sort/sort_service.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/sort/sort_info.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/sort/sort_info.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbenum.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbserver.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,6 +1,6 @@
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cell_builder.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cell_builder.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/setting_entities.pbenum.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui_web.dart'; import 'package:flowy_infra_ui/flowy_infra_ui_web.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart'; import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
@ -271,7 +271,6 @@ class _GridRowsState extends State<_GridRows> {
Animation<double> animation, Animation<double> animation,
) { ) {
final rowCache = context.read<GridBloc>().getRowCache( final rowCache = context.read<GridBloc>().getRowCache(
rowInfo.rowPB.blockId,
rowInfo.rowPB.id, rowInfo.rowPB.id,
); );

View File

@ -5,7 +5,7 @@ import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_filter.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_filter.pbenum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -4,7 +4,7 @@ import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_filter.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checklist_filter.pbenum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import '../../condition_button.dart'; import '../../condition_button.dart';

View File

@ -3,8 +3,8 @@ import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../condition_button.dart'; import '../../condition_button.dart';

View File

@ -1,10 +1,10 @@
import 'package:appflowy/plugins/database_view/grid/application/filter/select_option_filter_list_bloc.dart'; import 'package:appflowy/plugins/database_view/grid/application/filter/select_option_filter_list_bloc.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart'; import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -1,8 +1,8 @@
import 'package:appflowy/plugins/database_view/grid/application/filter/select_option_filter_bloc.dart'; import 'package:appflowy/plugins/database_view/grid/application/filter/select_option_filter_bloc.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -1,7 +1,7 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/type_option/builder.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/type_option/builder.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import '../../filter_info.dart'; import '../../filter_info.dart';

View File

@ -4,7 +4,7 @@ import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/text_filter.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../application/filter/text_filter_editor_bloc.dart'; import '../../../../application/filter/text_filter_editor_bloc.dart';

View File

@ -1,11 +1,11 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/checklist_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_option_filter.pbserver.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option_filter.pbserver.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_filter.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/text_filter.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/util.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/util.pb.dart';
class FilterInfo { class FilterInfo {
final String viewId; final String viewId;

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'choicechip/checkbox.dart'; import 'choicechip/checkbox.dart';

View File

@ -5,7 +5,7 @@ import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart'; import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -1,6 +1,6 @@
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
extension FieldTypeListExtension on FieldType { extension FieldTypeListExtension on FieldType {
String iconName() { String iconName() {

View File

@ -2,7 +2,7 @@ import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../layout/sizes.dart'; import '../../layout/sizes.dart';
import 'field_type_extension.dart'; import 'field_type_extension.dart';

View File

@ -7,7 +7,7 @@ import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import '../../layout/sizes.dart'; import '../../layout/sizes.dart';

View File

@ -9,7 +9,7 @@ import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:reorderables/reorderables.dart'; import 'package:reorderables/reorderables.dart';

View File

@ -3,17 +3,15 @@ import 'dart:typed_data';
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart';
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_data_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_data_controller.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/checkbox_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/number_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/text_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checkbox_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/checklist_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/multi_select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/single_select_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/text_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option.pb.dart';
import 'package:protobuf/protobuf.dart' hide FieldInfo; import 'package:protobuf/protobuf.dart' hide FieldInfo;
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'checkbox.dart'; import 'checkbox.dart';
import 'checklist.dart'; import 'checklist.dart';

View File

@ -2,11 +2,11 @@ import 'package:appflowy/plugins/database_view/application/field/type_option/dat
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart'; import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle_style.dart'; import 'package:appflowy/workspace/presentation/widgets/toggle/toggle_style.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pbenum.dart';
import 'package:easy_localization/easy_localization.dart' hide DateFormat; import 'package:easy_localization/easy_localization.dart' hide DateFormat;
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
@ -75,7 +75,10 @@ class DateTypeOptionWidget extends TypeOptionWidget {
); );
} }
Widget _renderDateFormatButton(BuildContext context, DateFormat dataFormat) { Widget _renderDateFormatButton(
BuildContext context,
DateFormatPB dataFormat,
) {
return AppFlowyPopover( return AppFlowyPopover(
mutex: popoverMutex, mutex: popoverMutex,
asBarrier: true, asBarrier: true,
@ -102,7 +105,10 @@ class DateTypeOptionWidget extends TypeOptionWidget {
); );
} }
Widget _renderTimeFormatButton(BuildContext context, TimeFormat timeFormat) { Widget _renderTimeFormatButton(
BuildContext context,
TimeFormatPB timeFormat,
) {
return AppFlowyPopover( return AppFlowyPopover(
mutex: popoverMutex, mutex: popoverMutex,
asBarrier: true, asBarrier: true,
@ -158,7 +164,7 @@ class DateFormatButton extends StatelessWidget {
} }
class TimeFormatButton extends StatelessWidget { class TimeFormatButton extends StatelessWidget {
final TimeFormat timeFormat; final TimeFormatPB timeFormat;
final VoidCallback? onTap; final VoidCallback? onTap;
final void Function(bool)? onHover; final void Function(bool)? onHover;
final EdgeInsets? buttonMargins; final EdgeInsets? buttonMargins;
@ -224,8 +230,8 @@ class _IncludeTimeButton extends StatelessWidget {
} }
class DateFormatList extends StatelessWidget { class DateFormatList extends StatelessWidget {
final DateFormat selectedFormat; final DateFormatPB selectedFormat;
final Function(DateFormat format) onSelected; final Function(DateFormatPB format) onSelected;
const DateFormatList({ const DateFormatList({
required this.selectedFormat, required this.selectedFormat,
required this.onSelected, required this.onSelected,
@ -234,7 +240,7 @@ class DateFormatList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final cells = DateFormat.values.map((format) { final cells = DateFormatPB.values.map((format) {
return DateFormatCell( return DateFormatCell(
dateFormat: format, dateFormat: format,
onSelected: onSelected, onSelected: onSelected,
@ -261,8 +267,8 @@ class DateFormatList extends StatelessWidget {
class DateFormatCell extends StatelessWidget { class DateFormatCell extends StatelessWidget {
final bool isSelected; final bool isSelected;
final DateFormat dateFormat; final DateFormatPB dateFormat;
final Function(DateFormat format) onSelected; final Function(DateFormatPB format) onSelected;
const DateFormatCell({ const DateFormatCell({
required this.dateFormat, required this.dateFormat,
required this.onSelected, required this.onSelected,
@ -288,18 +294,18 @@ class DateFormatCell extends StatelessWidget {
} }
} }
extension DateFormatExtension on DateFormat { extension DateFormatExtension on DateFormatPB {
String title() { String title() {
switch (this) { switch (this) {
case DateFormat.Friendly: case DateFormatPB.Friendly:
return LocaleKeys.grid_field_dateFormatFriendly.tr(); return LocaleKeys.grid_field_dateFormatFriendly.tr();
case DateFormat.ISO: case DateFormatPB.ISO:
return LocaleKeys.grid_field_dateFormatISO.tr(); return LocaleKeys.grid_field_dateFormatISO.tr();
case DateFormat.Local: case DateFormatPB.Local:
return LocaleKeys.grid_field_dateFormatLocal.tr(); return LocaleKeys.grid_field_dateFormatLocal.tr();
case DateFormat.US: case DateFormatPB.US:
return LocaleKeys.grid_field_dateFormatUS.tr(); return LocaleKeys.grid_field_dateFormatUS.tr();
case DateFormat.DayMonthYear: case DateFormatPB.DayMonthYear:
return LocaleKeys.grid_field_dateFormatDayMonthYear.tr(); return LocaleKeys.grid_field_dateFormatDayMonthYear.tr();
default: default:
throw UnimplementedError; throw UnimplementedError;
@ -308,8 +314,8 @@ extension DateFormatExtension on DateFormat {
} }
class TimeFormatList extends StatelessWidget { class TimeFormatList extends StatelessWidget {
final TimeFormat selectedFormat; final TimeFormatPB selectedFormat;
final Function(TimeFormat format) onSelected; final Function(TimeFormatPB format) onSelected;
const TimeFormatList({ const TimeFormatList({
required this.selectedFormat, required this.selectedFormat,
required this.onSelected, required this.onSelected,
@ -318,7 +324,7 @@ class TimeFormatList extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final cells = TimeFormat.values.map((format) { final cells = TimeFormatPB.values.map((format) {
return TimeFormatCell( return TimeFormatCell(
isSelected: format == selectedFormat, isSelected: format == selectedFormat,
timeFormat: format, timeFormat: format,
@ -344,9 +350,9 @@ class TimeFormatList extends StatelessWidget {
} }
class TimeFormatCell extends StatelessWidget { class TimeFormatCell extends StatelessWidget {
final TimeFormat timeFormat; final TimeFormatPB timeFormat;
final bool isSelected; final bool isSelected;
final Function(TimeFormat format) onSelected; final Function(TimeFormatPB format) onSelected;
const TimeFormatCell({ const TimeFormatCell({
required this.timeFormat, required this.timeFormat,
required this.onSelected, required this.onSelected,
@ -372,12 +378,12 @@ class TimeFormatCell extends StatelessWidget {
} }
} }
extension TimeFormatExtension on TimeFormat { extension TimeFormatExtension on TimeFormatPB {
String title() { String title() {
switch (this) { switch (this) {
case TimeFormat.TwelveHour: case TimeFormatPB.TwelveHour:
return LocaleKeys.grid_field_timeFormatTwelveHour.tr(); return LocaleKeys.grid_field_timeFormatTwelveHour.tr();
case TimeFormat.TwentyFourHour: case TimeFormatPB.TwentyFourHour:
return LocaleKeys.grid_field_timeFormatTwentyFourHour.tr(); return LocaleKeys.grid_field_timeFormatTwentyFourHour.tr();
default: default:
throw UnimplementedError; throw UnimplementedError;

View File

@ -1,14 +1,14 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/number_bloc.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/number_bloc.dart';
import 'package:appflowy/plugins/database_view/application/field/type_option/number_format_bloc.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/number_format_bloc.dart';
import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/type_option_context.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/number_entities.pbenum.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:easy_localization/easy_localization.dart' hide NumberFormat; import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import '../../../layout/sizes.dart'; import '../../../layout/sizes.dart';
@ -117,11 +117,11 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
} }
} }
typedef SelectNumberFormatCallback = Function(NumberFormat format); typedef SelectNumberFormatCallback = Function(NumberFormatPB format);
class NumberFormatList extends StatelessWidget { class NumberFormatList extends StatelessWidget {
final SelectNumberFormatCallback onSelected; final SelectNumberFormatCallback onSelected;
final NumberFormat selectedFormat; final NumberFormatPB selectedFormat;
const NumberFormatList({ const NumberFormatList({
required this.selectedFormat, required this.selectedFormat,
required this.onSelected, required this.onSelected,
@ -174,9 +174,9 @@ class NumberFormatList extends StatelessWidget {
} }
class NumberFormatCell extends StatelessWidget { class NumberFormatCell extends StatelessWidget {
final NumberFormat format; final NumberFormatPB format;
final bool isSelected; final bool isSelected;
final Function(NumberFormat format) onSelected; final Function(NumberFormatPB format) onSelected;
const NumberFormatCell({ const NumberFormatCell({
required this.isSelected, required this.isSelected,
required this.format, required this.format,

View File

@ -1,9 +1,9 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/select_option_type_option_bloc.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/select_option_type_option_bloc.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';

View File

@ -1,5 +1,6 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/edit_select_option_bloc.dart'; import 'package:appflowy/plugins/database_view/application/field/type_option/edit_select_option_bloc.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart'; import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart'; import 'package:flowy_infra_ui/style_widget/button.dart';
@ -7,7 +8,6 @@ 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/style_widget/text.dart';
import 'package:flowy_infra_ui/style_widget/text_field.dart'; import 'package:flowy_infra_ui/style_widget/text_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart'; import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';

View File

@ -1,6 +1,6 @@
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbenum.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/button.dart'; import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_infra_ui/style_widget/text.dart';

View File

@ -3,7 +3,7 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/grid/application/sort/sort_editor_bloc.dart'; import 'package:appflowy/plugins/database_view/grid/application/sort/sort_editor_bloc.dart';
import 'package:appflowy/plugins/database_view/grid/application/sort/util.dart'; import 'package:appflowy/plugins/database_view/grid/application/sort/util.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pbenum.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/database_view/application/field/field_controller.dart'; import 'package:appflowy/plugins/database_view/application/field/field_controller.dart';
import 'package:appflowy_backend/protobuf/flowy-database/sort_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/sort_entities.pb.dart';
class SortInfo { class SortInfo {
final SortPB sortPB; final SortPB sortPB;

View File

@ -1,4 +1,4 @@
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,6 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy_backend/protobuf/flowy-database/url_type_option_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/url_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -1,6 +1,6 @@
import 'package:appflowy/plugins/database_view/application/row/row_cache.dart'; import 'package:appflowy/plugins/database_view/application/row/row_cache.dart';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/row/action.dart'; import 'package:appflowy/plugins/database_view/grid/presentation/widgets/row/action.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';

View File

@ -1,6 +1,6 @@
import 'dart:collection'; import 'dart:collection';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/row_entities.pb.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../application/cell/cell_service.dart'; import '../../application/cell/cell_service.dart';

View File

@ -1,6 +1,7 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_service.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_service.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pbenum.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
typedef CellRenderHook<C, T> = Widget? Function(C cellData, T cardData); typedef CellRenderHook<C, T> = Widget? Function(C cellData, T cardData);
@ -121,7 +122,7 @@ abstract class EditableCell {
class EditableCellId { class EditableCellId {
String fieldId; String fieldId;
String rowId; Int64 rowId;
EditableCellId(this.rowId, this.fieldId); EditableCellId(this.rowId, this.fieldId);

View File

@ -1,7 +1,7 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_editor.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_editor.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:appflowy_popover/appflowy_popover.dart'; import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/field_entities.pb.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

View File

@ -1,7 +1,7 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_service.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_service.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async'; import 'dart:async';

View File

@ -2,9 +2,9 @@ import 'dart:async';
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_service.dart'; import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/select_option_service.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/select_option.pb.dart';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -2,13 +2,12 @@ import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy/plugins/database_view/application/cell/cell_service.dart'; import 'package:appflowy/plugins/database_view/application/cell/cell_service.dart';
import 'package:appflowy/plugins/database_view/application/field/field_service.dart'; import 'package:appflowy/plugins/database_view/application/field/field_service.dart';
import 'package:appflowy_backend/protobuf/flowy-database2/date_entities.pb.dart';
import 'package:easy_localization/easy_localization.dart' import 'package:easy_localization/easy_localization.dart'
show StringTranslateExtension; show StringTranslateExtension;
import 'package:appflowy_backend/log.dart'; import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/code.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/code.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:table_calendar/table_calendar.dart'; import 'package:table_calendar/table_calendar.dart';
@ -154,10 +153,10 @@ class DateCellCalendarBloc
String timeFormatPrompt(FlowyError error) { String timeFormatPrompt(FlowyError error) {
String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}."; String msg = "${LocaleKeys.grid_field_invalidTimeFormat.tr()}.";
switch (state.dateTypeOptionPB.timeFormat) { switch (state.dateTypeOptionPB.timeFormat) {
case TimeFormat.TwelveHour: case TimeFormatPB.TwelveHour:
msg = "$msg e.g. 01:00 PM"; msg = "$msg e.g. 01:00 PM";
break; break;
case TimeFormat.TwentyFourHour: case TimeFormatPB.TwentyFourHour:
msg = "$msg e.g. 13:00"; msg = "$msg e.g. 13:00";
break; break;
default: default:
@ -188,8 +187,8 @@ class DateCellCalendarBloc
Future<void>? _updateTypeOption( Future<void>? _updateTypeOption(
Emitter<DateCellCalendarState> emit, { Emitter<DateCellCalendarState> emit, {
DateFormat? dateFormat, DateFormatPB? dateFormat,
TimeFormat? timeFormat, TimeFormatPB? timeFormat,
}) async { }) async {
state.dateTypeOptionPB.freeze(); state.dateTypeOptionPB.freeze();
final newDateTypeOption = state.dateTypeOptionPB.rebuild((typeOption) { final newDateTypeOption = state.dateTypeOptionPB.rebuild((typeOption) {
@ -227,9 +226,9 @@ class DateCellCalendarEvent with _$DateCellCalendarEvent {
const factory DateCellCalendarEvent.setCalFormat(CalendarFormat format) = const factory DateCellCalendarEvent.setCalFormat(CalendarFormat format) =
_CalendarFormat; _CalendarFormat;
const factory DateCellCalendarEvent.setFocusedDay(DateTime day) = _FocusedDay; const factory DateCellCalendarEvent.setFocusedDay(DateTime day) = _FocusedDay;
const factory DateCellCalendarEvent.setTimeFormat(TimeFormat timeFormat) = const factory DateCellCalendarEvent.setTimeFormat(TimeFormatPB timeFormat) =
_TimeFormat; _TimeFormat;
const factory DateCellCalendarEvent.setDateFormat(DateFormat dateFormat) = const factory DateCellCalendarEvent.setDateFormat(DateFormatPB dateFormat) =
_DateFormat; _DateFormat;
const factory DateCellCalendarEvent.setIncludeTime(bool includeTime) = const factory DateCellCalendarEvent.setIncludeTime(bool includeTime) =
_IncludeTime; _IncludeTime;
@ -276,9 +275,9 @@ class DateCellCalendarState with _$DateCellCalendarState {
String _timeHintText(DateTypeOptionPB typeOption) { String _timeHintText(DateTypeOptionPB typeOption) {
switch (typeOption.timeFormat) { switch (typeOption.timeFormat) {
case TimeFormat.TwelveHour: case TimeFormatPB.TwelveHour:
return LocaleKeys.document_date_timeHintTextInTwelveHour.tr(); return LocaleKeys.document_date_timeHintTextInTwelveHour.tr();
case TimeFormat.TwentyFourHour: case TimeFormatPB.TwentyFourHour:
return LocaleKeys.document_date_timeHintTextInTwentyFourHour.tr(); return LocaleKeys.document_date_timeHintTextInTwentyFourHour.tr();
default: default:
return ""; return "";

Some files were not shown because too many files have changed in this diff Show More