Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Amse_Mediatheque_Flutter
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
Lila NICKLER
Amse_Mediatheque_Flutter
Commits
9ef07c3f
Commit
9ef07c3f
authored
Feb 01, 2021
by
Lila NICKLER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Barre de navigation: 3 pages
parent
50ebe015
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
18 deletions
+54
-18
main.dart
lib/main.dart
+54
-18
No files found.
lib/main.dart
View file @
9ef07c3f
//import 'dart:html';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
void
main
(
)
{
void
main
(
)
{
...
@@ -32,38 +34,72 @@ class MyHomePage extends StatefulWidget {
...
@@ -32,38 +34,72 @@ class MyHomePage extends StatefulWidget {
}
}
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
class
_MyHomePageState
extends
State
<
MyHomePage
>
{
int
_counter
=
0
;
int
_selectedIndex
=
0
;
static
const
TextStyle
optionStyle
=
TextStyle
(
fontSize:
30
,
fontWeight:
FontWeight
.
bold
);
static
const
List
<
Widget
>
_widgetOptions
=
<
Widget
>[
Text
(
'Index 0: Home'
,
style:
optionStyle
,
),
Text
(
'Mes Séries et Films'
,
style:
optionStyle
,
),
Text
(
'Mes Jeux Vidéo'
,
style:
optionStyle
,
),
];
void
_
incrementCounter
(
)
{
void
_
onItemTapped
(
int
index
)
{
setState
(()
{
setState
(()
{
_
counter
++
;
_
selectedIndex
=
index
;
});
});
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
series
=[
MediaItem
(
name:
"Les Simpsons"
,
description:
"Les simpsons"
,
image:
"https://fr.wikipedia.org/wiki/Les_Simpson#/media/Fichier:Les_simpson_logo_France.png"
)];
return
Scaffold
(
return
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
title:
Text
(
widget
.
title
),
title:
Text
(
widget
.
title
),
),
),
body:
Center
(
body:
Center
(
child:
_widgetOptions
.
elementAt
(
_selectedIndex
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
'Bienvenu dans votre médiathèque'
,
),
Text
(
'
$_counter
'
,
style:
Theme
.
of
(
context
).
textTheme
.
headline4
,
),
],
),
),
),
bottomNavigationBar:
BottomNavigationBar
(
items:
const
<
BottomNavigationBarItem
>[
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
home
),
label:
'Home'
,
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
ondemand_video_rounded
),
label:
'Séries & Films'
,
),
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
videogame_asset_outlined
),
label:
'Jeux Vidéo'
,
),
],
currentIndex:
_selectedIndex
,
selectedItemColor:
Colors
.
amber
[
800
],
onTap:
_onItemTapped
,),
floatingActionButton:
FloatingActionButton
(
floatingActionButton:
FloatingActionButton
(
child:
Icon
(
Icons
.
add
),
child:
Icon
(
Icons
.
add
),
),
// This trailing comma makes auto-formatting nicer for build methods.
),
// This trailing comma makes auto-formatting nicer for build methods.
);
);
}
}
}
}
class
MediaItem
{
String
name
;
String
description
;
String
image
;
MediaItem
({
this
.
name
,
this
.
description
,
this
.
image
});
String
getName
()
{
return
this
.
name
;
}
}
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