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
0c7efbee
Commit
0c7efbee
authored
Feb 14, 2024
by
m-spi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TP2 exo4
parent
d5754654
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
3 deletions
+70
-3
package_config.json
tp2/.dart_tool/package_config.json
+1
-1
5c63d7f0fba80add8cd1d787b738622d.cache.dill.track.dill
...ld/5c63d7f0fba80add8cd1d787b738622d.cache.dill.track.dill
+0
-0
exo3.dart
tp2/lib/exo3.dart
+61
-0
main.dart
tp2/lib/main.dart
+8
-2
No files found.
tp2/.dart_tool/package_config.json
View file @
0c7efbee
...
...
@@ -170,7 +170,7 @@
"languageVersion"
:
"3.4"
}
],
"generated"
:
"2024-02-14T0
8:31:20.629771
Z"
,
"generated"
:
"2024-02-14T0
9:30:03.769996
Z"
,
"generator"
:
"pub"
,
"generatorVersion"
:
"3.4.0-131.0.dev"
}
tp2/build/5c63d7f0fba80add8cd1d787b738622d.cache.dill.track.dill
View file @
0c7efbee
No preview for this file type
tp2/lib/exo3.dart
0 → 100644
View file @
0c7efbee
import
'package:flutter/material.dart'
;
class
Tile
{
String
imageURL
;
Alignment
alignment
;
Tile
({
required
this
.
imageURL
,
required
this
.
alignment
});
Widget
croppedImageTile
()
{
return
FittedBox
(
fit:
BoxFit
.
fill
,
child:
ClipRect
(
child:
Container
(
child:
Align
(
alignment:
this
.
alignment
,
widthFactor:
0.3
,
heightFactor:
0.3
,
child:
Image
.
network
(
this
.
imageURL
),
),
),
),
);
}
}
Tile
tile
=
new
Tile
(
imageURL:
'https://picsum.photos/512'
,
alignment:
Alignment
(
0
,
0
));
class
Exo3
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
Text
(
'Display a Tile as a Cropped Image'
),
centerTitle:
true
,
),
body:
Center
(
child:
Column
(
children:
[
SizedBox
(
width:
150.0
,
height:
150.0
,
child:
Container
(
margin:
EdgeInsets
.
all
(
20.0
),
child:
this
.
createTileWidgetFrom
(
tile
))),
Container
(
height:
200
,
child:
Image
.
network
(
'https://picsum.photos/512'
,
fit:
BoxFit
.
cover
))
])),
);
}
Widget
createTileWidgetFrom
(
Tile
tile
)
{
return
InkWell
(
child:
tile
.
croppedImageTile
(),
onTap:
()
{
print
(
"tapped on tile"
);
},
);
}
}
tp2/lib/main.dart
View file @
0c7efbee
import
'package:flutter/material.dart'
;
import
'package:tp2/exo1.dart'
;
import
'package:tp2/exo2.dart'
;
import
'
exo1
.dart'
;
import
'
package:tp2/exo3
.dart'
;
class
Exos
{
...
...
@@ -28,6 +29,11 @@ void main() {
'A description of what needs to be done for Todo '
,
Exo2
()
),
Exos
(
'Exercice 3'
,
'desc'
,
Exo3
()
)
// Next exo
],
),
...
...
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