Nathan.fooo 69a7ae5201
Implement Grid's filter UI (#1474)
* fix: border of field cell

* chore: add filter button

* chore: refactor setting button event

* chore: notify row did changed with filter configuration

* chore: add filter bloc test

* chore: config add filter button

* chore: create filter

* chore: load filters and update corresponding field property

* chore: add filter choice chip

* chore: config choice chip ui

* chore: send notification when filter updated

* chore: update filter after update field type option data

* fix: remove/add filter when update field's type option

* chore: create home setting bloc to save the setting of the home screen

* chore: add filter test

* chore: edit text filter ui

* fix: filter cell bugs

* fix: insert row out of bound

* chore: update setting icon in grid

* chore: shrink wrap the filter list

* refactor: extract row container from row cache

* chore: disable split-debuginfo

Co-authored-by: nathan <nathan@appflowy.io>
2022-11-26 21:28:08 +08:00

17 lines
453 B
Dart
Executable File

import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
import 'sizes.dart';
class GridLayout {
static double headerWidth(List<FieldInfo> fields) {
if (fields.isEmpty) return 0;
final fieldsWidth = fields
.map((field) => field.width.toDouble())
.reduce((value, element) => value + element);
return fieldsWidth +
GridSize.leadingHeaderPadding +
GridSize.trailHeaderPadding;
}
}