diff --git a/android/gradle.properties b/android/gradle.properties index aa51064abebb79ba519e600afb7af23779154d4e..135006f9c1386c8757595c43e890e911f732f5a3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.5 -app.versionCode=5 +app.versionName=0.0.6 +app.versionCode=6 diff --git a/lib/entities/tile.dart b/lib/entities/tile.dart index 9d80d4a5758c1dbf440761fd16cea273f0aa4d80..e9919d72673fc50fc4fd9d535bd4f9bdfe11cb33 100644 --- a/lib/entities/tile.dart +++ b/lib/entities/tile.dart @@ -17,13 +17,60 @@ class Tile { @required this.originalRow, ); - Container widget() { + Container _tileWidget() { return Container( + decoration: BoxDecoration( + color: Colors.black, + border: Border.all( + color: Colors.black, + width: 1, + ), + ), child: Image( image: this.image.image, width: this.size, height: this.size, fit: BoxFit.fill + ), + ); + } + + Container widget() { + return Container( + child: DragTarget<List<int>>( + builder: ( + BuildContext context, + List<dynamic> accepted, + List<dynamic> rejected, + ) { + return Container( + height: this.size, + width: this.size, + color: Colors.cyan, + child: Draggable<List<int>>( + data: [ + this.currentCol, + this.currentRow, + ], + + // Widget when draggable is stationary + child: this._tileWidget(), + + // Widget when draggable is being dragged + feedback: this._tileWidget(), + + // Widget to display on original place when being dragged + childWhenDragging: Container( + height: this.size, + width: this.size, + color: Colors.pinkAccent, + ), + ), + ); + }, + onAccept: (List<int> data) { + print(data.toString()); + }, ) ); }