@@ -43,21 +43,23 @@ class _GridFieldCellActionSheetState extends State<GridFieldCellActionSheet> {
4343 return BlocProvider (
4444 create: (context) =>
4545 getIt <FieldActionSheetBloc >(param1: widget.cellContext),
46- child: SingleChildScrollView (
47- padding: const EdgeInsets .all (12.0 ),
48- child: Column (
49- children: [
50- _EditFieldButton (
51- cellContext: widget.cellContext,
52- onTap: () {
53- setState (() {
54- _showFieldEditor = true ;
55- });
56- },
57- ),
58- VSpace (GridSize .typeOptionSeparatorHeight),
59- _FieldOperationList (widget.cellContext, () {}),
60- ],
46+ child: IntrinsicWidth (
47+ child: IntrinsicHeight (
48+ child: Column (
49+ crossAxisAlignment: CrossAxisAlignment .start,
50+ children: [
51+ _EditFieldButton (
52+ cellContext: widget.cellContext,
53+ onTap: () {
54+ setState (() {
55+ _showFieldEditor = true ;
56+ });
57+ },
58+ ),
59+ VSpace (GridSize .typeOptionSeparatorHeight),
60+ _FieldOperationList (widget.cellContext),
61+ ],
62+ ),
6163 ),
6264 ),
6365 );
@@ -90,22 +92,17 @@ class _EditFieldButton extends StatelessWidget {
9092
9193class _FieldOperationList extends StatelessWidget {
9294 final GridFieldCellContext fieldInfo;
93- final VoidCallback onDismissed ;
94- const _FieldOperationList ( this .fieldInfo, this .onDismissed, { Key ? key})
95- : super (key: key);
95+ final double cellWidth = 100 ;
96+
97+ const _FieldOperationList ( this .fieldInfo, { Key ? key}) : super (key: key);
9698
9799 @override
98100 Widget build (BuildContext context) {
99- return GridView (
100- // https://api.flutter.dev/flutter/widgets/AnimatedList/shrinkWrap.html
101- shrinkWrap: true ,
102- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
103- crossAxisCount: 2 ,
104- childAspectRatio: 4.0 ,
105- mainAxisSpacing: GridSize .typeOptionSeparatorHeight,
106- crossAxisSpacing: GridSize .typeOptionSeparatorHeight,
101+ return SizedBox (
102+ width: cellWidth * 2 ,
103+ child: Wrap (
104+ children: buildCells (),
107105 ),
108- children: buildCells (),
109106 );
110107 }
111108
@@ -121,11 +118,14 @@ class _FieldOperationList extends StatelessWidget {
121118 break ;
122119 }
123120
124- return FieldActionCell (
125- fieldInfo: fieldInfo,
126- action: action,
127- onTap: onDismissed,
128- enable: enable,
121+ return SizedBox (
122+ height: GridSize .typeOptionItemHeight,
123+ width: cellWidth,
124+ child: FieldActionCell (
125+ fieldInfo: fieldInfo,
126+ action: action,
127+ enable: enable,
128+ ),
129129 );
130130 },
131131 ).toList ();
@@ -134,14 +134,12 @@ class _FieldOperationList extends StatelessWidget {
134134
135135class FieldActionCell extends StatelessWidget {
136136 final GridFieldCellContext fieldInfo;
137- final VoidCallback onTap;
138137 final FieldAction action;
139138 final bool enable;
140139
141140 const FieldActionCell ({
142141 required this .fieldInfo,
143142 required this .action,
144- required this .onTap,
145143 required this .enable,
146144 Key ? key,
147145 }) : super (key: key);
@@ -156,7 +154,6 @@ class FieldActionCell extends StatelessWidget {
156154 onTap: () {
157155 if (enable) {
158156 action.run (context, fieldInfo);
159- onTap ();
160157 }
161158 },
162159 leftIcon: svgWidget (
0 commit comments