Commit 62667a66 authored by Timothé KOBAK's avatar Timothé KOBAK

?

parent 0c7efbee
...@@ -5178,66 +5178,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -5178,66 +5178,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
dart dart
Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
dart
Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
for details. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
dart
Copyright 2012, the Dart project authors. Copyright 2012, the Dart project authors.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -6669,7 +6609,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice ...@@ -6669,7 +6609,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible With Secondary Licenses", as This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0. defined by the Mozilla Public License, v. 2.0.
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/c64c3d6bae2f51717fa10414ba8c3a8d7718a4e2 You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/5a5d4c2622007c10ed6adcd5787eb3a69dd8ada4
/third_party/fallback_root_certificates/ /third_party/fallback_root_certificates/
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
...@@ -26,7 +26,7 @@ class Tile { ...@@ -26,7 +26,7 @@ class Tile {
Tile tile = new Tile( Tile tile = new Tile(
imageURL: 'https://picsum.photos/512', alignment: Alignment(0, 0)); imageURL: 'https://picsum.photos/512', alignment: Alignment(0, 0));
class Exo3 extends StatelessWidget { class Exo4 extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
......
import 'package:flutter/material.dart';
class Tile {
Image image;
Alignment alignment;
Tile({required this.image, required this.alignment});
Widget croppedImageTile(double widthFactor) {
print("creating single tile");
return FittedBox(
fit: BoxFit.fill,
child: ClipRect(
child: Container(
child: Align(
alignment: this.alignment,
widthFactor: widthFactor,
heightFactor: widthFactor,
child: image,
),
),
),
);
}
}
class Exo5 extends StatefulWidget {
const Exo5({super.key});
@override
State<Exo5> createState() => _Exo5();
}
class _Exo5 extends State<Exo5> {
final image = Image.network('https://picsum.photos/512');
double? size = 300;
int colNb = 3;
@override
Widget build(BuildContext context) {
print("building state");
return Scaffold(
appBar: AppBar(
title: const Text('Display a Tile as a Cropped Image'),
centerTitle: true,
),
body:
Column(
children: [
Text("col"),
Container(
margin: const EdgeInsets.all(20.0),
child: GridView.count(
primary: false,
padding: const EdgeInsets.all(1),
crossAxisSpacing: 1,
mainAxisSpacing: 1,
crossAxisCount: colNb, // Nombre de colonnes
children: [Text("aaaa"), Text("bbb"), Text("ccc")] // createTilesFromImage(colNb)
)),
],
))
;
}
List<Widget> createTilesFromImage(int colNb) {
print("creating tiles");
Tile tile;
List<Widget> res = <Widget>[];
for(int i=0; i<colNb; i++){
for(int j=0; j<colNb; j++){
tile = Tile(image: image, alignment: Alignment(-1 + 2 * j.toDouble() / colNb.toDouble(), -1 + 2 * i.toDouble() / colNb.toDouble()));
res.add(InkWell(
child: tile.croppedImageTile(1 / colNb),
onTap: () {
print("tapped on tile $i $j");
},
));
}
}
print("finished creating tiles");
print(res);
return res
;
}
}
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:tp2/exo1.dart'; import 'package:tp2/exo1.dart';
import 'package:tp2/exo2.dart'; import 'package:tp2/exo2.dart';
import 'package:tp2/exo3.dart'; import 'package:tp2/exo4.dart';
import 'package:tp2/exo5.dart';
class Exos { class Exos {
...@@ -30,9 +31,13 @@ void main() { ...@@ -30,9 +31,13 @@ void main() {
Exo2() Exo2()
), ),
Exos( Exos(
'Exercice 3', 'Exercice 4',
'desc', 'desc',
Exo3() Exo4()
),Exos(
'Exercice 5',
'aaaaa',
Exo5()
) )
// Next exo // Next exo
], ],
......
...@@ -79,26 +79,26 @@ packages: ...@@ -79,26 +79,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" sha256: cdd14e3836065a1f6302a236ec8b5f700695c803c57ae11a1c84df31e6bcf831
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.0.4" version: "10.0.3"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" sha256: "9b2ef90589911d665277464e0482b209d39882dffaaf4ef69a3561a3354b2ebc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.3" version: "3.0.2"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" sha256: fd3cd66cb2bcd7b50dcd3b413af49d78051f809c8b3f6e047962765c15a0d23d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "3.0.0"
lints: lints:
dependency: transitive dependency: transitive
description: description:
...@@ -127,10 +127,10 @@ packages: ...@@ -127,10 +127,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.12.0" version: "1.11.0"
path: path:
dependency: transitive dependency: transitive
description: description:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment