Widget _myGrid(){ return DragAndDropGridView( onWillAccept: (oldInd, newInd)=> true, onReorder: (oldInd, newInd){ changeListOrder( oldInd: oldInd, newInd: newInd, list: _indexes ); }, itemCount: ITEM_COUNT, gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 2, crossAxisSpacing: CARD_SPACE, mainAxisSpacing: 24, ), itemBuilder: (context, index)=> _itemBuilder(index), ); }
![[Flutter/dart] ドラッグ&ドロップ可能なgridviewを作成する](https://cdn-ak-scissors.b.st-hatena.com/image/square/2212d42bf5143384794b145bce5e1053aae7f6c2/height=288;version=1;width=512/https%3A%2F%2Fstatic.wixstatic.com%2Fmedia%2F90b712_e9f30d9a3cf944b197bb136e0f4a3600f000.jpg%2Fv1%2Ffill%2Fw_768%2Ch_576%2Cal_c%2Clg_1%2Cq_85%2F90b712_e9f30d9a3cf944b197bb136e0f4a3600f000.jpg)