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
b3d7877e
Commit
b3d7877e
authored
Feb 20, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travail lundi
parent
46b79fb5
Changes
2
Show 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 @
b3d7877e
No preview for this file type
tp2/lib/exo6.dart
View file @
b3d7877e
...
@@ -62,16 +62,16 @@ class _Exo6 extends State<Exo6> {
...
@@ -62,16 +62,16 @@ class _Exo6 extends State<Exo6> {
-
1
+
2
*
i
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
))
-
1
+
2
*
i
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
))
);
);
Key
k
=
UniqueKey
();
tiles
.
add
(
tiles
.
add
(
Flexible
(
child:
Container
(
Flexible
(
key:
k
,
child:
Container
(
margin:
EdgeInsets
.
all
(
10.0
/
colNb
),
margin:
EdgeInsets
.
all
(
10.0
/
colNb
),
child:
InkWell
(
child:
InkWell
(
child:
tile
.
croppedImageTile
(
1
/
colNb
),
child:
tile
.
croppedImageTile
(
1
/
colNb
),
onTap:
()
{
onTap:
()
{
setState
(()
{
setState
(()
{
print
(
indexcopy
);
swapTiles
(
k
);
tiles
.
insert
(
emptyTileIndex
,
tiles
.
removeAt
(
indexcopy
));
emptyTileIndex
=
indexcopy
;
});
});
}
}
)
)
...
@@ -84,6 +84,13 @@ class _Exo6 extends State<Exo6> {
...
@@ -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
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
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