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
f97716bd
Commit
f97716bd
authored
Feb 10, 2024
by
Timothé KOBAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
couleur UI voir couloor palette sur whatsapp
parent
a14a2061
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
11 deletions
+64
-11
main.dart
tp1/lib/main.dart
+64
-11
No files found.
tp1/lib/main.dart
View file @
f97716bd
...
@@ -11,6 +11,18 @@ class TindBook extends StatelessWidget {
...
@@ -11,6 +11,18 @@ class TindBook extends StatelessWidget {
return
ChangeNotifierProvider
(
return
ChangeNotifierProvider
(
create:
(
context
)
=>
TindBookState
(),
create:
(
context
)
=>
TindBookState
(),
child:
MaterialApp
(
child:
MaterialApp
(
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
primaryColor:
Color
.
fromRGBO
(
204
,
213
,
174
,
1
),
backgroundColor:
Color
.
fromRGBO
(
233
,
237
,
201
,
1
),
scaffoldBackgroundColor:
Color
.
fromRGBO
(
254
,
250
,
224
,
1
),
appBarTheme:
AppBarTheme
(
backgroundColor:
Color
.
fromRGBO
(
204
,
213
,
174
,
1
),
// Set app bar color
),
navigationRailTheme:
NavigationRailThemeData
(
backgroundColor:
Color
.
fromRGBO
(
212
,
163
,
115
,
1
),
// Set navigation rail color
),
),
title:
'Tind Book'
,
title:
'Tind Book'
,
home:
Scaffold
(
home:
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Draggable Sample'
)),
appBar:
AppBar
(
title:
const
Text
(
'Draggable Sample'
)),
...
@@ -109,9 +121,13 @@ class _MyHomePageState extends State<MyHomePage> {
...
@@ -109,9 +121,13 @@ class _MyHomePageState extends State<MyHomePage> {
},
},
),
),
),
),
VerticalDivider
(
thickness:
1
,
width:
1
,
),
// Add a vertical divider
Expanded
(
Expanded
(
child:
Container
(
child:
Container
(
color:
Theme
.
of
(
context
).
colorScheme
.
primaryContainer
,
color:
Color
.
fromRGBO
(
250
,
237
,
205
,
1
)
,
child:
page
,
child:
page
,
),
),
),
),
...
@@ -166,10 +182,10 @@ class _TindBookContentState extends State<TindBookContent> {
...
@@ -166,10 +182,10 @@ class _TindBookContentState extends State<TindBookContent> {
if
(
_isSwiping
)
{
if
(
_isSwiping
)
{
_isSwiping
=
false
;
_isSwiping
=
false
;
if
(
_deltaX
>
50
)
{
if
(
_deltaX
>
50
)
{
//
Droite
//
Swipe right
state
.
handleSwipe
(
1
);
state
.
handleSwipe
(
1
);
}
else
if
(
_deltaX
<
-
50
)
{
}
else
if
(
_deltaX
<
-
50
)
{
//
Gauche
//
Swipe left
state
.
handleSwipe
(-
1
);
state
.
handleSwipe
(-
1
);
}
}
}
}
...
@@ -181,9 +197,9 @@ class _TindBookContentState extends State<TindBookContent> {
...
@@ -181,9 +197,9 @@ class _TindBookContentState extends State<TindBookContent> {
children:
[
children:
[
Positioned
.
fill
(
Positioned
.
fill
(
child:
Container
(
child:
Container
(
color:
Color
s
.
deepOrange
,
color:
Color
.
fromRGBO
(
250
,
237
,
205
,
1
)
,
height:
containerHeight
,
height:
containerHeight
/
3
,
width:
containerWidth
,
width:
containerWidth
/
3
,
),
),
),
),
Positioned
(
Positioned
(
...
@@ -194,15 +210,52 @@ class _TindBookContentState extends State<TindBookContent> {
...
@@ -194,15 +210,52 @@ class _TindBookContentState extends State<TindBookContent> {
child:
Transform
.
translate
(
child:
Transform
.
translate
(
offset:
Offset
(
_deltaX
,
0.0
),
offset:
Offset
(
_deltaX
,
0.0
),
child:
Transform
.
rotate
(
child:
Transform
.
rotate
(
angle:
_deltaX
*
0.0002
,
angle:
_deltaX
*
0.0002
,
// Adjust the rotation speed here
child:
Image
.
asset
(
child:
ClipRRect
(
state
.
imagePaths
[
state
.
currentImageIndex
],
borderRadius:
BorderRadius
.
circular
(
100
),
// Adjust the radius as needed
height:
containerHeight
,
child:
Image
.
asset
(
width:
containerWidth
,
state
.
imagePaths
[
state
.
currentImageIndex
],
height:
containerHeight
/
3
,
// Adjust image height
width:
containerWidth
/
3
,
// Adjust image width
fit:
BoxFit
.
contain
,
),
),
),
),
),
),
),
),
),
Positioned
(
top:
20
,
left:
20
,
right:
20
,
child:
Container
(
padding:
EdgeInsets
.
all
(
10
),
decoration:
BoxDecoration
(
color:
Colors
.
black
.
withOpacity
(
0.5
),
borderRadius:
BorderRadius
.
circular
(
10
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'Titre du livre '
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20
,
fontWeight:
FontWeight
.
bold
,
),
),
SizedBox
(
height:
5
),
Text
(
'un tres bon livre qui parle de beaucoup chose , notamment mais aussi de lorem ipsum dolor sit amet a m Doctrine est pas de '
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
16
,
),
),
],
),
),
),
],
],
),
),
);
);
...
...
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