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
8c7e59ae
Commit
8c7e59ae
authored
Feb 27, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
26 fevrier 16h35
parent
e7154c6a
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
617 additions
and
71 deletions
+617
-71
AndroidManifest.xml
tp2/android/app/src/main/AndroidManifest.xml
+1
-0
exo10.dart
tp2/lib/exo10.dart
+142
-67
exo7.dart
tp2/lib/exo7.dart
+133
-0
exo7_taquin.dart
tp2/lib/exo7_taquin.dart
+319
-0
main.dart
tp2/lib/main.dart
+9
-4
generated_plugin_registrant.cc
tp2/linux/flutter/generated_plugin_registrant.cc
+4
-0
generated_plugins.cmake
tp2/linux/flutter/generated_plugins.cmake
+1
-0
GeneratedPluginRegistrant.swift
tp2/macos/Flutter/GeneratedPluginRegistrant.swift
+2
-0
pubspec.yaml
tp2/pubspec.yaml
+2
-0
generated_plugin_registrant.cc
tp2/windows/flutter/generated_plugin_registrant.cc
+3
-0
generated_plugins.cmake
tp2/windows/flutter/generated_plugins.cmake
+1
-0
No files found.
tp2/android/app/src/main/AndroidManifest.xml
View file @
8c7e59ae
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
android:theme=
"@style/LaunchTheme"
android:theme=
"@style/LaunchTheme"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:configChanges=
"orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated=
"true"
android:hardwareAccelerated=
"true"
android:requestLegacyExternalStorage=
"true"
android:windowSoftInputMode=
"adjustResize"
>
android:windowSoftInputMode=
"adjustResize"
>
<!-- Specifies an Android theme to apply to this Activity as soon as
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
the Android process has started. This theme is visible to the user
...
...
tp2/lib/exo10.dart
View file @
8c7e59ae
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:
camera/camera
.dart'
;
import
'package:
image_picker/image_picker
.dart'
;
List
<
CameraDescription
>
cameras
=
[];
void
main
(
)
{
Future
<
void
>
main
()
async
{
WidgetsFlutterBinding
.
ensureInitialized
();
cameras
=
await
availableCameras
();
runApp
(
Exo10
());
runApp
(
Exo10
());
}
}
class
Exo10
extends
StatefulWidget
{
class
Exo10
extends
StatelessWidget
{
const
Exo10
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
home:
MyHomePage
(),
);
}
}
class
MyHomePage
extends
StatefulWidget
{
@override
@override
_
Exo10State
createState
()
=>
_Exo10
State
();
_
MyHomePageState
createState
()
=>
_MyHomePage
State
();
}
}
class
_Exo10State
extends
State
<
Exo10
>
{
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
late
CameraController
_controller
;
File
?
_image
;
late
Future
<
void
>
_initializeControllerFuture
;
final
picker
=
ImagePicker
();
List
<
Widget
>
tiles
=
<
Widget
>[];
int
colNb
=
3
;
int
emptyTileIndex
=
0
;
@override
@override
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
_initializeControllerFuture
=
_initializeCamera
(
);
tiles
=
buildImage
(
Image
.
asset
(
'assets/placeholder_image.jpg'
)
);
}
}
Future
<
void
>
_initializeCamera
()
async
{
List
<
Widget
>
buildImage
(
Image
image
)
{
final
CameraDescription
camera
=
cameras
.
first
;
int
imageCount
=
0
;
_controller
=
CameraController
(
camera
,
ResolutionPreset
.
medium
);
List
<
Widget
>
res
=
<
Widget
>[];
return
_controller
.
initialize
();
emptyTileIndex
=
colNb
*
colNb
-
1
;
for
(
int
i
=
0
;
i
<
colNb
;
i
++)
{
for
(
int
j
=
0
;
j
<
colNb
;
j
++)
{
int
indexcopy
=
imageCount
;
Tile
tile
=
Tile
(
image:
image
,
alignment:
Alignment
(
-
1
+
2
*
j
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
),
-
1
+
2
*
i
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
),
),
);
Key
k
=
UniqueKey
();
res
.
add
(
Flexible
(
key:
k
,
child:
Container
(
margin:
EdgeInsets
.
all
(
2
),
child:
InkWell
(
child:
tile
.
croppedImageTile
(
1
/
colNb
),
onTap:
()
{
setState
(()
{
swapTiles
(
k
);
});
},
),
),
),
);
imageCount
++;
}
}
}
@override
res
.
shuffle
();
void
dispose
()
{
res
[
emptyTileIndex
]
=
Flexible
(
child:
Container
(
margin:
EdgeInsets
.
all
(
2
)));
_controller
.
dispose
();
super
.
dispose
();
return
res
;
}
void
swapTiles
(
Key
k
)
{
Widget
t
=
tiles
.
singleWhere
((
element
)
=>
element
.
key
==
k
);
int
i
=
tiles
.
indexOf
(
t
);
// If tile is neighbor of empty tile => move
if
(
i
+
1
==
emptyTileIndex
&&
i
%
colNb
!=
colNb
-
1
||
i
-
1
==
emptyTileIndex
&&
i
%
colNb
!=
0
||
i
-
colNb
==
emptyTileIndex
||
i
+
colNb
==
emptyTileIndex
)
{
tiles
[
emptyTileIndex
]
=
t
;
tiles
[
i
]
=
Flexible
(
child:
Container
(
margin:
EdgeInsets
.
all
(
2
)));
emptyTileIndex
=
i
;
}
}
Future
getImage
()
async
{
final
pickedFile
=
await
picker
.
pickImage
(
source
:
ImageSource
.
gallery
);
setState
(()
{
if
(
pickedFile
!=
null
)
{
_image
=
File
(
pickedFile
.
path
);
tiles
=
buildImage
(
Image
.
file
(
_image
!));
}
});
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
return
Scaffold
(
home:
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
'Take a Picture and Display
'
),
title:
Text
(
'Image Picker Example
'
),
),
),
body:
FutureBuilder
<
void
>(
body:
Column
(
future:
_initializeControllerFuture
,
children:
[
builder:
(
context
,
snapshot
)
{
TextButton
(
if
(
snapshot
.
connectionState
==
ConnectionState
.
done
)
{
child:
Text
(
'Select Image'
),
if
(
_controller
!=
null
&&
_controller
.
value
.
isInitialized
)
{
onPressed:
getImage
,
return
CameraPreview
(
_controller
);
),
}
else
{
Slider
(
return
Center
(
child:
Text
(
'Camera initialization failed'
));
value:
colNb
.
toDouble
(),
}
min:
2
,
}
else
{
max:
6
,
return
Center
(
child:
CircularProgressIndicator
());
divisions:
5
,
}
label:
colNb
.
toString
(),
onChanged:
(
double
value
)
{
setState
(()
{
colNb
=
value
.
toInt
();
tiles
=
buildImage
(
_image
==
null
?
Image
.
asset
(
'assets/placeholder_image.jpg'
)
:
Image
.
file
(
_image
!));
});
},
},
),
),
floatingActionButton:
FloatingActionButton
(
Expanded
(
onPressed:
()
async
{
child:
Padding
(
try
{
padding:
const
EdgeInsets
.
all
(
8.0
),
await
_initializeControllerFuture
;
child:
GridView
.
builder
(
final
XFile
picture
=
await
_controller
.
takePicture
();
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
colNb
,
// Display the picture using a new page
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
DisplayPictureScreen
(
imagePath:
picture
.
path
),
),
),
);
itemCount:
colNb
*
colNb
,
}
catch
(
e
)
{
itemBuilder:
(
BuildContext
context
,
int
index
)
{
print
(
"Error taking picture:
$e
"
);
return
tiles
.
elementAt
(
index
);
}
},
},
child:
Icon
(
Icons
.
camera
),
),
),
),
),
),
],
),
);
);
}
}
}
}
class
DisplayPictureScreen
extends
StatelessWidget
{
class
Tile
{
final
String
imagePath
;
Image
image
;
Alignment
alignment
;
const
DisplayPictureScreen
({
Key
?
key
,
required
this
.
imagePath
})
:
super
(
key:
key
);
Tile
({
required
this
.
image
,
required
this
.
alignment
}
);
@override
Widget
croppedImageTile
(
double
widthFactor
)
{
Widget
build
(
BuildContext
context
)
{
return
FittedBox
(
return
Scaffold
(
fit:
BoxFit
.
fill
,
appBar:
AppBar
(
title:
Text
(
'Display the Picture'
)),
child:
ClipRect
(
body:
Center
(
child:
Container
(
child:
Image
.
file
(
File
(
imagePath
)),
child:
Align
(
alignment:
alignment
,
widthFactor:
widthFactor
,
heightFactor:
widthFactor
,
child:
image
,
),
),
),
),
);
);
}
}
...
...
tp2/lib/exo7.dart
0 → 100644
View file @
8c7e59ae
import
'package:flutter/material.dart'
;
import
'exo7_taquin.dart'
;
class
Exo7
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Jeu du Taquin !'
),
centerTitle:
true
,
),
body:
Column
(
children:
[
const
Text
.
rich
(
TextSpan
(
text:
'Sélectionner la difficulté'
,
// default text style
style:
TextStyle
()
)
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
SizeChoose
(
difficulty:
1
)),
);
},
child:
const
Text
(
'Easy'
),
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
SizeChoose
(
difficulty:
2
)),
);
},
child:
const
Text
(
'Medium'
),
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
SizeChoose
(
difficulty:
3
)),
);
},
child:
const
Text
(
'Hard'
),
),
])
);
}
}
class
SizeChoose
extends
StatelessWidget
{
final
int
difficulty
;
const
SizeChoose
({
required
this
.
difficulty
,
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Jeu du Taquin !'
),
centerTitle:
true
,
),
body:
Column
(
children:
[
const
Text
.
rich
(
TextSpan
(
text:
'Sélectionner la taille'
,
// default text style
style:
TextStyle
()
)
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Taquin
(
difficulty:
difficulty
,
colNb:
2
)),
);
},
child:
const
Text
(
'2 par 2'
),
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Taquin
(
difficulty:
difficulty
,
colNb:
3
)),
);
},
child:
const
Text
(
'3 par 3'
),
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Taquin
(
difficulty:
difficulty
,
colNb:
4
)),
);
},
child:
const
Text
(
'4 par 4'
),
),
TextButton
(
style:
TextButton
.
styleFrom
(
textStyle:
const
TextStyle
(
fontSize:
20
),
),
onPressed:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Taquin
(
difficulty:
difficulty
,
colNb:
5
)),
);
},
child:
const
Text
(
'5 par 5'
),
)
])
);
}
}
\ No newline at end of file
tp2/lib/exo7_taquin.dart
0 → 100644
View file @
8c7e59ae
import
'dart:async'
;
import
'dart:math'
as
math
;
import
'dart:io'
;
import
'package:flutter/material.dart'
;
import
'package:image_picker/image_picker.dart'
;
class
Taquin
extends
StatefulWidget
{
final
int
difficulty
;
final
int
colNb
;
const
Taquin
({
required
this
.
difficulty
,
required
this
.
colNb
,
super
.
key
});
@override
State
<
Taquin
>
createState
()
=>
_Taquin
();
}
class
_Taquin
extends
State
<
Taquin
>
{
File
?
_image
;
final
picker
=
ImagePicker
();
List
<
Widget
>
tiles
=
<
Widget
>[];
List
<
Key
>
initialOrder
=
<
Key
>[];
double
?
size
=
300
;
int
emptyTileIndex
=
0
;
int
score
=
0
;
late
String
imageUrl
;
late
Image
image
;
late
int
colNb
;
late
int
difficulty
;
Duration
stopwatch
=
const
Duration
();
Timer
?
stopwatchTimer
;
@override
void
initState
(){
super
.
initState
();
image
=
Image
.
network
(
'https://picsum.photos/512'
);
colNb
=
widget
.
colNb
;
difficulty
=
widget
.
difficulty
;
tiles
=
buildImage
();
moveTiles
();
}
List
<
Widget
>
buildImage
(){
var
res
=
<
Widget
>[];
initialOrder
=
<
Key
>[];
emptyTileIndex
=
0
;
for
(
int
i
=
0
;
i
<
colNb
;
i
++){
for
(
int
j
=
0
;
j
<
colNb
;
j
++){
Tile
tile
=
Tile
(
image:
image
,
alignment:
Alignment
(-
1
+
2
*
j
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
),
-
1
+
2
*
i
.
toDouble
()
/
(
colNb
.
toDouble
()
-
1
))
);
Key
k
=
UniqueKey
();
initialOrder
.
add
(
k
);
res
.
add
(
Flexible
(
key:
k
,
child:
Container
(
margin:
const
EdgeInsets
.
all
(
2
),
child:
Material
(
child:
InkWell
(
child:
tile
.
croppedImageTile
(
1
/
colNb
),
onTap:
()
{
setState
(()
{
swapTiles
(
k
);
win
();
if
(
isValidTile
(
tiles
.
indexOf
(
tiles
.
singleWhere
((
element
)
=>
element
.
key
==
k
)))){
score
++;
}
});
}
),
)
))
);
}
}
res
[
emptyTileIndex
]
=
Flexible
(
child:
Container
(
margin:
const
EdgeInsets
.
all
(
2
)));
return
res
;
}
void
moveTiles
(){
for
(
int
i
=
0
;
i
<
math
.
pow
(
colNb
,
difficulty
+
1
);
i
++)
{
var
validTiles
=
getValidTiles
();
swapTiles
(
validTiles
[
math
.
Random
().
nextInt
(
validTiles
.
length
)].
key
!
);
}
}
void
_showWinDialog
(
BuildContext
context
){
showDialog
(
context:
context
,
builder:
(
BuildContext
context
){
return
AlertDialog
(
title:
const
Text
(
'Congratulations !'
),
content:
const
Text
(
'You won !'
),
actions:
<
Widget
>
[
TextButton
(
onPressed:
()
{
Navigator
.
pop
(
context
);
},
child:
const
Text
(
'Close'
),
),
],
);
}
);
}
bool
win
(){
for
(
int
i
=
1
;
i
<
tiles
.
length
;
i
++){
if
(
tiles
[
i
].
key
!=
initialOrder
[
i
]){
return
false
;
}
}
//print("It's a win");
_showWinDialog
(
context
);
return
true
;
}
bool
isValidTile
(
int
index
)
{
return
(
index
+
1
==
emptyTileIndex
&&
index
%
colNb
!=
colNb
-
1
||
index
-
1
==
emptyTileIndex
&&
index
%
colNb
!=
0
||
index
-
colNb
==
emptyTileIndex
||
index
+
colNb
==
emptyTileIndex
);
}
List
<
Widget
>
getValidTiles
()
{
return
tiles
.
where
(
(
element
)
=>
isValidTile
(
tiles
.
indexOf
(
element
))
).
toList
();
}
void
swapTiles
(
Key
k
){
Widget
t
=
tiles
.
singleWhere
((
element
)
=>
element
.
key
==
k
);
int
i
=
tiles
.
indexOf
(
t
);
// If tile is neighbor of empty tile => move
if
(
isValidTile
(
i
)){
tiles
[
emptyTileIndex
]
=
t
;
tiles
[
i
]
=
Flexible
(
child:
Container
(
margin:
const
EdgeInsets
.
all
(
2
)));
emptyTileIndex
=
i
;
}
}
Future
getImageFromCamera
()
async
{
final
pickedFile
=
await
picker
.
pickImage
(
source
:
ImageSource
.
camera
);
if
(
pickedFile
!=
null
)
{
_image
=
File
(
pickedFile
.
path
);
image
=
Image
.
file
(
_image
!);
tiles
=
buildImage
();
moveTiles
();
}
}
Future
getImage
()
async
{
final
pickedFile
=
await
picker
.
pickImage
(
source
:
ImageSource
.
gallery
);
if
(
pickedFile
!=
null
)
{
_image
=
File
(
pickedFile
.
path
);
image
=
Image
.
file
(
_image
!);
tiles
=
buildImage
();
moveTiles
();
}
}
@override
Widget
build
(
BuildContext
context
)
{
Widget
timeWidget
;
timeWidget
=
stopwatchTimer
!=
null
?
Center
(
child:
Text
.
rich
(
TextSpan
(
text:
stopwatch
.
toString
(),
// default text style
style:
const
TextStyle
()
)
)
)
:
const
SizedBox
.
shrink
();
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Jeu du Taquin !'
),
centerTitle:
true
,
),
body:
Column
(
children:
[
Text
(
'Score:
$score
'
,
style:
const
TextStyle
(
fontSize:
20
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
ElevatedButton
(
onPressed:
()
{
setState
(()
{
colNb
=
widget
.
colNb
;
difficulty
=
widget
.
difficulty
;
image
=
Image
.
network
(
'https://picsum.photos/512'
);
tiles
=
buildImage
();
moveTiles
();
});
// Add functionality for button 1
},
child:
const
Text
(
'Restart'
),
),
ElevatedButton
(
onPressed:
()
{
// Add functionality for button 1
setState
(()
{
stopwatchTimer
=
Timer
.
periodic
(
const
Duration
(
milliseconds:
100
),
(
timer
)
{
setState
(()
{
stopwatch
=
stopwatch
+
const
Duration
(
milliseconds:
100
);
});
});
});
},
child:
const
Text
(
'Stopwatch'
),
),
],
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
ElevatedButton
(
onPressed:
()
{
getImage
().
then
((
_
)
{
setState
(()
{});
});
score
=
0
;
},
child:
const
Text
(
'Image From Galeria'
),
),
ElevatedButton
(
onPressed:
()
{
getImageFromCamera
().
then
((
_
)
{
setState
(()
{});
});
score
=
0
;
},
child:
const
Text
(
'Image from camera'
),
),
],
),
Container
(
margin:
const
EdgeInsets
.
all
(
10.0
),
child:
SizedBox
(
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.7
,
width:
MediaQuery
.
of
(
context
).
size
.
height
*
0.7
,
child:
GridView
.
builder
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
colNb
,
),
itemCount:
colNb
*
colNb
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
tiles
.
elementAt
(
index
);
}
)
)
),
timeWidget
]),
);
}
}
class
Tile
{
Image
image
;
Alignment
alignment
;
Tile
({
required
this
.
image
,
required
this
.
alignment
});
Widget
croppedImageTile
(
double
widthFactor
)
{
return
FittedBox
(
fit:
BoxFit
.
fill
,
child:
ClipRect
(
child:
Container
(
child:
Align
(
alignment:
alignment
,
widthFactor:
widthFactor
,
heightFactor:
widthFactor
,
child:
image
,
),
),
),
);
}
}
\ No newline at end of file
tp2/lib/main.dart
View file @
8c7e59ae
...
@@ -4,6 +4,7 @@ import 'package:tp2/exo2.dart';
...
@@ -4,6 +4,7 @@ import 'package:tp2/exo2.dart';
import
'package:tp2/exo4.dart'
;
import
'package:tp2/exo4.dart'
;
import
'package:tp2/exo5.dart'
;
import
'package:tp2/exo5.dart'
;
import
'package:tp2/exo6.dart'
;
import
'package:tp2/exo6.dart'
;
import
'package:tp2/exo7.dart'
;
import
'package:tp2/exo10.dart'
;
import
'package:tp2/exo10.dart'
;
...
@@ -28,7 +29,7 @@ void main() {
...
@@ -28,7 +29,7 @@ void main() {
'A description of what needs to be done for Todo '
,
'A description of what needs to be done for Todo '
,
Exo1
()
Exo1
()
),
),
Exos
(
const
Exos
(
'Exercice 2'
,
'Exercice 2'
,
'A description of what needs to be done for Todo '
,
'A description of what needs to be done for Todo '
,
Exo2
()
Exo2
()
...
@@ -38,19 +39,23 @@ void main() {
...
@@ -38,19 +39,23 @@ void main() {
'desc'
,
'desc'
,
Exo4
()
Exo4
()
),
),
Exos
(
const
Exos
(
'Exercice 5'
,
'Exercice 5'
,
'aaaaa'
,
'aaaaa'
,
Exo5
()
Exo5
()
),
),
Exos
(
const
Exos
(
'Exercice 6'
,
'Exercice 6'
,
'desc'
,
'desc'
,
Exo6
()
Exo6
()
),
Exos
(
),
Exos
(
'Exercice
6
'
,
'Exercice
10
'
,
'desc'
,
'desc'
,
Exo10
()
Exo10
()
),
Exos
(
'Exercice 7'
,
'desc'
,
Exo7
()
)
)
// Next exo
// Next exo
],
],
...
...
tp2/linux/flutter/generated_plugin_registrant.cc
View file @
8c7e59ae
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
#include "generated_plugin_registrant.h"
#include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h>
void
fl_register_plugins
(
FlPluginRegistry
*
registry
)
{
void
fl_register_plugins
(
FlPluginRegistry
*
registry
)
{
g_autoptr
(
FlPluginRegistrar
)
file_selector_linux_registrar
=
fl_plugin_registry_get_registrar_for_plugin
(
registry
,
"FileSelectorPlugin"
);
file_selector_plugin_register_with_registrar
(
file_selector_linux_registrar
);
}
}
tp2/linux/flutter/generated_plugins.cmake
View file @
8c7e59ae
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#
#
list
(
APPEND FLUTTER_PLUGIN_LIST
list
(
APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
)
)
list
(
APPEND FLUTTER_FFI_PLUGIN_LIST
list
(
APPEND FLUTTER_FFI_PLUGIN_LIST
...
...
tp2/macos/Flutter/GeneratedPluginRegistrant.swift
View file @
8c7e59ae
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
import
FlutterMacOS
import
FlutterMacOS
import
Foundation
import
Foundation
import
file_selector_macos
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
func
RegisterGeneratedPlugins
(
registry
:
FlutterPluginRegistry
)
{
FileSelectorPlugin
.
register
(
with
:
registry
.
registrar
(
forPlugin
:
"FileSelectorPlugin"
))
}
}
tp2/pubspec.yaml
View file @
8c7e59ae
...
@@ -35,6 +35,8 @@ dependencies:
...
@@ -35,6 +35,8 @@ dependencies:
camera
:
^0.9.4+5
# or the latest version available
camera
:
^0.9.4+5
# or the latest version available
image_picker
:
^0.8.3
# The following adds the Cupertino Icons font to your application.
# The following adds the Cupertino Icons font to your application.
...
...
tp2/windows/flutter/generated_plugin_registrant.cc
View file @
8c7e59ae
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h"
#include "generated_plugin_registrant.h"
#include <file_selector_windows/file_selector_windows.h>
void
RegisterPlugins
(
flutter
::
PluginRegistry
*
registry
)
{
void
RegisterPlugins
(
flutter
::
PluginRegistry
*
registry
)
{
FileSelectorWindowsRegisterWithRegistrar
(
registry
->
GetRegistrarForPlugin
(
"FileSelectorWindows"
));
}
}
tp2/windows/flutter/generated_plugins.cmake
View file @
8c7e59ae
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#
#
list
(
APPEND FLUTTER_PLUGIN_LIST
list
(
APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
)
)
list
(
APPEND FLUTTER_FFI_PLUGIN_LIST
list
(
APPEND FLUTTER_FFI_PLUGIN_LIST
...
...
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