mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-23 00:52:14 +00:00

* refactor: get row/field data from row cache and field controller in cell controller * refactor: reorganize cell controller tasks and builder * refactor: rename cell_builder.dart * refactor: database editable cell builder * refactor: database card cell builder * fix: make it work * fix: start cell listener and adjust cell style on desktop * fix: build card cell * fix: remove unnecessary await in tests * fix: cell cache validation * fix: row detail banner bugs * fix: row detail field doesn't update * fix: calendar event card * test: fix integration tests * fix: adjust cell builders to fix cell controller getting disposed * chore: code review * fix: bugs on mobile * test: add grid header integration tests * test: suppress warnings, reduce flaky test and group tests
50 lines
1.7 KiB
Dart
50 lines
1.7 KiB
Dart
import 'dart:collection';
|
|
|
|
// TODO(RS): remove dependency on presentation code
|
|
import 'package:appflowy/plugins/database/grid/presentation/widgets/filter/filter_info.dart';
|
|
import 'package:appflowy/plugins/database/grid/presentation/widgets/sort/sort_info.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-database2/database_entities.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
|
import 'package:dartz/dartz.dart';
|
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
import 'cell/cell_controller.dart';
|
|
import 'field/field_info.dart';
|
|
import 'row/row_cache.dart';
|
|
import 'row/row_service.dart';
|
|
|
|
part 'defines.freezed.dart';
|
|
|
|
typedef OnFieldsChanged = void Function(UnmodifiableListView<FieldInfo>);
|
|
typedef OnFiltersChanged = void Function(List<FilterInfo>);
|
|
typedef OnSortsChanged = void Function(List<SortInfo>);
|
|
typedef OnDatabaseChanged = void Function(DatabasePB);
|
|
|
|
typedef OnRowsCreated = void Function(List<RowId> rowIds);
|
|
typedef OnRowsUpdated = void Function(
|
|
List<RowId> rowIds,
|
|
ChangedReason reason,
|
|
);
|
|
typedef OnRowsDeleted = void Function(List<RowId> rowIds);
|
|
typedef OnNumOfRowsChanged = void Function(
|
|
UnmodifiableListView<RowInfo> rows,
|
|
UnmodifiableMapView<RowId, RowInfo> rowById,
|
|
ChangedReason reason,
|
|
);
|
|
|
|
typedef OnError = void Function(FlowyError);
|
|
|
|
typedef CellContextByFieldId = LinkedHashMap<String, CellContext>;
|
|
|
|
@freezed
|
|
class LoadingState with _$LoadingState {
|
|
const factory LoadingState.idle() = _Idle;
|
|
const factory LoadingState.loading() = _Loading;
|
|
const factory LoadingState.finish(
|
|
Either<Unit, FlowyError> successOrFail,
|
|
) = _Finish;
|
|
|
|
const LoadingState._();
|
|
bool isLoading() => this is _Loading;
|
|
}
|