chore: optimaze tap area of row detail cells

This commit is contained in:
appflowy 2022-06-01 16:40:24 +08:00
parent 5bd0fb9fae
commit 0b83684c66
2 changed files with 10 additions and 50 deletions

View File

@ -1,44 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/grid/prelude.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class NumberCell extends StatefulWidget {
final GridCell cellData;
const NumberCell({
required this.cellData,
Key? key,
}) : super(key: key);
@override
State<NumberCell> createState() => _NumberCellState();
}
class _NumberCellState extends State<NumberCell> {
late NumberCellBloc _cellBloc;
@override
void initState() {
_cellBloc = getIt<NumberCellBloc>(param1: widget.cellData);
super.initState();
}
@override
Widget build(BuildContext context) {
return BlocProvider.value(
value: _cellBloc,
child: BlocBuilder<NumberCellBloc, NumberCellState>(
builder: (context, state) {
return Container();
},
),
);
}
@override
Future<void> dispose() async {
_cellBloc.close();
super.dispose();
}
}

View File

@ -152,6 +152,15 @@ class _RowDetailCell extends StatelessWidget {
final style = _customCellStyle(theme, gridCell.field.fieldType);
final cell = buildGridCellWidget(gridCell, cellCache, style: style);
final gesture = GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => cell.requestBeginFocus.notify(),
child: AccessoryHover(
child: cell,
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12),
),
);
return ConstrainedBox(
constraints: const BoxConstraints(minHeight: 40),
child: IntrinsicHeight(
@ -164,12 +173,7 @@ class _RowDetailCell extends StatelessWidget {
child: FieldCellButton(field: gridCell.field, onTap: () => _showFieldEditor(context)),
),
const HSpace(10),
Expanded(
child: AccessoryHover(
child: cell,
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12),
),
),
Expanded(child: gesture),
],
),
),