Commit 9959f8cc authored by Lila NICKLER's avatar Lila NICKLER

Resolution des Warnings

parent 489af56a
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'Widget3000.dart';
class MediaItem {
String name;
......
......@@ -3,24 +3,24 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:mediateque_tp1/Media.dart';
class Affichage_list extends StatefulWidget{
class AffichageList extends StatefulWidget{
final List <MediaItem> list;
final List <MediaItem> list_fav;
final List <MediaItem> listFav;
Affichage_list({Key key, @required this.list, this.list_fav}):super (key:key);
AffichageList({Key key, @required this.list, this.listFav}):super (key:key);
@override
_Affichage_listState createState() => _Affichage_listState();
_AffichageListState createState() => _AffichageListState();
}
class _Affichage_listState extends State<Affichage_list> {
_Affichage_listState(): super();
class _AffichageListState extends State<AffichageList> {
_AffichageListState(): super();
ListView mediaDisplay(MediaItem item) {
const TextStyle titleStyle = TextStyle(fontSize: 30, fontWeight: FontWeight.bold);
const TextStyle bodyStyle = TextStyle(fontSize: 11);
bool alreadySaved = widget.list_fav.contains(item);
bool alreadySaved = widget.listFav.contains(item);
return ListView(
shrinkWrap: true,
......@@ -36,9 +36,9 @@ class _Affichage_listState extends State<Affichage_list> {
onTap: () {
setState(() {
if (alreadySaved) {
widget.list_fav.remove(item);
widget.listFav.remove(item);
} else {
widget.list_fav.add(item);
widget.listFav.add(item);
}
});
},
......
......@@ -41,15 +41,13 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
int _selectedIndex = 0;
static const TextStyle optionStyle =
TextStyle(fontSize: 30, fontWeight: FontWeight.bold, color: Colors.white) ;
static DataBase db = new DataBase();
static Affichage_list affichageSeries = new Affichage_list(list: db.getlistSeries(),list_fav: db.getlistSaved());
static Affichage_list affichageGames = new Affichage_list(list: db.getlistGames(),list_fav: db.getlistSaved());
static Affichage_list affichageFav = new Affichage_list(list: db.getlistSaved(),list_fav: db.getlistSaved());
static Affichage_list affichafeFilms = new Affichage_list(list: db.getlistFilms(), list_fav: db.getlistSaved());
static AffichageList affichageSeries = new AffichageList(list: db.getlistSeries(),listFav: db.getlistSaved());
static AffichageList affichageGames = new AffichageList(list: db.getlistGames(),listFav: db.getlistSaved());
static AffichageList affichageFav = new AffichageList(list: db.getlistSaved(),listFav: db.getlistSaved());
static AffichageList affichafeFilms = new AffichageList(list: db.getlistFilms(), listFav: db.getlistSaved());
static List<Widget> _widgetOptions = <Widget>[
......@@ -69,7 +67,6 @@ class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
final List<MediaItem> series= <MediaItem> [];
return Scaffold(
appBar: AppBar(
......
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