Widget gridviewContent() { return ReorderableListView( scrollDirection: Axis.vertical, shrinkWrap: true, scrollController: ScrollController(), onReorder: (int start, int current) { if (start < current) { int end = current - 1; TumBankaModel startItem = gelenModel[start]; int i = 0; int local = start; do { gelenModel[local] = gelenModel[++local]; i++; } while (i < end - start); gelenModel[end] = startItem; } // dragging from bottom to top else if (start > current) { TumBankaModel startItem = gelenModel[start]; for (int i = start; i > current; i--) { gelenModel[i] = gelenModel[i - 1]; } gelenModel[current] = startItem; } setState(() {}); }, children: bodyContent(), ); }
List<Widget> bodyContent() { List<Widget> list = [];
gelenModel.forEach((element) { list.add(bodyAltContent(element)); });
return list; } Padding bodyAltContent(TumBankaModel model) { return Padding( padding: EdgeInsets.only(top: 5), key: ValueKey(model), child: Material( //elevation: 10, elevation: 3, shape: RoundedRectangleBorder( borderRadius: BorderRadius.all( Radius.circular(15.0), )), child: InkWell( onTap: () {}, child: Padding( padding: EdgeInsets.all(2), child: Container( child: getColumnItem(model), ), ), ), ), ); } |