Commit 19443eda authored by Benjamin LEROUX's avatar Benjamin LEROUX

manga&games commit

parent 505ea6f3
import 'package:flutter/material.dart';
class DataBase{
static List<Widget> _mangaTitles = <Widget>[];
static List<Widget> _gameTitles = <Widget>[];
static List<GridView> _mangaItem = <GridView>[];
static List<GridView> _gameItem = <GridView>[];
DataBase(int x){
DataBase(){
const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
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,));
_mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/series/arte-1-komikku.jpg'), Align(alignment: Alignment.center,child: Text('Arte',style: optionStyle )),]));
_mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://static.fnac-static.com/multimedia/Images/FR/NR/fa/d8/17/1562874/1507-1/tsp20161130112826/Berserk.jpg'), Align(alignment: Alignment.center,child: Text('Berserk',style: optionStyle )),]));
_mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://upload.wikimedia.org/wikipedia/en/6/6c/Koe_no_Katachi%2C_Volume_1.jpg'), Align(alignment: Alignment.center,child: Text('Koe No Katachi',style: optionStyle )),]));
_mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://images-na.ssl-images-amazon.com/images/I/91N8saM4HdL.jpg'), Align(alignment: Alignment.center,child: Text('Made In Abyss',style: optionStyle )),]));
_mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/vols/monster-deluxe-1-kana.jpg'), Align(alignment: Alignment.center,child: Text('Monster',style: optionStyle )),]));
_mangaItem.add(GridView.count( crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/series/Shingekinokyojin-01-kodansha.jpg'), Align(alignment: Alignment.center,child: Text('Shingeki No Kyojin',style: optionStyle )),]));
_gameItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/series/arte-1-komikku.jpg'), Align(alignment: Alignment.center,child: Text('Dark Souls 3',style: optionStyle )),]));
_gameItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://static.fnac-static.com/multimedia/Images/FR/NR/fa/d8/17/1562874/1507-1/tsp20161130112826/Berserk.jpg'), Align(alignment: Alignment.center,child: Text('Halo: The Master Chief Collection',style: optionStyle )),]));
_gameItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://upload.wikimedia.org/wikipedia/en/6/6c/Koe_no_Katachi%2C_Volume_1.jpg'), Align(alignment: Alignment.center,child: Text('Hollow Knight',style: optionStyle )),]));
_gameItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://images-na.ssl-images-amazon.com/images/I/91N8saM4HdL.jpg'), Align(alignment: Alignment.center,child: Text('Sekiro',style: optionStyle )),]));
_gameItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/vols/monster-deluxe-1-kana.jpg'), Align(alignment: Alignment.center,child: Text('Slay The Spire',style: optionStyle )),]));
_gameItem.add(GridView.count( crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
[Image.network('https://www.manga-news.com/public/images/series/Shingekinokyojin-01-kodansha.jpg'), Align(alignment: Alignment.center,child: Text('Temtem',style: optionStyle )),]));
//trier automatiquement ?
}
List<Widget> getMangaTitles(){ return _mangaTitles;}
List<GridView> getMangaViews(){ return _mangaItem;}
List<GridView> getGameViews(){ return _gameItem;}
}
\ No newline at end of file
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_media/DataBase.dart';
......@@ -30,33 +31,52 @@ class MyStatefulWidget extends StatefulWidget {
/// This is the private State class that goes with MyStatefulWidget.
class _MyStatefulWidgetState extends State<MyStatefulWidget> {
int _selectedIndex = 0;
static DataBase mangaDB= new DataBase(0);
static DataBase dataBase= new DataBase();
static const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
static const TextStyle titleStyle =
TextStyle(fontSize: 50, fontWeight: FontWeight.bold, color: Colors.blue);
static const TextStyle titleStyle2 =
TextStyle(fontSize: 44, fontWeight: FontWeight.bold, color: Colors.blue);
static final List<Widget> _widgetOptions = <Widget>[
Text(
'Accueil',
style: optionStyle,
),
GridView.count(
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,),,
ListView.separated(
physics: ScrollPhysics(),
padding: const EdgeInsets.all(0),
itemCount: dataBase.getGameViews().length+1,
itemBuilder: (BuildContext context, int index) {
if(index==0) return Container(
height: 60,
child: Text('Mes jeux-vidéos',style: titleStyle2,textAlign: TextAlign.center),
);
else return Container(
height: 150,
child: Center(child: dataBase.getGameViews()[index-1]),
);
},
separatorBuilder: (BuildContext context, int index) => const Divider(thickness: 5 ,color: Colors.blue, indent: 10, endIndent: 10,),
),
// Text(
// 'Mes jeux vidéos',
// style: optionStyle,
// ),
Text(
'Mes mangas',
style: optionStyle,
ListView.separated(
physics: ScrollPhysics(),
padding: const EdgeInsets.all(8),
itemCount: dataBase.getMangaViews().length+1,
itemBuilder: (BuildContext context, int index) {
if(index==0) return Container(
height: 60,
child: Text('Mes mangas',style: titleStyle,textAlign: TextAlign.center),
);
else return Container(
height: 150,
child: Center(child: dataBase.getMangaViews()[index-1]),
);
},
separatorBuilder: (BuildContext context, int index) => const Divider(thickness: 5 ,color: Colors.blue, indent: 10, endIndent: 10,),
),
Text(
'Oeuvres favorites',
style: optionStyle,
......
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