diff --git a/lib/src/model/pluto_column_type.dart b/lib/src/model/pluto_column_type.dart index 68256a85..01cb713c 100644 --- a/lib/src/model/pluto_column_type.dart +++ b/lib/src/model/pluto_column_type.dart @@ -99,6 +99,7 @@ abstract class PlutoColumnType { bool enableColumnFilter = false, IconData? popupIcon = Icons.arrow_drop_down, Widget Function(dynamic item)? builder, + double? width, }) { return PlutoColumnTypeSelect( onItemSelected: onItemSelected ?? (event) {}, @@ -106,7 +107,8 @@ abstract class PlutoColumnType { items: items, enableColumnFilter: enableColumnFilter, popupIcon: popupIcon, - builder: builder); + builder: builder, + width: width); } /// Set as a date column. @@ -367,6 +369,8 @@ class PlutoColumnTypeSelect final bool enableColumnFilter; final Function(PlutoGridOnSelectedEvent event) onItemSelected; + final double? width; + @override final IconData? popupIcon; @@ -376,7 +380,8 @@ class PlutoColumnTypeSelect required this.items, required this.enableColumnFilter, this.popupIcon, - this.builder}); + this.builder, + this.width}); @override bool isValid(dynamic value) => items.contains(value) == true; diff --git a/lib/src/ui/cells/pluto_select_cell.dart b/lib/src/ui/cells/pluto_select_cell.dart index c31e454a..f96f649a 100644 --- a/lib/src/ui/cells/pluto_select_cell.dart +++ b/lib/src/ui/cells/pluto_select_cell.dart @@ -64,6 +64,7 @@ class PlutoSelectCellState extends State popupColumns = [ PlutoColumn( + width: widget.column.type.select.width ?? PlutoGridSettings.columnWidth, title: widget.column.title, field: widget.column.title, readOnly: true,