Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amse
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Matis SPINELLI
amse
Commits
b8559ef1
Commit
b8559ef1
authored
Feb 25, 2024
by
m-spi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://gvipers.imt-nord-europe.fr:2222/matis.spinelli/amse
parents
03a671c9
b3d7877e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
4a23385d4343c6f6c549353e2c2d78fa.cache.dill.track.dill
...ld/4a23385d4343c6f6c549353e2c2d78fa.cache.dill.track.dill
+0
-0
exo6.dart
tp2/lib/exo6.dart
+11
-4
No files found.
tp2/build/4a23385d4343c6f6c549353e2c2d78fa.cache.dill.track.dill
View file @
b8559ef1
No preview for this file type
tp2/lib/exo6.dart
View file @
b8559ef1
...
...
@@ -62,16 +62,16 @@ class _Exo6 extends State<Exo6> {
-
1
+
2
*
i
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
))
);
Key
k
=
UniqueKey
();
tiles
.
add
(
Flexible
(
child:
Container
(
Flexible
(
key:
k
,
child:
Container
(
margin:
EdgeInsets
.
all
(
10.0
/
colNb
),
child:
InkWell
(
child:
tile
.
croppedImageTile
(
1
/
colNb
),
onTap:
()
{
setState
(()
{
print
(
indexcopy
);
tiles
.
insert
(
emptyTileIndex
,
tiles
.
removeAt
(
indexcopy
));
emptyTileIndex
=
indexcopy
;
swapTiles
(
k
);
});
}
)
...
...
@@ -84,6 +84,13 @@ class _Exo6 extends State<Exo6> {
}
}
void
swapTiles
(
Key
k
){
var
t
=
tiles
.
singleWhere
((
element
)
=>
element
.
key
==
k
);
tiles
[
emptyTileIndex
]
=
t
;
tiles
[
tiles
.
indexOf
(
t
)]
=
Flexible
(
child:
Container
(
margin:
EdgeInsets
.
all
(
10.0
/
colNb
)));
emptyTileIndex
=
tiles
.
indexOf
(
t
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment