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

manga&games commit

parent 505ea6f3
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DataBase{ class DataBase{
static List<Widget> _mangaTitles = <Widget>[]; static List<GridView> _mangaItem = <GridView>[];
static List<Widget> _gameTitles = <Widget>[]; static List<GridView> _gameItem = <GridView>[];
DataBase(int x){ DataBase(){
const TextStyle optionStyle = const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold); TextStyle(fontSize: 30, fontWeight: FontWeight.bold,);
//trier automatiquement plus tard _mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
_mangaTitles.add(Image.network('https://www.manga-news.com/public/images/series/arte-1-komikku.jpg')); [Image.network('https://www.manga-news.com/public/images/series/arte-1-komikku.jpg'), Align(alignment: Alignment.center,child: Text('Arte',style: optionStyle )),]));
_mangaTitles.add(Text('Arte',style: optionStyle,)); _mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
_mangaTitles.add(Image.network('https://static.fnac-static.com/multimedia/Images/FR/NR/fa/d8/17/1562874/1507-1/tsp20161130112826/Berserk.jpg')); [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 )),]));
_mangaTitles.add(Text('Berserk',style: optionStyle,)); _mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
_mangaTitles.add(Image.network('https://upload.wikimedia.org/wikipedia/en/6/6c/Koe_no_Katachi%2C_Volume_1.jpg')); [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 )),]));
_mangaTitles.add(Text('Koe No Katachi',style: optionStyle,)); _mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
_mangaTitles.add(Text('Made In Abyss',style: optionStyle,)); [Image.network('https://images-na.ssl-images-amazon.com/images/I/91N8saM4HdL.jpg'), Align(alignment: Alignment.center,child: Text('Made In Abyss',style: optionStyle )),]));
_mangaTitles.add(Text('Monster',style: optionStyle,)); _mangaItem.add(GridView.count(crossAxisCount: 2,physics: new NeverScrollableScrollPhysics(), children: <Widget>
_mangaTitles.add(Text('Shingeki No Kyojin',style: optionStyle,)); [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/material.dart';
import 'package:flutter_media/DataBase.dart'; import 'package:flutter_media/DataBase.dart';
...@@ -30,33 +31,52 @@ class MyStatefulWidget extends StatefulWidget { ...@@ -30,33 +31,52 @@ class MyStatefulWidget extends StatefulWidget {
/// 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 DataBase dataBase= new DataBase();
static const TextStyle optionStyle = static const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold); 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>[ static final List<Widget> _widgetOptions = <Widget>[
Text( Text(
'Accueil', 'Accueil',
style: optionStyle, style: optionStyle,
), ),
GridView.count( ListView.separated(
physics: ScrollPhysics(),
crossAxisSpacing: 10, padding: const EdgeInsets.all(0),
mainAxisSpacing: 10, itemCount: dataBase.getGameViews().length+1,
crossAxisCount: 2, itemBuilder: (BuildContext context, int index) {
children: mangaDB.getMangaTitles(), if(index==0) return Container(
//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,),, 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,),
), ),
ListView.separated(
// Text( physics: ScrollPhysics(),
// 'Mes jeux vidéos', padding: const EdgeInsets.all(8),
// style: optionStyle, itemCount: dataBase.getMangaViews().length+1,
// ), itemBuilder: (BuildContext context, int index) {
Text( if(index==0) return Container(
'Mes mangas', height: 60,
style: optionStyle, 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( Text(
'Oeuvres favorites', 'Oeuvres favorites',
style: optionStyle, 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