Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
JeuDeTaquin
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
Benjamin LEROUX
JeuDeTaquin
Commits
21a291b9
Commit
21a291b9
authored
Feb 13, 2021
by
Benjamin LEROUX
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exo5 commit
parent
5dfaca3c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
36 deletions
+41
-36
Plateau.dart
lib/Plateau.dart
+36
-32
Tile.dart
lib/Tile.dart
+5
-4
No files found.
lib/Plateau.dart
View file @
21a291b9
...
...
@@ -5,35 +5,26 @@ import 'Tile.dart';
class
Plateau
{
List
<
Tile
>
listTile
;
double
size
;
Plateau
({
this
.
listTile
});
Plateau
({
this
.
listTile
,
this
.
size
});
List
<
Tile
>
getListTile
(){
return
listTile
;
}
}
Tile
tile
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(-
1
,
-
1
));
Tile
tile2
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
0
,
-
1
));
Tile
tile3
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
1
,
-
1
));
Tile
tile4
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(-
1
,
0
));
Tile
tile5
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
0
,
0
));
Tile
tile6
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
1
,
0
));
Tile
tile7
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(-
1
,
1
));
Tile
tile8
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
0
,
1
));
Tile
tile9
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
1
,
1
));
int
size
=
5
;
class
DisplayPlateauWidget
extends
StatefulWidget
{
@override
_DisplayPlateauWidgetState
createState
()
=>
_DisplayPlateauWidgetState
();
}
class
_DisplayPlateauWidgetState
extends
State
<
DisplayPlateauWidget
>
{
double
_currentSliderValue
=
4
;
TextStyle
textStyle
=
TextStyle
(
fontSize:
16
,
fontWeight:
FontWeight
.
bold
,);
class
DisplayPlateauWidget
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
...
...
@@ -49,6 +40,20 @@ class DisplayPlateauWidget extends StatelessWidget {
child:
Container
(
margin:
EdgeInsets
.
all
(
20.0
),
child:
createGridView
())),
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Container
(
width:
90
,
child:
Text
(
'Taille:'
,
style:
textStyle
,
textAlign:
TextAlign
.
center
,),
padding:
EdgeInsets
.
fromLTRB
(
8
,
0
,
0
,
0
),),
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
90
,
child:
Slider
(
value:
_currentSliderValue
,
min:
1
,
max:
10
,
divisions:
9
,
label:
_currentSliderValue
.
round
().
toString
(),
onChanged:
(
double
value
)
{
setState
(()
{
_currentSliderValue
=
value
;});
}
),
),
]
),
])),
);
}
...
...
@@ -58,8 +63,8 @@ class DisplayPlateauWidget extends StatelessWidget {
padding:
const
EdgeInsets
.
all
(
10
),
mainAxisSpacing:
5
,
crossAxisSpacing:
5
,
crossAxisCount:
3
,
children:
getAllCroppedImage
(
createListTile
()),
crossAxisCount:
_currentSliderValue
.
toInt
()
,
children:
getAllCroppedImage
(
createListTile
(
_currentSliderValue
)),
);
}
...
...
@@ -71,17 +76,16 @@ class DisplayPlateauWidget extends StatelessWidget {
return
res
;
}
List
<
Tile
>
createListTile
(){
List
<
Tile
>
createListTile
(
double
size
){
List
<
Tile
>
res
=<
Tile
>[];
res
.
add
(
tile
);
res
.
add
(
tile2
);
res
.
add
(
tile3
);
res
.
add
(
tile4
);
res
.
add
(
tile5
);
res
.
add
(
tile6
);
res
.
add
(
tile7
);
res
.
add
(
tile8
);
res
.
add
(
tile9
);
for
(
double
i
=-
1.0
;
i
<=
1.0
;){
for
(
double
j
=-
1.0
;
j
<=
1.0
;){
res
.
add
(
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
j
,
i
),
size:
size
));
j
+=(
1
/((
size
-
1
)/
2
));
}
i
+=(
1
/((
size
-
1
)/
2
));
}
return
res
;
}
}
...
...
lib/Tile.dart
View file @
21a291b9
...
...
@@ -3,8 +3,9 @@ import 'package:flutter/material.dart';
class
Tile
{
String
imageURL
;
Alignment
alignment
;
double
size
;
Tile
({
this
.
imageURL
,
this
.
alignment
});
Tile
({
this
.
imageURL
,
this
.
alignment
,
this
.
size
});
Widget
croppedImageTile
()
{
return
FittedBox
(
...
...
@@ -13,8 +14,8 @@ class Tile {
child:
Container
(
child:
Align
(
alignment:
this
.
alignment
,
widthFactor:
0.3333
,
heightFactor:
0.3333
,
widthFactor:
1
/
size
,
heightFactor:
1
/
size
,
child:
Image
.
network
(
this
.
imageURL
),
),
),
...
...
@@ -24,7 +25,7 @@ class Tile {
}
Tile
tile
=
new
Tile
(
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
0
,
0
));
imageURL:
'https://picsum.photos/512/1024'
,
alignment:
Alignment
(
0
,
0
)
,
size:
3
);
class
DisplayTileWidget
extends
StatelessWidget
{
@override
...
...
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