mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: optimaze tap area of row detail cells
This commit is contained in:
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -152,6 +152,15 @@ class _RowDetailCell extends StatelessWidget {
|
|||||||
final style = _customCellStyle(theme, gridCell.field.fieldType);
|
final style = _customCellStyle(theme, gridCell.field.fieldType);
|
||||||
final cell = buildGridCellWidget(gridCell, cellCache, style: style);
|
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(
|
return ConstrainedBox(
|
||||||
constraints: const BoxConstraints(minHeight: 40),
|
constraints: const BoxConstraints(minHeight: 40),
|
||||||
child: IntrinsicHeight(
|
child: IntrinsicHeight(
|
||||||
@ -164,12 +173,7 @@ class _RowDetailCell extends StatelessWidget {
|
|||||||
child: FieldCellButton(field: gridCell.field, onTap: () => _showFieldEditor(context)),
|
child: FieldCellButton(field: gridCell.field, onTap: () => _showFieldEditor(context)),
|
||||||
),
|
),
|
||||||
const HSpace(10),
|
const HSpace(10),
|
||||||
Expanded(
|
Expanded(child: gesture),
|
||||||
child: AccessoryHover(
|
|
||||||
child: cell,
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 12),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user