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