|
@@ -1,12 +1,14 @@
|
|
import 'package:app_flowy/workspace/application/grid/field/field_service.dart';
|
|
import 'package:app_flowy/workspace/application/grid/field/field_service.dart';
|
|
import 'package:app_flowy/workspace/application/grid/row/row_detail_bloc.dart';
|
|
import 'package:app_flowy/workspace/application/grid/row/row_detail_bloc.dart';
|
|
import 'package:app_flowy/workspace/application/grid/row/row_service.dart';
|
|
import 'package:app_flowy/workspace/application/grid/row/row_service.dart';
|
|
|
|
+import 'package:app_flowy/workspace/presentation/plugins/grid/src/layout/sizes.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/cell/prelude.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/cell/prelude.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_cell.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_editor.dart';
|
|
import 'package:app_flowy/workspace/presentation/plugins/grid/src/widgets/header/field_editor.dart';
|
|
import 'package:flowy_infra/theme.dart';
|
|
import 'package:flowy_infra/theme.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:flowy_infra_ui/style_widget/scrolling/styled_scroll_bar.dart';
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
import 'package:flowy_infra_ui/widget/spacing.dart';
|
|
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType;
|
|
import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart' show FieldType;
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
@@ -59,8 +61,8 @@ class _RowDetailPageState extends State<RowDetailPage> {
|
|
bloc.add(const RowDetailEvent.initial());
|
|
bloc.add(const RowDetailEvent.initial());
|
|
return bloc;
|
|
return bloc;
|
|
},
|
|
},
|
|
- child: const Padding(
|
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 80, vertical: 40),
|
|
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 40),
|
|
child: _PropertyList(),
|
|
child: _PropertyList(),
|
|
),
|
|
),
|
|
);
|
|
);
|
|
@@ -68,23 +70,31 @@ class _RowDetailPageState extends State<RowDetailPage> {
|
|
}
|
|
}
|
|
|
|
|
|
class _PropertyList extends StatelessWidget {
|
|
class _PropertyList extends StatelessWidget {
|
|
- const _PropertyList({
|
|
|
|
|
|
+ final ScrollController _scrollController;
|
|
|
|
+ _PropertyList({
|
|
Key? key,
|
|
Key? key,
|
|
- }) : super(key: key);
|
|
|
|
|
|
+ }) : _scrollController = ScrollController(),
|
|
|
|
+ super(key: key);
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return BlocBuilder<RowDetailBloc, RowDetailState>(
|
|
return BlocBuilder<RowDetailBloc, RowDetailState>(
|
|
buildWhen: (previous, current) => previous.cellDatas != current.cellDatas,
|
|
buildWhen: (previous, current) => previous.cellDatas != current.cellDatas,
|
|
builder: (context, state) {
|
|
builder: (context, state) {
|
|
- return ListView.separated(
|
|
|
|
- itemCount: state.cellDatas.length,
|
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
|
- return _RowDetailCell(cellData: state.cellDatas[index]);
|
|
|
|
- },
|
|
|
|
- separatorBuilder: (BuildContext context, int index) {
|
|
|
|
- return const VSpace(2);
|
|
|
|
- },
|
|
|
|
|
|
+ return ScrollbarListStack(
|
|
|
|
+ axis: Axis.vertical,
|
|
|
|
+ controller: _scrollController,
|
|
|
|
+ barSize: GridSize.scrollBarSize,
|
|
|
|
+ child: ListView.separated(
|
|
|
|
+ controller: _scrollController,
|
|
|
|
+ itemCount: state.cellDatas.length,
|
|
|
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
|
+ return _RowDetailCell(cellData: state.cellDatas[index]);
|
|
|
|
+ },
|
|
|
|
+ separatorBuilder: (BuildContext context, int index) {
|
|
|
|
+ return const VSpace(2);
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
);
|
|
);
|
|
},
|
|
},
|
|
);
|
|
);
|
|
@@ -142,7 +152,9 @@ GridCellStyle? _buildCellStyle(AppTheme theme, FieldType fieldType) {
|
|
case FieldType.DateTime:
|
|
case FieldType.DateTime:
|
|
return null;
|
|
return null;
|
|
case FieldType.MultiSelect:
|
|
case FieldType.MultiSelect:
|
|
- return null;
|
|
|
|
|
|
+ return SelectOptionCellStyle(
|
|
|
|
+ placeholder: LocaleKeys.grid_row_textPlaceholder.tr(),
|
|
|
|
+ );
|
|
case FieldType.Number:
|
|
case FieldType.Number:
|
|
return null;
|
|
return null;
|
|
case FieldType.RichText:
|
|
case FieldType.RichText:
|
|
@@ -150,7 +162,9 @@ GridCellStyle? _buildCellStyle(AppTheme theme, FieldType fieldType) {
|
|
placeholder: LocaleKeys.grid_row_textPlaceholder.tr(),
|
|
placeholder: LocaleKeys.grid_row_textPlaceholder.tr(),
|
|
);
|
|
);
|
|
case FieldType.SingleSelect:
|
|
case FieldType.SingleSelect:
|
|
- return null;
|
|
|
|
|
|
+ return SelectOptionCellStyle(
|
|
|
|
+ placeholder: LocaleKeys.grid_row_textPlaceholder.tr(),
|
|
|
|
+ );
|
|
default:
|
|
default:
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|