Skip to content

Commit

Permalink
Fixed size rows with InkWell
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Nov 23, 2023
1 parent dd9fe3c commit 2ef748b
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions lib/widgets/browser/file_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _FileDataTableState extends State<FileDataTable> {
return ListView.separated(
// + 1 for the header row
controller: widget.scrollController,
shrinkWrap: true,
// shrinkWrap: true,
addAutomaticKeepAlives: true,
itemCount: sortedFileData!.length + 1,
separatorBuilder: (c, index) => const Divider(height: 1),
Expand Down Expand Up @@ -243,29 +243,33 @@ class _DataRowState extends State<DataRow> {

@override
Widget build(BuildContext context) {
return Row(
children: [
Expanded(
child: InkWell(
onLongPress: () {
setState(() {
editable = !editable;
_renameDialog(widget.file);
});
},
onTap: () => widget.file.navigateToDir(),
child: _nameCell(widget.file),
)),
Expanded(child: _dateCell(widget.file)),
Expanded(child: _fileSizeCell(widget.file)),
Expanded(child: _actionsCell(widget.file)),
],
return InkWell(
onLongPress: () {
setState(() {
editable = !editable;
_renameDialog(widget.file);
});
},
onTap: () => widget.file.navigateToDir(),
child: SizedBox(
height: 40,
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(child: _nameCell(widget.file)),
Expanded(child: _dateCell(widget.file)),
Expanded(child: _fileSizeCell(widget.file)),
Expanded(child: _actionsCell(widget.file)),
],
),
),
);
}

Widget _nameCell(FileBrowserMetadata e) {
Widget text = Text(e.friendlyFileName);
return Wrap(
crossAxisAlignment: WrapCrossAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
Expand Down

0 comments on commit 2ef748b

Please sign in to comment.