Commit 505ea6f3 authored by Benjamin LEROUX's avatar Benjamin LEROUX

bottomBar commit

parent 397fac32
Pipeline #1055 failed with stages
import 'package:flutter/material.dart';
class DataBase{
static List<Widget> _mangaTitles = <Widget>[];
static List<Widget> _gameTitles = <Widget>[];
DataBase(int x){
const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
//trier automatiquement plus tard
_mangaTitles.add(Image.network('https://www.manga-news.com/public/images/series/arte-1-komikku.jpg'));
_mangaTitles.add(Text('Arte',style: optionStyle,));
_mangaTitles.add(Image.network('https://static.fnac-static.com/multimedia/Images/FR/NR/fa/d8/17/1562874/1507-1/tsp20161130112826/Berserk.jpg'));
_mangaTitles.add(Text('Berserk',style: optionStyle,));
_mangaTitles.add(Image.network('https://upload.wikimedia.org/wikipedia/en/6/6c/Koe_no_Katachi%2C_Volume_1.jpg'));
_mangaTitles.add(Text('Koe No Katachi',style: optionStyle,));
_mangaTitles.add(Text('Made In Abyss',style: optionStyle,));
_mangaTitles.add(Text('Monster',style: optionStyle,));
_mangaTitles.add(Text('Shingeki No Kyojin',style: optionStyle,));
}
List<Widget> getMangaTitles(){ return _mangaTitles;}
}
\ No newline at end of file
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_media/DataBase.dart';
void main() => runApp(MyApp()); void main() => runApp(MyApp());
...@@ -23,20 +24,35 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -23,20 +24,35 @@ class MyStatefulWidget extends StatefulWidget {
_MyStatefulWidgetState createState() => _MyStatefulWidgetState(); _MyStatefulWidgetState createState() => _MyStatefulWidgetState();
} }
/// This is the private State class that goes with MyStatefulWidget. /// This is the private State class that goes with MyStatefulWidget.
class _MyStatefulWidgetState extends State<MyStatefulWidget> { class _MyStatefulWidgetState extends State<MyStatefulWidget> {
int _selectedIndex = 0; int _selectedIndex = 0;
static DataBase mangaDB= new DataBase(0);
static const TextStyle optionStyle = static const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold); TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
static const List<Widget> _widgetOptions = <Widget>[
static final List<Widget> _widgetOptions = <Widget>[
Text( Text(
'Accueil', 'Accueil',
style: optionStyle, style: optionStyle,
), ),
Text( GridView.count(
'Mes jeux vidéos',
style: optionStyle, crossAxisSpacing: 10,
mainAxisSpacing: 10,
crossAxisCount: 2,
children: mangaDB.getMangaTitles(),
//Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),Text('IMAGE',style: optionStyle,),Text('TITRE',style: optionStyle,),,
), ),
// Text(
// 'Mes jeux vidéos',
// style: optionStyle,
// ),
Text( Text(
'Mes mangas', 'Mes mangas',
style: optionStyle, style: optionStyle,
...@@ -91,7 +107,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> { ...@@ -91,7 +107,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
), ),
], ],
currentIndex: _selectedIndex, currentIndex: _selectedIndex,
selectedItemColor: Colors.amber[800], selectedItemColor: Colors.blue[400],
onTap: _onItemTapped, onTap: _onItemTapped,
), ),
); );
......
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