From 6b267d75de2bb9651bfa2fbf98771cc2ec47155e Mon Sep 17 00:00:00 2001 From: NovaSkyrim <100930779+NovaSkyrim@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:56:53 +0200 Subject: [PATCH 1/5] coomit --- .../dashboard/assets/disney_studios.json | 177 ++- dashboard/dashboard/dashboard | 1 - dashboard/dashboard/lib/main.dart | 1186 +++++++++-------- dashboard/dashboard/lib/responsiveapp.dart | 173 +++ 4 files changed, 958 insertions(+), 579 deletions(-) delete mode 160000 dashboard/dashboard/dashboard create mode 100644 dashboard/dashboard/lib/responsiveapp.dart diff --git a/dashboard/dashboard/assets/disney_studios.json b/dashboard/dashboard/assets/disney_studios.json index 49f004f..ae5441f 100644 --- a/dashboard/dashboard/assets/disney_studios.json +++ b/dashboard/dashboard/assets/disney_studios.json @@ -1 +1,176 @@ -{"lands":[{"id":906,"name":"Marvel Avengers Campus","rides":[{"id":10848,"name":"Avengers Assemble: Flight Force","is_open":true,"wait_time":20,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":10849,"name":"Avengers Assemble: Flight Force Single Rider","is_open":true,"wait_time":10,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":10845,"name":"Spider-Man W.E.B. Adventure","is_open":true,"wait_time":45,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":10846,"name":"Spider-Man W.E.B. Adventure Single Rider","is_open":true,"wait_time":10,"last_updated":"2024-03-09T14:25:04.000Z"}]},{"id":26,"name":"Production Courtyard","rides":[{"id":266,"name":"Meet Spider Man","is_open":false,"wait_time":0,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":40,"name":"The Twilight Zone Tower of Terror","is_open":true,"wait_time":20,"last_updated":"2024-03-09T14:25:04.000Z"}]},{"id":27,"name":"Toon Studio","rides":[{"id":30,"name":"Art of Disney Animation","is_open":false,"wait_time":0,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":31,"name":"Cars Quatre Roues Rallye","is_open":true,"wait_time":5,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":29,"name":"Cars ROAD TRIP","is_open":true,"wait_time":10,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":32,"name":"Crush's Coaster","is_open":true,"wait_time":65,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":7277,"name":"Crush's Coaster Single Rider","is_open":true,"wait_time":55,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":33,"name":"Les Tapis Volants - Flying Carpets Over Agrabah®","is_open":false,"wait_time":0,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":37,"name":"Ratatouille: The Adventure","is_open":true,"wait_time":45,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":7279,"name":"Ratatouille: The Adventure Single Rider","is_open":true,"wait_time":10,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":34,"name":"RC Racer","is_open":true,"wait_time":15,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":7280,"name":"RC Racer Single Rider","is_open":true,"wait_time":5,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":36,"name":"Slinky® Dog Zigzag Spin","is_open":true,"wait_time":5,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":35,"name":"Toy Soldiers Parachute Drop","is_open":true,"wait_time":25,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":7281,"name":"Toy Soldiers Parachute Drop Single Rider","is_open":true,"wait_time":5,"last_updated":"2024-03-09T14:25:04.000Z"}]},{"id":25,"name":"Backlot (Closed)","rides":[{"id":38,"name":"Armageddon : les Effets Spéciaux","is_open":false,"wait_time":0,"last_updated":"2024-03-09T14:25:04.000Z"},{"id":39,"name":"Rock'n'Roller Coaster starring Aerosmith","is_open":false,"wait_time":0,"last_updated":"2024-03-09T14:25:04.000Z"}]}],"rides":[]} \ No newline at end of file +{ + "lands": [ + { + "id": 906, + "name": "Marvel Avengers Campus", + "rides": [ + { + "id": 10848, + "name": "Avengers Assemble: Flight Force", + "is_open": true, + "wait_time": 20, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 10849, + "name": "Avengers Assemble: Flight Force Single Rider", + "is_open": true, + "wait_time": 10, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 10845, + "name": "Spider-Man W.E.B. Adventure", + "is_open": true, + "wait_time": 45, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 10846, + "name": "Spider-Man W.E.B. Adventure Single Rider", + "is_open": true, + "wait_time": 10, + "last_updated": "2024-03-09T14:25:04.000Z" + } + ] + }, + { + "id": 26, + "name": "Production Courtyard", + "rides": [ + { + "id": 266, + "name": "Meet Spider Man", + "is_open": false, + "wait_time": 0, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 40, + "name": "The Twilight Zone Tower of Terror", + "is_open": true, + "wait_time": 20, + "last_updated": "2024-03-09T14:25:04.000Z" + } + ] + }, + { + "id": 27, + "name": "Toon Studio", + "rides": [ + { + "id": 30, + "name": "Art of Disney Animation", + "is_open": false, + "wait_time": 0, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 31, + "name": "Cars Quatre Roues Rallye", + "is_open": true, + "wait_time": 5, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 29, + "name": "Cars ROAD TRIP", + "is_open": true, + "wait_time": 10, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 32, + "name": "Crush's Coaster", + "is_open": true, + "wait_time": 65, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 7277, + "name": "Crush's Coaster Single Rider", + "is_open": true, + "wait_time": 55, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 33, + "name": "Les Tapis Volants - Flying Carpets Over Agrabah®", + "is_open": false, + "wait_time": 0, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 37, + "name": "Ratatouille: The Adventure", + "is_open": true, + "wait_time": 45, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 7279, + "name": "Ratatouille: The Adventure Single Rider", + "is_open": true, + "wait_time": 10, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 34, + "name": "RC Racer", + "is_open": true, + "wait_time": 15, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 7280, + "name": "RC Racer Single Rider", + "is_open": true, + "wait_time": 5, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 36, + "name": "Slinky® Dog Zigzag Spin", + "is_open": true, + "wait_time": 5, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 35, + "name": "Toy Soldiers Parachute Drop", + "is_open": true, + "wait_time": 25, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 7281, + "name": "Toy Soldiers Parachute Drop Single Rider", + "is_open": true, + "wait_time": 5, + "last_updated": "2024-03-09T14:25:04.000Z" + } + ] + }, + { + "id": 25, + "name": "Backlot (Closed)", + "rides": [ + { + "id": 38, + "name": "Armageddon : les Effets Spéciaux", + "is_open": false, + "wait_time": 0, + "last_updated": "2024-03-09T14:25:04.000Z" + }, + { + "id": 39, + "name": "Rock'n'Roller Coaster starring Aerosmith", + "is_open": false, + "wait_time": 0, + "last_updated": "2024-03-09T14:25:04.000Z" + } + ] + } + ], + "rides": [] +} \ No newline at end of file diff --git a/dashboard/dashboard/dashboard b/dashboard/dashboard/dashboard deleted file mode 160000 index 4f4bb68..0000000 --- a/dashboard/dashboard/dashboard +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4f4bb685d8d0b9ff7cd4071d89cc4bc9e453ce2a diff --git a/dashboard/dashboard/lib/main.dart b/dashboard/dashboard/lib/main.dart index 2b43e41..2cc5225 100644 --- a/dashboard/dashboard/lib/main.dart +++ b/dashboard/dashboard/lib/main.dart @@ -1,544 +1,543 @@ - import 'package:flutter/material.dart'; - import 'attraction.dart'; - import 'liste_attractions.dart'; - import 'liste_attraction_studio.dart'; - import 'etoiles.dart'; - import 'acces.dart'; - import 'package:aws_dynamodb_api/dynamodb-2012-08-10.dart'; - - void main() { - runApp(const MyApp()); - } +import 'package:flutter/material.dart'; +import 'attraction.dart'; +import 'liste_attractions.dart'; +import 'liste_attraction_studio.dart'; +import 'etoiles.dart'; +import 'acces.dart'; +import 'package:aws_dynamodb_api/dynamodb-2012-08-10.dart'; + +void main() { + runApp(const MyApp()); +} - class MyApp extends StatelessWidget { - const MyApp({super.key}); - @override - Widget build(BuildContext context) { - return MaterialApp( - debugShowCheckedModeBanner: false, - theme: ThemeData( - primarySwatch: Colors.blue, - cardColor: Colors.white, - ), - home: const MyHomePage(), - ); - } +class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + primarySwatch: Colors.blue, + cardColor: Colors.white, + ), + home: const MyHomePage(), + ); } +} - class MyHomePage extends StatefulWidget { - const MyHomePage({super.key}); +class MyHomePage extends StatefulWidget { + const MyHomePage({super.key}); - @override - // ignore: library_private_types_in_public_api - _MyHomePageState createState() => _MyHomePageState(); - } + @override + // ignore: library_private_types_in_public_api + _MyHomePageState createState() => _MyHomePageState(); +} - Color getColorForWaitTime(int waitTime) { - if (waitTime < 15) { - return Colors.green; - } else if (waitTime < 30) { - return Colors.orange; - } else { - return Colors.red; - } +Color getColorForWaitTime(int waitTime) { + if (waitTime < 15) { + return Colors.green; + } else if (waitTime < 30) { + return Colors.orange; + } else { + return Colors.red; } +} - class _MyHomePageState extends State { - List disneylandAttractions = []; - List studioAttractions = []; - List filteredDisneylandAttractions = []; - List filteredStudioAttractions = []; - List favoriteAttractions = []; - String selectedView = 'Disneyland'; - List selectedFilters = []; - - @override - void initState() { - super.initState(); - _loadAttractions(); - } +class _MyHomePageState extends State { + List disneylandAttractions = []; + List studioAttractions = []; + List filteredDisneylandAttractions = []; + List filteredStudioAttractions = []; + List favoriteAttractions = []; + String selectedView = 'Disneyland'; + List selectedFilters = []; - Future _loadAttractions() async { - - final dynamoDB = DynamoDB( - region: 'eu-north-1', - credentials: AwsClientCredentials( - accessKey: ACCES_KEY, - secretKey: SECRET_KEY, - ) - ); - disneylandAttractions = await attractionsAllLands(dynamoDB, 'BDDdisneyland'); - studioAttractions = await attractionsStudio(dynamoDB, 'BDDdisneyland'); - filteredDisneylandAttractions = List.from(disneylandAttractions); - filteredStudioAttractions = List.from(studioAttractions); - setState(() {}); - } + @override + void initState() { + super.initState(); + _loadAttractions(); + } - @override - Widget build(BuildContext context) { - final Size screenSize = MediaQuery.of(context).size; - return Scaffold( - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color.fromRGBO(1, 2, 57, 1.0), - Color.fromRGBO(0, 195, 206, 1), - ], - ), + Future _loadAttractions() async { + final dynamoDB = DynamoDB( + region: 'eu-north-1', + credentials: AwsClientCredentials( + accessKey: ACCES_KEY, + secretKey: SECRET_KEY, + )); + disneylandAttractions = + await attractionsAllLands(dynamoDB, 'BDDdisneyland'); + studioAttractions = await attractionsStudio(dynamoDB, 'BDDdisneyland'); + filteredDisneylandAttractions = List.from(disneylandAttractions); + filteredStudioAttractions = List.from(studioAttractions); + setState(() {}); + } + + @override + Widget build(BuildContext context) { + final Size screenSize = MediaQuery.of(context).size; + return Scaffold( + body: Stack(children: [ + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(1, 2, 57, 1.0), + Color.fromRGBO(0, 195, 206, 1), + ], ), - child: Column( - children: [ - Container( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.05), - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(20.0), // Arrondir les bords - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.asset( - 'assets/Titre.png', - width: - screenSize.width * 0.42, // Ajustez la largeur du logo - height: - screenSize.height * 0.08, // Ajustez la hauteur du logo - fit: BoxFit.fill, - ), - ), + ), + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.05), + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(20.0), // Arrondir les bords ), - FilterWidget( - selectedFilters: selectedFilters, - onFiltersChanged: (updatedFilters) { - setState(() { - selectedFilters = updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent - - print(selectedFilters); - applyFilters(selectedFilters); - }); - }, + child: ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.asset( + 'assets/Titre.png', + width: + screenSize.width * 0.42, // Ajustez la largeur du logo + height: + screenSize.height * 0.08, // Ajustez la hauteur du logo + fit: BoxFit.fill, + ), ), - Expanded( - child: Row( - children: [ - Expanded( - child: Align( - alignment: Alignment.topLeft, - // ignore: unnecessary_null_comparison - child: disneylandAttractions == null - ? const CircularProgressIndicator() - : Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context).size.width * - 0.057, - top: MediaQuery.of(context).size.height * - 0.04), - child: Container( - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * - 0.016), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - const Text( - 'Disneyland', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 25.0, - color: Colors.white, - ), + ), + FilterWidget( + selectedFilters: selectedFilters, + onFiltersChanged: (updatedFilters) { + setState(() { + selectedFilters = + updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent + + print(selectedFilters); + applyFilters(selectedFilters); + }); + }, + ), + Expanded( + child: Row( + children: [ + Expanded( + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: disneylandAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * + 0.057, + top: MediaQuery.of(context).size.height * + 0.04), + child: Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disneyland', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 25.0, + color: Colors.white, ), - PopupMenuButton( - initialValue: selectedView, - onSelected: _onViewChanged, - itemBuilder: - (BuildContext context) { - return [ - 'Toutes les attractions', - 'Main Street U.S.A', - 'Frontierland', - 'Adventureland', - 'Fantasyland', - 'Discoveryland', - ].map((String view) { - return PopupMenuItem( - value: view, - child: Text(view), - ); - }).toList(); - }, - child: Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context) - .size - .width * - 0.004), - child: const Icon( - Icons.arrow_drop_down, - color: Colors - .white, // Définit la couleur de l'icône en blanc - ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Main Street U.S.A', + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc ), ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * - 0.02, - ), - SizedBox( - height: screenSize.height * 0.535, - width: screenSize.width * 0.42, - child: ListView.builder( - itemCount: - filteredDisneylandAttractions - .length, - itemBuilder: (context, index) { - var attraction = - filteredDisneylandAttractions[ - index]; - return Container( - margin: EdgeInsets.only( - bottom: MediaQuery.of(context) - .size - .height * - 0.016), - child: Card( - shape: RoundedRectangleBorder( + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: screenSize.height * 0.535, + width: screenSize.width * 0.42, + child: ListView.builder( + itemCount: + filteredDisneylandAttractions + .length, + itemBuilder: (context, index) { + var attraction = + filteredDisneylandAttractions[ + index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.008), + leading: ClipRRect( borderRadius: BorderRadius.circular( - 20.0), + 10.0), + child: Image.asset( + attraction.photoUrl, + width: screenSize.width * + 0.03, + height: + screenSize.height * + 0.057, + fit: BoxFit.cover, + ), ), - elevation: 5, - color: Colors.white, - child: ListTile( - contentPadding: - EdgeInsets.symmetric( - horizontal: - MediaQuery.of( - context) - .size - .width * - 0.008), - leading: ClipRRect( - borderRadius: - BorderRadius.circular( - 10.0), - child: Image.asset( - attraction.photoUrl, - width: screenSize.width * - 0.03, - height: - screenSize.height * - 0.057, - fit: BoxFit.cover, - ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + style: const TextStyle( + color: Colors.black, ), - title: Text( - attraction.name, - overflow: - TextOverflow.ellipsis, + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', style: const TextStyle( - color: Colors.black, - ), - ), - subtitle: Text.rich( - TextSpan( - text: - 'Temps d\'attente: ', - style: const TextStyle( - fontWeight: - FontWeight.bold), - children: [ - TextSpan( - text: - '${attraction.waitTime} minutes', - style: TextStyle( - fontWeight: - FontWeight.bold, - color: getColorForWaitTime( - attraction - .waitTime), - ), - ), - ], - ), - ), - trailing: Row( - mainAxisSize: - MainAxisSize.min, + fontWeight: + FontWeight.bold), children: [ - Icon( - attraction.isAvailable - ? Icons.check_circle - : Icons.cancel, - color: attraction - .isAvailable - ? Colors.green - : Colors.red, - ), - SizedBox( - width: MediaQuery.of( - context) - .size - .width * - 0.004, - ), - IconButton( - icon: Icon( - attraction.isFavorite - ? Icons.star - : Icons - .star_border, - color: Colors.black, + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: getColorForWaitTime( + attraction + .waitTime), ), - onPressed: () { - setState(() { - attraction - .isFavorite = - !attraction - .isFavorite; - if (attraction - .isFavorite) { - favoriteAttractions - .add( - attraction); - } else { - favoriteAttractions - .remove( - attraction); - } - }); - }, ), ], ), ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), ), - ); - }, - ), + ), + ); + }, ), - ], - ), + ), + ], ), ), - ), + ), ), - Expanded( - child: Align( - alignment: Alignment.topLeft, - // ignore: unnecessary_null_comparison - child: studioAttractions == null - ? const CircularProgressIndicator() - : Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context).size.height * - 0.01, - top: MediaQuery.of(context).size.height * - 0.04, - right: MediaQuery.of(context).size.width * - 0.042), - child: Container( - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * - 0.016), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - const Text( - 'Disney Studios', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 25.0, + ), + Expanded( + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: studioAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.height * + 0.01, + top: MediaQuery.of(context).size.height * + 0.04, + right: MediaQuery.of(context).size.width * + 0.042), + child: Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disney Studios', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 25.0, + ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Marvel Avengers Campus', + 'Production Courtyard', + 'Toon Studio', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + offset: const Offset(200, 0), + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc ), ), - PopupMenuButton( - initialValue: selectedView, - onSelected: _onViewChanged, - itemBuilder: - (BuildContext context) { - return [ - 'Toutes les attractions', - 'Marvel Avengers Campus', - 'Production Courtyard', - 'Toon Studio', - ].map((String view) { - return PopupMenuItem( - value: view, - child: Text(view), - ); - }).toList(); - }, - offset: const Offset(200, 0), - child: Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context) - .size - .width * - 0.004), - child: const Icon( - Icons.arrow_drop_down, - color: Colors - .white, // Définit la couleur de l'icône en blanc - ), - ), - + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: screenSize.height * 0.535, + width: screenSize.width * 0.417, + child: ListView.builder( + itemCount: + filteredStudioAttractions.length, + itemBuilder: (context, index) { + var attraction = + filteredStudioAttractions[ + index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * - 0.02, - ), - SizedBox( - height: screenSize.height * 0.535, - width: screenSize.width * 0.417, - child: ListView.builder( - itemCount: - filteredStudioAttractions.length, - itemBuilder: (context, index) { - var attraction = - filteredStudioAttractions[ - index]; - return Container( - margin: EdgeInsets.only( - bottom: MediaQuery.of(context) - .size - .height * - 0.016), - child: Card( - shape: RoundedRectangleBorder( + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.0083), + leading: ClipRRect( borderRadius: BorderRadius.circular( - 20.0), - ), - elevation: 5, - color: Colors.white, - child: ListTile( - contentPadding: - EdgeInsets.symmetric( - horizontal: - MediaQuery.of( - context) - .size - .width * - 0.0083), - leading: ClipRRect( - borderRadius: - BorderRadius.circular( - 10.0), - child: Image.asset( - attraction.photoUrl, - width: screenSize.width * - 0.029, - height: - screenSize.height * - 0.057, - fit: BoxFit.cover, - ), - ), - title: Text( - attraction.name, - overflow: - TextOverflow.ellipsis, - ), - subtitle: Text.rich( - TextSpan( - text: - 'Temps d\'attente: ', - style: const TextStyle( - fontWeight: - FontWeight.bold), - children: [ - TextSpan( - text: - '${attraction.waitTime} minutes', - style: TextStyle( - fontWeight: - FontWeight.bold, - color: getColorForWaitTime( - attraction - .waitTime), - ), - ), - ], - ), + 10.0), + child: Image.asset( + attraction.photoUrl, + width: screenSize.width * + 0.029, + height: + screenSize.height * + 0.057, + fit: BoxFit.cover, ), - trailing: Row( - mainAxisSize: - MainAxisSize.min, + ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight.bold), children: [ - Icon( - attraction.isAvailable - ? Icons.check_circle - : Icons.cancel, - color: attraction - .isAvailable - ? Colors.green - : Colors.red, - ), - SizedBox( - width: MediaQuery.of( - context) - .size - .width * - 0.004, - ), - IconButton( - icon: Icon( - attraction.isFavorite - ? Icons.star - : Icons - .star_border, - color: Colors.black, + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: getColorForWaitTime( + attraction + .waitTime), ), - onPressed: () { - setState(() { - attraction - .isFavorite = - !attraction - .isFavorite; - if (attraction - .isFavorite) { - favoriteAttractions - .add( - attraction); - } else { - favoriteAttractions - .remove( - attraction); - } - }); - }, ), ], ), ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), ), - ); - }, - ), + ), + ); + }, ), - ], - ), + ), + ], ), ), - ), + ), ), + ), Padding( padding: EdgeInsets.only( right: MediaQuery.of(context).size.width * 0.052), @@ -728,92 +727,121 @@ ); } -void _onViewChanged(String? view) { - setState(() { - selectedView = view ?? 'Disneyland'; // Mise à jour de la vue sélectionnée - if (view != null && !selectedFilters.contains(view)) { - selectedFilters.add(view); // Ajout de l'élément sélectionné à la liste des filtres - } - - applyFilters(selectedFilters); // Application des filtres sélectionnés - }); -} + void _onViewChanged(String? view) { + setState(() { + selectedView = view ?? 'Disneyland'; // Mise à jour de la vue sélectionnée + if (view != null && !selectedFilters.contains(view)) { + selectedFilters + .add(view); // Ajout de l'élément sélectionné à la liste des filtres + } + applyFilters(selectedFilters); // Application des filtres sélectionnés + }); + } - void applyFilters(List selectedFilters) { - filteredDisneylandAttractions = List.from(disneylandAttractions); - filteredStudioAttractions = List.from(studioAttractions); + void applyFilters(List selectedFilters) { + filteredDisneylandAttractions = List.from(disneylandAttractions); + filteredStudioAttractions = List.from(studioAttractions); - if (selectedFilters.isEmpty) { - // Aucun filtre sélectionné, ne rien faire ou afficher tout - return; - } + if (selectedFilters.isEmpty) { + // Aucun filtre sélectionné, ne rien faire ou afficher tout + return; + } - // Appliquer chaque filtre sélectionné - for (String filter in selectedFilters) { - switch (filter) { - case 'waitTime': - filteredDisneylandAttractions.sort((a, b) => a.waitTime.compareTo(b.waitTime)); - filteredStudioAttractions.sort((a, b) => a.waitTime.compareTo(b.waitTime)); - break; - - case 'favorites': - filteredDisneylandAttractions = disneylandAttractions.where((attraction) => attraction.isFavorite).toList(); - filteredStudioAttractions = studioAttractions.where((attraction) => attraction.isFavorite).toList(); - break; - - case 'availability': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.isAvailable).toList(); - filteredStudioAttractions = filteredStudioAttractions.where((attraction) => attraction.isAvailable).toList(); - break; - case 'non_availability': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => !attraction.isAvailable).toList(); - filteredStudioAttractions = filteredStudioAttractions.where((attraction) => !attraction.isAvailable).toList(); - break; + // Appliquer chaque filtre sélectionné + for (String filter in selectedFilters) { + switch (filter) { + case 'waitTime': + filteredDisneylandAttractions + .sort((a, b) => a.waitTime.compareTo(b.waitTime)); + filteredStudioAttractions + .sort((a, b) => a.waitTime.compareTo(b.waitTime)); + break; + + case 'favorites': + filteredDisneylandAttractions = disneylandAttractions + .where((attraction) => attraction.isFavorite) + .toList(); + filteredStudioAttractions = studioAttractions + .where((attraction) => attraction.isFavorite) + .toList(); + break; + + case 'availability': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.isAvailable) + .toList(); + filteredStudioAttractions = filteredStudioAttractions + .where((attraction) => attraction.isAvailable) + .toList(); + break; + case 'non_availability': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => !attraction.isAvailable) + .toList(); + filteredStudioAttractions = filteredStudioAttractions + .where((attraction) => !attraction.isAvailable) + .toList(); + break; // filtrage des lands du parc disneyland - case 'Main Street U.S.A': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.secteur == 'Main Street U.S.A').toList(); - selectedFilters.remove('Main Street U.S.A'); - break; - - case 'Frontierland': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.secteur == 'Frontierland').toList(); - selectedFilters.remove('Frontierland'); - break; - - case 'Adventureland': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.secteur == 'Adventureland').toList(); - selectedFilters.remove('Adventureland'); - break; - - case 'Fantasyland': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.secteur == 'Fantasyland').toList(); - selectedFilters.remove('Fantasyland'); - - case 'Discoveryland': - filteredDisneylandAttractions = filteredDisneylandAttractions.where((attraction) => attraction.secteur == 'Discoveryland').toList(); - selectedFilters.remove('Discoveryland'); + case 'Main Street U.S.A': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.secteur == 'Main Street U.S.A') + .toList(); + selectedFilters.remove('Main Street U.S.A'); + break; + + case 'Frontierland': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.secteur == 'Frontierland') + .toList(); + selectedFilters.remove('Frontierland'); + break; + + case 'Adventureland': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.secteur == 'Adventureland') + .toList(); + selectedFilters.remove('Adventureland'); + break; + + case 'Fantasyland': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.secteur == 'Fantasyland') + .toList(); + selectedFilters.remove('Fantasyland'); + + case 'Discoveryland': + filteredDisneylandAttractions = filteredDisneylandAttractions + .where((attraction) => attraction.secteur == 'Discoveryland') + .toList(); + selectedFilters.remove('Discoveryland'); // filtrage des land par Disney Studio - case 'Toon Studio': - filteredStudioAttractions = filteredStudioAttractions.where((attraction) => attraction.secteur == 'Toon Studio').toList(); - selectedFilters.remove('Toon Studio'); - - case 'Marvel Avengers Campus': - filteredStudioAttractions = filteredStudioAttractions.where((attraction) => attraction.secteur == 'Marvel Avengers Campus').toList(); - selectedFilters.remove('Marvel Avengers Campus'); - - - case 'Production Courtyard': - filteredStudioAttractions = filteredStudioAttractions.where((attraction) => attraction.secteur == 'Production Courtyard').toList(); - selectedFilters.remove('Production Courtyard'); - + case 'Toon Studio': + filteredStudioAttractions = filteredStudioAttractions + .where((attraction) => attraction.secteur == 'Toon Studio') + .toList(); + selectedFilters.remove('Toon Studio'); + + case 'Marvel Avengers Campus': + filteredStudioAttractions = filteredStudioAttractions + .where((attraction) => + attraction.secteur == 'Marvel Avengers Campus') + .toList(); + selectedFilters.remove('Marvel Avengers Campus'); + + case 'Production Courtyard': + filteredStudioAttractions = filteredStudioAttractions + .where( + (attraction) => attraction.secteur == 'Production Courtyard') + .toList(); + selectedFilters.remove('Production Courtyard'); + } } } } -} - class FilterWidget extends StatelessWidget { final List? selectedFilters; @@ -829,7 +857,8 @@ class FilterWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.07), + padding: + EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.07), child: const Text( 'Filtres :', style: TextStyle( @@ -878,7 +907,8 @@ class FilterButton extends StatelessWidget { final List? selectedFilters; final Function(List)? onFiltersChanged; - const FilterButton({super.key, + const FilterButton({ + super.key, required this.title, required this.filterKey, required this.selectedFilters, @@ -908,15 +938,16 @@ class FilterButton extends StatelessWidget { } else { updatedFilters.add(filterKey); } - debugPrint('Updated filters: $updatedFilters'); + debugPrint('Updated filters: $updatedFilters'); if (onFiltersChanged != null) { onFiltersChanged!(updatedFilters); } }, style: ElevatedButton.styleFrom( - backgroundColor: selectedFilters != null && selectedFilters!.contains(filterKey) - ? Colors.green - : Colors.white, + backgroundColor: + selectedFilters != null && selectedFilters!.contains(filterKey) + ? Colors.green + : Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20.0), ), @@ -924,9 +955,10 @@ class FilterButton extends StatelessWidget { child: Text( title, style: TextStyle( - color: selectedFilters != null && selectedFilters!.contains(filterKey) - ? Colors.white - : Colors.black, + color: + selectedFilters != null && selectedFilters!.contains(filterKey) + ? Colors.white + : Colors.black, fontSize: 18, ), ), diff --git a/dashboard/dashboard/lib/responsiveapp.dart b/dashboard/dashboard/lib/responsiveapp.dart new file mode 100644 index 0000000..bfd58ea --- /dev/null +++ b/dashboard/dashboard/lib/responsiveapp.dart @@ -0,0 +1,173 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Responsive App', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: MyHomePage(), + ); + } +} + +class MyHomePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Responsive App'), + ), + body: LayoutBuilder( + builder: (context, constraints) { + if (constraints.maxWidth > 1200) { + return _buildExtraLargeLayout(); + } else if (constraints.maxWidth > 850) { + return _buildLargeLayout(); + } else if (constraints.maxWidth > 400) { + return _buildMediumLayout(); + } else { + return _buildSmallLayout(); + } + }, + ), + ); + } + + Widget _buildExtraLargeLayout() { + return Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + color: Colors.blue, + height: 200, + child: Center( + child: Text('Element 1'), + ), + ), + ), + Expanded( + child: Container( + color: Colors.green, + height: 200, + child: Center( + child: Text('Element 2'), + ), + ), + ), + Expanded( + child: Container( + color: Colors.red, + height: 200, + child: Center( + child: Text('Element 3'), + ), + ), + ), + ], + ); + } + + Widget _buildLargeLayout() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + color: Colors.blue, + height: 200, + child: Center( + child: Text('Element 1'), + ), + ), + ), + Expanded( + child: Container( + color: Colors.green, + height: 200, + child: Center( + child: Text('Element 2'), + ), + ), + ), + ], + ), + Container( + color: Colors.red, + height: 200, + child: Center( + child: Text('Element 3'), + ), + ), + ], + ); + } + + Widget _buildMediumLayout() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + color: Colors.blue, + height: 200, + child: Center( + child: Text('Element 1'), + ), + ), + Container( + color: Colors.green, + height: 200, + child: Center( + child: Text('Element 2'), + ), + ), + Container( + color: Colors.red, + height: 200, + child: Center( + child: Text('Element 3'), + ), + ), + ], + ); + } + + Widget _buildSmallLayout() { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + color: Colors.blue, + height: 200, + child: Center( + child: Text('Element 1'), + ), + ), + Container( + color: Colors.red, + height: 200, + child: Center( + child: Text('Element 3'), + ), + ), + Container( + color: Colors.green, + height: 200, + child: Center( + child: Text('Element 2'), + ), + ), + ], + ); + } +} From 820d3dd88ff244378636f77e58ab5b5bc1e3ad82 Mon Sep 17 00:00:00 2001 From: NovaSkyrim <100930779+NovaSkyrim@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:56:56 +0200 Subject: [PATCH 2/5] responsive_alpha --- dashboard/dashboard/lib/main.dart | 1797 +++++++++++++++++--- dashboard/dashboard/lib/responsiveapp.dart | 173 -- 2 files changed, 1540 insertions(+), 430 deletions(-) delete mode 100644 dashboard/dashboard/lib/responsiveapp.dart diff --git a/dashboard/dashboard/lib/main.dart b/dashboard/dashboard/lib/main.dart index 2cc5225..df2dec2 100644 --- a/dashboard/dashboard/lib/main.dart +++ b/dashboard/dashboard/lib/main.dart @@ -75,54 +75,683 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { - final Size screenSize = MediaQuery.of(context).size; return Scaffold( - body: Stack(children: [ - Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color.fromRGBO(1, 2, 57, 1.0), - Color.fromRGBO(0, 195, 206, 1), - ], + body: LayoutBuilder( + builder: (context, constraints) { + return ListView( + physics: MediaQuery.of(context).size.width > 1200 + ? const NeverScrollableScrollPhysics() + : const AlwaysScrollableScrollPhysics(), + children: [ + _buildLayout(constraints.maxWidth), + ], + ); + }, + ), + ); + } + + Widget _buildLayout(double screenWidth) { + if (screenWidth > 1200) { + return _buildLargeLayout(); + } else if (screenWidth > 850) { + return _buildMediumLayout(); + } else { + return _buildSmallLayout(); + } + } + + Widget _buildLargeLayout() { + final Size screenSize = MediaQuery.of(context).size; + return Stack(children: [ + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(1, 2, 57, 1.0), + Color.fromRGBO(0, 195, 206, 1), + ], + ), + ), + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.05), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.0), // Arrondir les bords + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.asset( + 'assets/Titre.png', + width: 700, // Ajustez la largeur du logo + height: 80, // Ajustez la hauteur du logo + fit: BoxFit.fill, + ), + ), + ), + FilterWidget( + selectedFilters: selectedFilters, + onFiltersChanged: (updatedFilters) { + setState(() { + selectedFilters = + updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent + + print(selectedFilters); + applyFilters(selectedFilters); + }); + }, + ), + SizedBox( + height: 800, + child: Expanded( + child: Row( + children: [ + Expanded( + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: disneylandAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * + 0.057, + top: MediaQuery.of(context).size.height * + 0.04), + child: Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disneyland', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 25.0, + color: Colors.white, + ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Main Street U.S.A', + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc + ), + ), + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: screenSize.height * 0.535, + width: screenSize.width * 0.42, + child: ListView.builder( + itemCount: + filteredDisneylandAttractions + .length, + itemBuilder: (context, index) { + var attraction = + filteredDisneylandAttractions[ + index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.008), + leading: ClipRRect( + borderRadius: + BorderRadius.circular( + 10.0), + child: Image.asset( + attraction.photoUrl, + width: screenSize.width * + 0.03, + height: + screenSize.height * + 0.057, + fit: BoxFit.cover, + ), + ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + style: const TextStyle( + color: Colors.black, + ), + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight.bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), + ), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ), + ), + Expanded( + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: studioAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.height * + 0.01, + top: MediaQuery.of(context).size.height * + 0.04, + right: MediaQuery.of(context).size.width * + 0.042), + child: Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disney Studios', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 25.0, + ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Marvel Avengers Campus', + 'Production Courtyard', + 'Toon Studio', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + offset: const Offset(200, 0), + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc + ), + ), + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: screenSize.height * 0.535, + width: screenSize.width * 0.417, + child: ListView.builder( + itemCount: + filteredStudioAttractions.length, + itemBuilder: (context, index) { + var attraction = + filteredStudioAttractions[ + index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.0083), + leading: ClipRRect( + borderRadius: + BorderRadius.circular( + 10.0), + child: Image.asset( + attraction.photoUrl, + width: screenSize.width * + 0.029, + height: + screenSize.height * + 0.057, + fit: BoxFit.cover, + ), + ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight.bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), + ), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ), + ), + Padding( + padding: EdgeInsets.only( + right: MediaQuery.of(context).size.width * 0.052), + child: Align( + alignment: Alignment.centerLeft, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only( + top: 20, + ), + child: buildAttractionsInfoContainer(), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.01, + ), + Container( + constraints: BoxConstraints( + maxWidth: 400, + maxHeight: + MediaQuery.of(context).size.height * + 0.464), + child: Expanded( + child: Container( + margin: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: + const Color.fromARGB(255, 0, 0, 0) + .withOpacity(0.3), + spreadRadius: 1, + blurRadius: 2, + offset: const Offset(2, 3), + ), + ], + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + 'Attractions Favorites', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 18.0, + ), + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.01, // 1% de la hauteur de l'écran + width: MediaQuery.of(context) + .size + .width * + 0.208, + ), + favoriteAttractions.isEmpty + ? const Text( + 'Aucune attraction favorite actuellement', + style: TextStyle( + fontStyle: FontStyle.italic, + ), + ) + : Column( + children: [ + for (var attraction + in favoriteAttractions) + ListTile( + title: + Text(attraction.name), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight + .bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight + .bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ], + ), + ), + ), + ], + ), + ), ), + ], + ), + ), + const Positioned.fill( + child: StarBackground(), + ), + ]); + } + + Widget _buildMediumLayout() { + final Size screenSize = MediaQuery.of(context).size; + return Stack(children: [ + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(1, 2, 57, 1.0), + Color.fromRGBO(0, 195, 206, 1), + ], ), - child: Column( - children: [ - Container( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.05), - decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(20.0), // Arrondir les bords - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.asset( - 'assets/Titre.png', - width: - screenSize.width * 0.42, // Ajustez la largeur du logo - height: - screenSize.height * 0.08, // Ajustez la hauteur du logo - fit: BoxFit.fill, - ), - ), + ), + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.05), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.0), // Arrondir les bords ), - FilterWidget( - selectedFilters: selectedFilters, - onFiltersChanged: (updatedFilters) { - setState(() { - selectedFilters = - updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent - - print(selectedFilters); - applyFilters(selectedFilters); - }); - }, + child: ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.asset( + 'assets/Titre.png', + width: 700, // Ajustez la largeur du logo + height: 80, // Ajustez la hauteur du logo + fit: BoxFit.fill, + ), ), - Expanded( + ), + FilterWidget( + selectedFilters: selectedFilters, + onFiltersChanged: (updatedFilters) { + setState(() { + selectedFilters = + updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent + + print(selectedFilters); + applyFilters(selectedFilters); + }); + }, + ), + SizedBox( + // PROBLEME + height: 700, + child: Expanded( child: Row( children: [ Expanded( @@ -151,8 +780,218 @@ class _MyHomePageState extends State { 'Disneyland', style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 25.0, + fontSize: 25.0, + color: Colors.white, + ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Main Street U.S.A', + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc + ), + ), + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: screenSize.height * 0.535, + width: screenSize.width * 0.42, + child: ListView.builder( + itemCount: + filteredDisneylandAttractions + .length, + itemBuilder: (context, index) { + var attraction = + filteredDisneylandAttractions[ + index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.008), + leading: ClipRRect( + borderRadius: + BorderRadius.circular( + 10.0), + child: Image.asset( + attraction.photoUrl, + width: screenSize.width * + 0.03, + height: + screenSize.height * + 0.057, + fit: BoxFit.cover, + ), + ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + style: const TextStyle( + color: Colors.black, + ), + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight.bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), + ), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ), + ), + Expanded( + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: studioAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.height * + 0.01, + top: MediaQuery.of(context).size.height * + 0.04, + right: MediaQuery.of(context).size.width * + 0.042), + child: Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * + 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disney Studios', + style: TextStyle( + fontWeight: FontWeight.bold, color: Colors.white, + fontSize: 25.0, ), ), PopupMenuButton( @@ -162,11 +1001,9 @@ class _MyHomePageState extends State { (BuildContext context) { return [ 'Toutes les attractions', - 'Main Street U.S.A', - 'Frontierland', - 'Adventureland', - 'Fantasyland', - 'Discoveryland', + 'Marvel Avengers Campus', + 'Production Courtyard', + 'Toon Studio', ].map((String view) { return PopupMenuItem( value: view, @@ -174,6 +1011,7 @@ class _MyHomePageState extends State { ); }).toList(); }, + offset: const Offset(200, 0), child: Padding( padding: EdgeInsets.only( left: MediaQuery.of(context) @@ -196,14 +1034,13 @@ class _MyHomePageState extends State { ), SizedBox( height: screenSize.height * 0.535, - width: screenSize.width * 0.42, + width: screenSize.width * 0.417, child: ListView.builder( itemCount: - filteredDisneylandAttractions - .length, + filteredStudioAttractions.length, itemBuilder: (context, index) { var attraction = - filteredDisneylandAttractions[ + filteredStudioAttractions[ index]; return Container( margin: EdgeInsets.only( @@ -227,7 +1064,7 @@ class _MyHomePageState extends State { context) .size .width * - 0.008), + 0.0083), leading: ClipRRect( borderRadius: BorderRadius.circular( @@ -235,7 +1072,7 @@ class _MyHomePageState extends State { child: Image.asset( attraction.photoUrl, width: screenSize.width * - 0.03, + 0.029, height: screenSize.height * 0.057, @@ -246,9 +1083,6 @@ class _MyHomePageState extends State { attraction.name, overflow: TextOverflow.ellipsis, - style: const TextStyle( - color: Colors.black, - ), ), subtitle: Text.rich( TextSpan( @@ -333,24 +1167,215 @@ class _MyHomePageState extends State { ), ), ), - Expanded( + ], + ), + ), + ), + Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.04), + child: Align( + alignment: Alignment.centerLeft, + child: SizedBox( + width: screenSize.width * 0.9, + child: SizedBox( + height: screenSize.height * 0.4, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + right: MediaQuery.of(context).size.width * 0.026), + child: buildAttractionsInfoContainer(), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.01, + ), + Container( + constraints: BoxConstraints( + maxHeight: + MediaQuery.of(context).size.height * 0.464), + child: SizedBox( + width: 400, + child: Expanded( + child: Container( + margin: EdgeInsets.all( + MediaQuery.of(context).size.height * 0.016), + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * 0.016), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: const Color.fromARGB(255, 0, 0, 0) + .withOpacity(0.3), + spreadRadius: 1, + blurRadius: 2, + offset: const Offset(2, 3), + ), + ], + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + 'Attractions Favorites', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 18.0, + ), + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.01, // 1% de la hauteur de l'écran + width: + MediaQuery.of(context).size.width * + 0.208, + ), + favoriteAttractions.isEmpty + ? const Text( + 'Aucune attraction favorite actuellement', + style: TextStyle( + fontStyle: FontStyle.italic, + ), + ) + : Column( + children: [ + for (var attraction + in favoriteAttractions) + ListTile( + title: + Text(attraction.name), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight + .bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight + .bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: + attraction.isAvailable + ? Colors.green + : Colors.red, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ), + ), + ], + ), + ), + ), + ), + ), + ], + ), + ), + const Positioned.fill( + child: StarBackground(), + ), + ]); + } + + Widget _buildSmallLayout() { + final Size screenSize = MediaQuery.of(context).size; + return Stack(children: [ + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(1, 2, 57, 1.0), + Color.fromRGBO(0, 195, 206, 1), + ], + ), + ), + child: Column( + children: [ + Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.05), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.0), // Arrondir les bords + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(20.0), + child: Image.asset( + 'assets/Titre.png', + width: 450, // Ajustez la largeur du logo + height: 60, // Ajustez la hauteur du logo + fit: BoxFit.fill, + ), + ), + ), + SmallFilterWidget( + selectedFilters: selectedFilters, + onFiltersChanged: (updatedFilters) { + setState(() { + selectedFilters = + updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent + + print(selectedFilters); + applyFilters(selectedFilters); + }); + }, + ), + SizedBox( + // PROBLEME + height: 1000, + child: Expanded( + child: Column( + children: [ + SizedBox( + height: 500, + width: MediaQuery.of(context).size.width, child: Align( alignment: Alignment.topLeft, // ignore: unnecessary_null_comparison - child: studioAttractions == null + child: disneylandAttractions == null ? const CircularProgressIndicator() : Padding( padding: EdgeInsets.only( - left: MediaQuery.of(context).size.height * - 0.01, top: MediaQuery.of(context).size.height * - 0.04, - right: MediaQuery.of(context).size.width * - 0.042), + 0.04), child: Container( padding: EdgeInsets.all( MediaQuery.of(context).size.height * - 0.016), + 0.01), child: Column( children: [ Row( @@ -358,11 +1383,11 @@ class _MyHomePageState extends State { MainAxisAlignment.center, children: [ const Text( - 'Disney Studios', + 'Disneyland', style: TextStyle( fontWeight: FontWeight.bold, - color: Colors.white, fontSize: 25.0, + color: Colors.white, ), ), PopupMenuButton( @@ -372,9 +1397,11 @@ class _MyHomePageState extends State { (BuildContext context) { return [ 'Toutes les attractions', - 'Marvel Avengers Campus', - 'Production Courtyard', - 'Toon Studio', + 'Main Street U.S.A', + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', ].map((String view) { return PopupMenuItem( value: view, @@ -382,7 +1409,6 @@ class _MyHomePageState extends State { ); }).toList(); }, - offset: const Offset(200, 0), child: Padding( padding: EdgeInsets.only( left: MediaQuery.of(context) @@ -399,19 +1425,15 @@ class _MyHomePageState extends State { ], ), SizedBox( - height: - MediaQuery.of(context).size.height * - 0.02, - ), - SizedBox( - height: screenSize.height * 0.535, - width: screenSize.width * 0.417, + height: 400, + width: screenSize.width * 0.72, child: ListView.builder( itemCount: - filteredStudioAttractions.length, + filteredDisneylandAttractions + .length, itemBuilder: (context, index) { var attraction = - filteredStudioAttractions[ + filteredDisneylandAttractions[ index]; return Container( margin: EdgeInsets.only( @@ -435,7 +1457,7 @@ class _MyHomePageState extends State { context) .size .width * - 0.0083), + 0.008), leading: ClipRRect( borderRadius: BorderRadius.circular( @@ -443,7 +1465,7 @@ class _MyHomePageState extends State { child: Image.asset( attraction.photoUrl, width: screenSize.width * - 0.029, + 0.10, height: screenSize.height * 0.057, @@ -454,6 +1476,9 @@ class _MyHomePageState extends State { attraction.name, overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: Colors.black, + ), ), subtitle: Text.rich( TextSpan( @@ -538,156 +1563,335 @@ class _MyHomePageState extends State { ), ), ), - Padding( - padding: EdgeInsets.only( - right: MediaQuery.of(context).size.width * 0.052), + SizedBox( + width: MediaQuery.of(context).size.width, + height: 500, child: Align( - alignment: Alignment.centerLeft, - child: SizedBox( - width: screenSize.width * 0.208, - child: SizedBox( - height: screenSize.height * 0.807, - child: Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.only( - right: MediaQuery.of(context).size.width * - 0.026), - child: buildAttractionsInfoContainer(), - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.01, - ), - Container( - constraints: BoxConstraints( - maxHeight: - MediaQuery.of(context).size.height * - 0.464), - child: Expanded( - child: Container( - margin: EdgeInsets.all( - MediaQuery.of(context).size.height * - 0.016), - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * - 0.016), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.circular(20.0), - boxShadow: [ - BoxShadow( - color: const Color.fromARGB( - 255, 0, 0, 0) - .withOpacity(0.3), - spreadRadius: 1, - blurRadius: 2, - offset: const Offset(2, 3), + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: studioAttractions == null + ? const CircularProgressIndicator() + : Container( + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * 0.016), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disney Studios', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 25.0, ), - ], - ), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - const Text( - 'Attractions Favorites', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 18.0, - ), - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.01, // 1% de la hauteur de l'écran - width: MediaQuery.of(context) - .size - .width * - 0.208, + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: (BuildContext context) { + return [ + 'Toutes les attractions', + 'Marvel Avengers Campus', + 'Production Courtyard', + 'Toon Studio', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + offset: const Offset(200, 0), + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc ), - favoriteAttractions.isEmpty - ? const Text( - 'Aucune attraction favorite actuellement', - style: TextStyle( - fontStyle: - FontStyle.italic, - ), - ) - : Column( + ), + ), + ], + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02, + ), + SizedBox( + height: 400, + width: screenSize.width * 0.72, + child: ListView.builder( + itemCount: + filteredStudioAttractions.length, + itemBuilder: (context, index) { + var attraction = + filteredStudioAttractions[index]; + return Container( + margin: EdgeInsets.only( + bottom: MediaQuery.of(context) + .size + .height * + 0.016), + child: Card( + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.0083), + leading: ClipRRect( + borderRadius: + BorderRadius.circular( + 10.0), + child: Image.asset( + attraction.photoUrl, + width: + screenSize.width * 0.10, + height: screenSize.height * + 0.057, + fit: BoxFit.cover, + ), + ), + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, + ), + subtitle: Text.rich( + TextSpan( + text: 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight.bold), children: [ - for (var attraction - in favoriteAttractions) - ListTile( - title: Text( - attraction.name), - subtitle: Text.rich( - TextSpan( - text: - 'Temps d\'attente: ', - style: const TextStyle( - fontWeight: - FontWeight - .bold), - children: [ - TextSpan( - text: - '${attraction.waitTime} minutes', - style: - TextStyle( - fontWeight: - FontWeight - .bold, - color: getColorForWaitTime( - attraction - .waitTime), - ), - ), - ], - ), - ), - trailing: Icon( - attraction - .isAvailable - ? Icons - .check_circle - : Icons.cancel, - color: attraction - .isAvailable - ? Colors.green - : Colors.red, - ), + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight.bold, + color: + getColorForWaitTime( + attraction + .waitTime), ), + ), ], ), - ], - ), + ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: + attraction.isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: + MediaQuery.of(context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction.isFavorite + ? Icons.star + : Icons.star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), + ), + ), + ); + }, ), ), + ], + ), + ), + ), + ), + ], + ), + ), + ), + Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.04), + child: Align( + alignment: Alignment.centerLeft, + child: SizedBox( + width: screenSize.width * 0.9, + child: SizedBox( + height: screenSize.height * 0.6, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildAttractionsInfoContainer(), + SizedBox( + height: MediaQuery.of(context).size.height * 0.01, + ), + Container( + constraints: BoxConstraints( + maxHeight: + MediaQuery.of(context).size.height * 0.464), + child: SizedBox( + width: 400, + child: Expanded( + child: Container( + margin: EdgeInsets.all( + MediaQuery.of(context).size.height * 0.016), + padding: EdgeInsets.all( + MediaQuery.of(context).size.height * 0.016), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: const Color.fromARGB(255, 0, 0, 0) + .withOpacity(0.3), + spreadRadius: 1, + blurRadius: 2, + offset: const Offset(2, 3), + ), + ], + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + 'Attractions Favorites', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 18.0, + ), + ), + SizedBox( + height: MediaQuery.of(context) + .size + .height * + 0.01, // 1% de la hauteur de l'écran + width: + MediaQuery.of(context).size.width * + 0.208, + ), + favoriteAttractions.isEmpty + ? const Text( + 'Aucune attraction favorite actuellement', + style: TextStyle( + fontStyle: FontStyle.italic, + ), + ) + : Column( + children: [ + for (var attraction + in favoriteAttractions) + ListTile( + title: + Text(attraction.name), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight + .bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight + .bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: + attraction.isAvailable + ? Colors.green + : Colors.red, + ), + ), + ], + ), + ], ), ), - ], + ), ), ), ), - ), + ], ), - ], + ), ), ), - ], - ), - ), - const Positioned.fill( - child: StarBackground(), + ), + ], ), - ]), - ); + ), + const Positioned.fill( + child: StarBackground(), + ), + ]); } Widget buildAttractionsInfoContainer() { @@ -699,7 +1903,7 @@ class _MyHomePageState extends State { studioAttractions.where((attraction) => attraction.isAvailable).length; return Align( - alignment: Alignment.topRight, + alignment: Alignment.topCenter, child: Container( margin: EdgeInsets.all(MediaQuery.of(context).size.height * 0.016), padding: EdgeInsets.all(MediaQuery.of(context).size.height * 0.016), @@ -853,49 +2057,128 @@ class FilterWidget extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.08), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: - EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.07), - child: const Text( - 'Filtres :', - style: TextStyle( - fontSize: 24.0, - color: Colors.white, + child: Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.07), + child: const Text( + 'Filtres :', + style: TextStyle( + fontSize: 24.0, + color: Colors.white, + ), ), ), - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Temps d\'attente', - filterKey: 'waitTime', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Favoris', - filterKey: 'favorites', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Disponibles', - filterKey: 'availability', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Non disponibles', - filterKey: 'non_availability', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - ], + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Temps d\'attente', + filterKey: 'waitTime', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Favoris', + filterKey: 'favorites', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Disponibles', + filterKey: 'availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Non disponibles', + filterKey: 'non_availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + ], + ), + ), + ); + } +} + +class SmallFilterWidget extends StatelessWidget { + final List? selectedFilters; + final Function(List)? onFiltersChanged; + + const SmallFilterWidget({ + Key? key, + this.selectedFilters, + this.onFiltersChanged, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Padding( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.08), + child: Container( + width: 400, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context).size.width * 0.02), + child: const Text( + 'Filtres :', + style: TextStyle( + fontSize: 18.0, + color: Colors.white, + ), + ), + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Temps d\'attente', + filterKey: 'waitTime', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Favoris', + filterKey: 'favorites', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 5, left: 70), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Disponibles', + filterKey: 'availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Non disponibles', + filterKey: 'non_availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + ], + ), + ), + ], + ), ), ); } diff --git a/dashboard/dashboard/lib/responsiveapp.dart b/dashboard/dashboard/lib/responsiveapp.dart deleted file mode 100644 index bfd58ea..0000000 --- a/dashboard/dashboard/lib/responsiveapp.dart +++ /dev/null @@ -1,173 +0,0 @@ -import 'package:flutter/material.dart'; - -void main() { - runApp(MyApp()); -} - -class MyApp extends StatelessWidget { - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Responsive App', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: MyHomePage(), - ); - } -} - -class MyHomePage extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Responsive App'), - ), - body: LayoutBuilder( - builder: (context, constraints) { - if (constraints.maxWidth > 1200) { - return _buildExtraLargeLayout(); - } else if (constraints.maxWidth > 850) { - return _buildLargeLayout(); - } else if (constraints.maxWidth > 400) { - return _buildMediumLayout(); - } else { - return _buildSmallLayout(); - } - }, - ), - ); - } - - Widget _buildExtraLargeLayout() { - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - color: Colors.blue, - height: 200, - child: Center( - child: Text('Element 1'), - ), - ), - ), - Expanded( - child: Container( - color: Colors.green, - height: 200, - child: Center( - child: Text('Element 2'), - ), - ), - ), - Expanded( - child: Container( - color: Colors.red, - height: 200, - child: Center( - child: Text('Element 3'), - ), - ), - ), - ], - ); - } - - Widget _buildLargeLayout() { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - color: Colors.blue, - height: 200, - child: Center( - child: Text('Element 1'), - ), - ), - ), - Expanded( - child: Container( - color: Colors.green, - height: 200, - child: Center( - child: Text('Element 2'), - ), - ), - ), - ], - ), - Container( - color: Colors.red, - height: 200, - child: Center( - child: Text('Element 3'), - ), - ), - ], - ); - } - - Widget _buildMediumLayout() { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - color: Colors.blue, - height: 200, - child: Center( - child: Text('Element 1'), - ), - ), - Container( - color: Colors.green, - height: 200, - child: Center( - child: Text('Element 2'), - ), - ), - Container( - color: Colors.red, - height: 200, - child: Center( - child: Text('Element 3'), - ), - ), - ], - ); - } - - Widget _buildSmallLayout() { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - color: Colors.blue, - height: 200, - child: Center( - child: Text('Element 1'), - ), - ), - Container( - color: Colors.red, - height: 200, - child: Center( - child: Text('Element 3'), - ), - ), - Container( - color: Colors.green, - height: 200, - child: Center( - child: Text('Element 2'), - ), - ), - ], - ); - } -} From 7d22a2ceeb21cdb99d7d20917a8f2f899a684b08 Mon Sep 17 00:00:00 2001 From: NovaSkyrim <100930779+NovaSkyrim@users.noreply.github.com> Date: Sat, 6 Apr 2024 22:10:30 +0200 Subject: [PATCH 3/5] firebase --- .../.firebase/hosting.YnVpbGRcd2Vi.cache | 81 +++++++++++++++++++ dashboard/dashboard/.firebaserc | 5 ++ dashboard/dashboard/firebase.json | 16 ++++ 3 files changed, 102 insertions(+) create mode 100644 dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache create mode 100644 dashboard/dashboard/.firebaserc create mode 100644 dashboard/dashboard/firebase.json diff --git a/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache b/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache new file mode 100644 index 0000000..90df817 --- /dev/null +++ b/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache @@ -0,0 +1,81 @@ +favicon.png,1712322043187,19880e004e8357a51f6a64f5d1fdc8828a6432fe9c781f8acb6b730eced2cd13 +flutter.js,1712251121298,f5a14edb95c81962fa23eaaae56e126c490103fa2f18b3ad825460cbdc0f9e4e +index.html,1712433437876,4946f409c88694a0d56fa46b267e486d3c8332ae995d5733c94b67444f94353c +manifest.json,1712322043193,930415d5788f8b0014b357b613160a4266d3994df7054fae4c894ff5e82a84a6 +version.json,1712433435612,ac3d0006b394cdf64c5a34203c96492f0267c157ab59047c2c7ceb64c5f92574 +flutter_service_worker.js,1712433440391,800d83cf6e764da827558879429a58b3062af7157a0b41e4b9d126732cb8cad5 +assets/AssetManifest.bin,1712433436048,ec5a7478686fb7912622d7d0cb80a59d3ff04320da781ddc7f37f8d3e9f7e70f +assets/AssetManifest.bin.json,1712433436048,4f80d8aa83e31f7510b635d1a09a62816c1bf86c7da8956a3d404b19300c20b1 +assets/FontManifest.json,1712433436048,e38b95988f5d060cf9b7ce97cb5ac9236d6f4cc04a11d69567df97b2b4cbc5e5 +assets/AssetManifest.json,1712433436048,182f4b6c3adbcd1ae50050e96654a31ead119dc0d12ec7a1bb3ccba88e6a7e41 +assets/assets/disneyland.json,1712322043099,e6a43798a4f8d0f5d47cdbc9dbb2be1ee8e09575cdadaa5d4ffa6d6a3c372520 +assets/assets/disney_studios.json,1712325875104,992dc23f49ab12a78dfeb21c3f7f58aa8ea07beafeac97bc42a3439f88b41bf8 +assets/assets/Dumbo.jpg,1712322043044,a6fae6b9f16f9285d8396de5be3e59af4ad6bbc1888f33ac2d3bbacbacfee13d +assets/assets/Logo.jpg,1712322043051,5ad2225c5bc4ba1267afd50b32353320d99495d10f07a90af6fedcac1d2db2a9 +assets/assets/Autopia.jpg,1712322043011,74e95c36b19a3a658e15e7509c84b7877dc95c5e78bb5befb05d3e2064fd100b +assets/assets/MeetSpiderman.jpg,1712322043054,b33cf5c2b44f375aa987932fcaa9450a5526a51b65ce625eeafc4501ea1b2c66 +assets/assets/MickeyPhilharMagic.jpg,1712322043055,68668552bd8f674885e690e9f20fc5249d6ceb5b7c41b9a3d82a2e6dd7c4c44a +assets/assets/PassageAladin.jpg,1712322043059,c6e26525192e9bba3e904db8a96357a4f21459feb34ae35ad39e26ac669acd29 +assets/assets/Pinocchio.jpg,1712322043067,d2a6b2a370348b509f43e8bfa013908ca157bfa1b77f6d6d42eef0f6b6f50b91 +assets/assets/CrushCoaster.jpg,1712322043034,77fea0f7f9ec0dfe858aa6cc479c8e8d669ef1535dcdcaff32592bd8a4c8682e +assets/assets/PeterPan.jpg,1712322043064,2c862907492ac0e9c314a4572c3d5a416c4a57d56c3f8d7731ede422850fc6ae +assets/assets/Titre.png,1712322043090,d583b42746ad89384a88e562d3adb5514d7f0b5dcac10548ab41a921fd558799 +assets/assets/HyperspaceMountain.jpg,1712322043047,8fb9bac13436aa74c08ca9824747fe6edbb5046e27da5c23bc2690042ae5c32c +assets/assets/Nautilus.jpg,1712322043056,6742554ad52954fffc658e0b887f6cbc56cdbb1ca3ac61e1686872312e340a6c +assets/assets/RCracer.jpg,1712322043073,eeb9b40e10a21ead2b339e366a56a3bd91da8b4587fa16e5ed8841fbe5e7087c +assets/assets/RencontreMickey.jpg,1712322043075,eb7b9fe51890db9cf89f7f013c40fced820829ac92ad69d13de80a4cdf528854 +assets/assets/Starport.jpg,1712322043083,1dd151832792167a6dbab7b0d90a9081118509402b188c0d8f93bef17aee9d79 +assets/fonts/MaterialIcons-Regular.otf,1712433437815,5c41be645038f16d99763f67d4e09462b8ba16321417ce8d78fe560c49b8754b +assets/assets/ArtDisney.jpg,1712322043009,4239fc3c104e265a2ff6129c2aa34fd0254cc1b3269e765eb527c4d6ad4a91e5 +assets/assets/AvengersAssemble.jpg,1712322043012,9639fd0e27193b0afdc1bef10cacc0af1f6c1e973d257c06638a832bf6dbf87b +assets/assets/BigThunderMountain.jpg,1712322043013,1ee55528dc73951f1f730e42da712dfafb582272fcb0f1d77e6d4862088470eb +assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1712433437812,42dfe961d1bdb0edb64562f74fb15f2f3dbe754bb2a3ad701ea5acbee95a3dd8 +assets/shaders/ink_sparkle.frag,1712433436243,591c7517d5cb43eb91ea451e0d3f9f585cbf8298cf6c46a9144b77cb0775a406 +assets/assets/Orbitron.jpg,1712322043058,4efac70c00432e9cc485f6aa9e376139c4b651a0e4934ae65a8f26b5e255c74b +assets/assets/ItsaSmallWorld.jpg,1712322043050,d3b790015d295d0f1f525fd9ddd4fd588cfef2fb89872398ee91caa4e4a44efb +assets/assets/TaniereDragon.jpg,1712322043084,c88b0724f8091d7856db6518748ae6f1d86e1486afdfd3a3b7b1fcc4d09482fd +assets/assets/CarsQuatreRouesRallye.jpg,1712322043022,c52831276a2cdc8170e2021f0ad293219ac5465f78e837c2ccbcf4f6cb561273 +assets/assets/CarrouselLancelot.jpg,1712322043021,62d51d233ce92a1279f26b0281904675b8fde0b03af82db03cf4f39b758b0210 +assets/assets/BlancheNeige.jpg,1712322043015,3212d2d887086b013c0409efcf3afbd869ce1270065265118df997ae95a3b965 +assets/assets/ZigZagSpin.jpg,1712322043097,090544d1879572528030e8d4b4f559373358b8ea443c8f64e6eb1c1c896db727 +assets/assets/IndianaJones.jpg,1712322043049,b9c51b01b84f6c042f8a27dbe3e80f731990319594c19c85706847975873e096 +assets/assets/PavillonPrincesses.jpg,1712322043061,bf6f26e9b343d3471a701548b2439de9ab39241b492057156b286d9313bb7b4e +assets/assets/PhantomManor.jpg,1712322043066,582761b31cf76467798063e8496b0dd390bd21a26552ea55513e06389420fc54 +assets/assets/Ratatouille.jpg,1712322043074,c549b8b14d34b260ad49952f974bbe201b2d582e1cf8bf03715270ca8f9cf7b2 +assets/assets/CarsRoadTrip.jpg,1712322043024,bb067de454f6fde3bd00c72b6bc4dc6b86fcceba430a4a4c43d3e9aac5504242 +assets/assets/FrontierlandPlayground.jpg,1712322043045,ce18e1c6681eed47eddad5716645ab3dc4ffedcb678c86dd7244f1964981dad8 +assets/assets/MainStreetVehicles.jpg,1712322043053,46bce9046eb08f290aad5803d80444082c3ead9dfdae8894bf000b3e8fc93bb7 +assets/assets/PirateCaribbean.jpg,1712322043068,cbf79fed93b477b0df073aa46142c7c2788967650849b380d0083d3a2aaa5730 +canvaskit/canvaskit.js,1712251121146,74085af9000ef48a5c5cb81313ee654ca4f6a8438643620415145274523a698f +assets/assets/StarTours.jpg,1712322043082,af7ccf539a9c501d899209876efb1938669ba931ac597556d4cc024326359a32 +assets/assets/PirateGalleon.jpg,1712322043070,348334ad31c2ed82fa3ff3a0af55a811f812170dc97482d65257f80f6301c630 +assets/assets/PiratesBeach.jpg,1712322043072,d681f5c2116bcce9273f73b8347bb21c06d41505b030301d3840b67c120eef64 +assets/assets/ToySoldiersParachuteDrop.jpg,1712322043092,296a953265e147d3419ed0b7239a25dd66facfbc0ad33cffcb52d311c3eb8ad5 +canvaskit/skwasm.worker.js,1712251121294,3fd50075667dba6e3822f8300deafbd0236ef4ddaa09228f2d07fefdfc22c905 +canvaskit/skwasm.js,1712251121249,ea7b5728dd099712b1ee59c47cadffab7891c3612f4567edc838fdeceded3560 +icons/Icon-192.png,1712322043189,5fd961c51d8eb53baacac01f8e53743a76f66a43390a11f5df042e8c618ad64a +icons/Icon-512.png,1712322043190,1de493563deb283e6ad70f0d5a89cfd61e37343df3b919c9862c5a41699ac5bc +assets/assets/RiverRogue.jpg,1712322043077,4f55c1030d66993693f6298df035e6d4499983e9a3098485fe8a2a33a11c9fea +icons/Icon-maskable-192.png,1712322043191,f7ac56197638aec92f195c5344d15395c2cbf8a5ae74e846c5b4156b64f05e38 +assets/assets/PaysContesFees.jpg,1712322043063,bc5ad2eb22700c0ed62d5c7453bc542210f6207e6d93fb518c2c406c3be2b112 +assets/assets/RustlerRoundup.jpg,1712322043078,21ae8abf6df5e662f9676c9223a42640beec0466b2a0eaedb95f59a1f4b32be3 +icons/Icon-maskable-512.png,1712322043192,ea58e5c49bc4dcdc5db0a9fe2f25b2a3152f85ef9094f0d020de0aa318451a1d +assets/assets/TapisVolants.jpg,1712322043085,162782c270f74534f7ed81e877ee2468282c6d783c6eb702a71240d5224d967e +assets/assets/CabaneRobinson.jpg,1712322043019,929e3c1e11e18fa3fb2417cd2a0a09dc131452612333a142411e0ec57fac5cbb +canvaskit/chromium/canvaskit.js,1712251121207,765f1da9cc7d4436b770238da368cde4175891ee3efe25b1d527f89085676c56 +assets/assets/TeaCups.jpg,1712322043087,706f513dbf8ff90819054d9062a91f0b8ee55c25bed9f7520917c3c000cd4a62 +assets/assets/BuzzLightyear.jpg,1712322043018,2910a93d7aa1ef51a9a6b3f06583ce3c8183ee9c8806f32233d8bb6f60a6b941 +assets/assets/SpidermanWeb.jpg,1712322043081,d2e2386fe42cd6db5e30852ec617f5291d6811b728213259debbdf5184036b16 +assets/NOTICES,1712433436049,376ae2854b73faea8c69c5a8983b8390a6409b7b346507257aff57d2fd3216da +canvaskit/canvaskit.js.symbols,1712251121153,128193b5dcf67bd21064f3a0e3144f40ca5d994a29f6548235ca5c14d3648a24 +assets/assets/TwilightZoneTowerofTerror.jpg,1712322043096,6484ed203a26b64469073f49462a85a0b4862b9f8ec0fdeacc6a0fd2ad9a9245 +assets/assets/AdventureIsle.jpg,1712322043001,b31da5c512d6b6ff88ed5caed835b90a567749699ec53123381f5660b279d5b1 +canvaskit/chromium/canvaskit.js.symbols,1712251121213,3d33b487a1e36b6145e0efe7a3f6f9826844301de61343a6761e22f3030ed3d9 +canvaskit/skwasm.js.symbols,1712251121266,f91e30b4c5f94a2c35f80b1c75d6db43d23602dbca69f243242b0b15d5b914d6 +assets/assets/AliceLabyrinth.jpg,1712322043007,db21614723efcc285577a56129a004d7cb37fbba00390f96e04f5e7a3950c9ba +assets/assets/DisneyRailroad.jpg,1712322043042,a0e3d19d7064a2546068f3acb5bbb9c91162fb2be5fd45c30b3b8f97b1d6a50e +main.dart.js,1712433434535,8955c353382994a51f9772abe6f5e368e96df4cb1729daeb3da27bf4b5dc1397 +assets/assets/CaseyJr.jpg,1712322043033,cc92df0c85afd247c24fc8893f7a5181476e09bdab8689b19a7e07d09dff77ab +canvaskit/skwasm.wasm,1712251121292,d03ac87729205c75879766cbcd225e669a9766552d3b64a08b255116e23f4671 +canvaskit/chromium/canvaskit.wasm,1712251121246,d39a626014748054f5ec9b684bfecf18dd19e640643e4ba5b98a21e62e4b61ab +canvaskit/canvaskit.wasm,1712251121205,146684bc3d008b6447f94d6fccd220e7952e0d91f16db5665787739cf78e2788 diff --git a/dashboard/dashboard/.firebaserc b/dashboard/dashboard/.firebaserc new file mode 100644 index 0000000..a3072c0 --- /dev/null +++ b/dashboard/dashboard/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "disneyline-tracker" + } +} diff --git a/dashboard/dashboard/firebase.json b/dashboard/dashboard/firebase.json new file mode 100644 index 0000000..6603732 --- /dev/null +++ b/dashboard/dashboard/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "build/web", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} From f16395416c1277644f2fd06b9b2bb1dfd4d3b148 Mon Sep 17 00:00:00 2001 From: NovaSkyrim <100930779+NovaSkyrim@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:38:48 +0200 Subject: [PATCH 4/5] Boutons fonctionnels --- dashboard/dashboard/.vscode/settings.json | 3 + dashboard/dashboard/android/app/build.gradle | 8 +- dashboard/dashboard/android/gradle.properties | 1 + dashboard/dashboard/lib/etoiles.dart | 4 +- dashboard/dashboard/lib/main.dart | 142 ++++++++++-------- 5 files changed, 92 insertions(+), 66 deletions(-) create mode 100644 dashboard/dashboard/.vscode/settings.json diff --git a/dashboard/dashboard/.vscode/settings.json b/dashboard/dashboard/.vscode/settings.json new file mode 100644 index 0000000..c5f3f6b --- /dev/null +++ b/dashboard/dashboard/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} \ No newline at end of file diff --git a/dashboard/dashboard/android/app/build.gradle b/dashboard/dashboard/android/app/build.gradle index ffdb4bf..d9bba1a 100644 --- a/dashboard/dashboard/android/app/build.gradle +++ b/dashboard/dashboard/android/app/build.gradle @@ -28,14 +28,16 @@ android { ndkVersion flutter.ndkVersion compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = '11' } + org.gradle.java.home = "C:\\Program Files\\Java\\jdk-11" + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/dashboard/dashboard/android/gradle.properties b/dashboard/dashboard/android/gradle.properties index 598d13f..301179b 100644 --- a/dashboard/dashboard/android/gradle.properties +++ b/dashboard/dashboard/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true +org.gradle.java.home=C:\\Program Files\\Java\\jdk-11 diff --git a/dashboard/dashboard/lib/etoiles.dart b/dashboard/dashboard/lib/etoiles.dart index 66fb9f4..05d6077 100644 --- a/dashboard/dashboard/lib/etoiles.dart +++ b/dashboard/dashboard/lib/etoiles.dart @@ -37,7 +37,7 @@ class StarPainter extends CustomPainter { List generateStars() { final random = Random(); List stars = []; - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 200; i++) { final x = random.nextDouble() * 2000; final y = random.nextDouble() * 1000; // ajustez la taille de l'écran selon vos besoins @@ -53,4 +53,4 @@ class Star { final double radius; Star({required this.x, required this.y, required this.radius}); -} \ No newline at end of file +} diff --git a/dashboard/dashboard/lib/main.dart b/dashboard/dashboard/lib/main.dart index df2dec2..085bb96 100644 --- a/dashboard/dashboard/lib/main.dart +++ b/dashboard/dashboard/lib/main.dart @@ -62,8 +62,8 @@ class _MyHomePageState extends State { final dynamoDB = DynamoDB( region: 'eu-north-1', credentials: AwsClientCredentials( - accessKey: ACCES_KEY, - secretKey: SECRET_KEY, + accessKey: accessKey, + secretKey: secretKey, )); disneylandAttractions = await attractionsAllLands(dynamoDB, 'BDDdisneyland'); @@ -140,7 +140,6 @@ class _MyHomePageState extends State { selectedFilters = updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent - print(selectedFilters); applyFilters(selectedFilters); }); }, @@ -743,7 +742,6 @@ class _MyHomePageState extends State { selectedFilters = updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent - print(selectedFilters); applyFilters(selectedFilters); }); }, @@ -1348,8 +1346,6 @@ class _MyHomePageState extends State { setState(() { selectedFilters = updatedFilters; // Mettre à jour la liste de filtres lorsqu'ils changent - - print(selectedFilters); applyFilters(selectedFilters); }); }, @@ -1935,6 +1931,35 @@ class _MyHomePageState extends State { setState(() { selectedView = view ?? 'Disneyland'; // Mise à jour de la vue sélectionnée if (view != null && !selectedFilters.contains(view)) { + List lands = [ + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', + 'Main Street U.S.A' + ]; + + List landsstudio = [ + 'Toon Studio', + 'Marvel Avengers Campus', + 'Production Courtyard', + ]; + + if (lands.contains(view)) { + for (var i in selectedFilters.toList()) { + if (lands.contains(i)) { + selectedFilters.remove(i); + } + } + } + if (landsstudio.contains(view)) { + for (var i in selectedFilters.toList()) { + if (landsstudio.contains(i)) { + selectedFilters.remove(i); + } + } + } + selectedFilters .add(view); // Ajout de l'élément sélectionné à la liste des filtres } @@ -1951,7 +1976,6 @@ class _MyHomePageState extends State { // Aucun filtre sélectionné, ne rien faire ou afficher tout return; } - // Appliquer chaque filtre sélectionné for (String filter in selectedFilters) { switch (filter) { @@ -1993,56 +2017,54 @@ class _MyHomePageState extends State { filteredDisneylandAttractions = filteredDisneylandAttractions .where((attraction) => attraction.secteur == 'Main Street U.S.A') .toList(); - selectedFilters.remove('Main Street U.S.A'); break; case 'Frontierland': filteredDisneylandAttractions = filteredDisneylandAttractions .where((attraction) => attraction.secteur == 'Frontierland') .toList(); - selectedFilters.remove('Frontierland'); break; case 'Adventureland': filteredDisneylandAttractions = filteredDisneylandAttractions .where((attraction) => attraction.secteur == 'Adventureland') .toList(); - selectedFilters.remove('Adventureland'); break; case 'Fantasyland': filteredDisneylandAttractions = filteredDisneylandAttractions .where((attraction) => attraction.secteur == 'Fantasyland') .toList(); - selectedFilters.remove('Fantasyland'); + break; case 'Discoveryland': filteredDisneylandAttractions = filteredDisneylandAttractions .where((attraction) => attraction.secteur == 'Discoveryland') .toList(); - selectedFilters.remove('Discoveryland'); + break; // filtrage des land par Disney Studio case 'Toon Studio': filteredStudioAttractions = filteredStudioAttractions .where((attraction) => attraction.secteur == 'Toon Studio') .toList(); - selectedFilters.remove('Toon Studio'); + break; case 'Marvel Avengers Campus': filteredStudioAttractions = filteredStudioAttractions .where((attraction) => attraction.secteur == 'Marvel Avengers Campus') .toList(); - selectedFilters.remove('Marvel Avengers Campus'); + break; case 'Production Courtyard': filteredStudioAttractions = filteredStudioAttractions .where( (attraction) => attraction.secteur == 'Production Courtyard') .toList(); - selectedFilters.remove('Production Courtyard'); + break; } + print(selectedFilters); } } } @@ -2057,51 +2079,49 @@ class FilterWidget extends StatelessWidget { Widget build(BuildContext context) { return Padding( padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.08), - child: Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context).size.width * 0.07), - child: const Text( - 'Filtres :', - style: TextStyle( - fontSize: 24.0, - color: Colors.white, - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: + EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.07), + child: const Text( + 'Filtres :', + style: TextStyle( + fontSize: 24.0, + color: Colors.white, ), ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Temps d\'attente', - filterKey: 'waitTime', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Favoris', - filterKey: 'favorites', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Disponibles', - filterKey: 'availability', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - SizedBox(width: MediaQuery.of(context).size.width * 0.004), - FilterButton( - title: 'Non disponibles', - filterKey: 'non_availability', - selectedFilters: selectedFilters, - onFiltersChanged: onFiltersChanged, - ), - ], - ), + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Temps d\'attente', + filterKey: 'waitTime', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Favoris', + filterKey: 'favorites', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Disponibles', + filterKey: 'availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + SizedBox(width: MediaQuery.of(context).size.width * 0.004), + FilterButton( + title: 'Non disponibles', + filterKey: 'non_availability', + selectedFilters: selectedFilters, + onFiltersChanged: onFiltersChanged, + ), + ], ), ); } @@ -2112,16 +2132,16 @@ class SmallFilterWidget extends StatelessWidget { final Function(List)? onFiltersChanged; const SmallFilterWidget({ - Key? key, + super.key, this.selectedFilters, this.onFiltersChanged, - }) : super(key: key); + }); @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.08), - child: Container( + child: SizedBox( width: 400, child: Column( children: [ From 2dae945b1dcc99d400c890566c387922f9220df6 Mon Sep 17 00:00:00 2001 From: NovaSkyrim <100930779+NovaSkyrim@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:32:42 +0200 Subject: [PATCH 5/5] smallwidget update --- .../.firebase/hosting.YnVpbGRcd2Vi.cache | 104 +- dashboard/dashboard/.vscode/settings.json | 3 +- dashboard/dashboard/android/app/build.gradle | 6 +- dashboard/dashboard/lib/main.dart | 901 +++++++++--------- 4 files changed, 508 insertions(+), 506 deletions(-) diff --git a/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache b/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache index 90df817..c62eca8 100644 --- a/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache +++ b/dashboard/dashboard/.firebase/hosting.YnVpbGRcd2Vi.cache @@ -1,81 +1,81 @@ favicon.png,1712322043187,19880e004e8357a51f6a64f5d1fdc8828a6432fe9c781f8acb6b730eced2cd13 flutter.js,1712251121298,f5a14edb95c81962fa23eaaae56e126c490103fa2f18b3ad825460cbdc0f9e4e +flutter_service_worker.js,1712433440391,800d83cf6e764da827558879429a58b3062af7157a0b41e4b9d126732cb8cad5 index.html,1712433437876,4946f409c88694a0d56fa46b267e486d3c8332ae995d5733c94b67444f94353c +main.dart.js,1712433434535,8955c353382994a51f9772abe6f5e368e96df4cb1729daeb3da27bf4b5dc1397 manifest.json,1712322043193,930415d5788f8b0014b357b613160a4266d3994df7054fae4c894ff5e82a84a6 version.json,1712433435612,ac3d0006b394cdf64c5a34203c96492f0267c157ab59047c2c7ceb64c5f92574 -flutter_service_worker.js,1712433440391,800d83cf6e764da827558879429a58b3062af7157a0b41e4b9d126732cb8cad5 assets/AssetManifest.bin,1712433436048,ec5a7478686fb7912622d7d0cb80a59d3ff04320da781ddc7f37f8d3e9f7e70f assets/AssetManifest.bin.json,1712433436048,4f80d8aa83e31f7510b635d1a09a62816c1bf86c7da8956a3d404b19300c20b1 -assets/FontManifest.json,1712433436048,e38b95988f5d060cf9b7ce97cb5ac9236d6f4cc04a11d69567df97b2b4cbc5e5 assets/AssetManifest.json,1712433436048,182f4b6c3adbcd1ae50050e96654a31ead119dc0d12ec7a1bb3ccba88e6a7e41 +assets/FontManifest.json,1712433436048,e38b95988f5d060cf9b7ce97cb5ac9236d6f4cc04a11d69567df97b2b4cbc5e5 +assets/NOTICES,1712433436049,376ae2854b73faea8c69c5a8983b8390a6409b7b346507257aff57d2fd3216da +assets/assets/AdventureIsle.jpg,1712322043001,b31da5c512d6b6ff88ed5caed835b90a567749699ec53123381f5660b279d5b1 +assets/assets/AliceLabyrinth.jpg,1712322043007,db21614723efcc285577a56129a004d7cb37fbba00390f96e04f5e7a3950c9ba +assets/assets/ArtDisney.jpg,1712322043009,4239fc3c104e265a2ff6129c2aa34fd0254cc1b3269e765eb527c4d6ad4a91e5 +assets/assets/Autopia.jpg,1712322043011,74e95c36b19a3a658e15e7509c84b7877dc95c5e78bb5befb05d3e2064fd100b +assets/assets/AvengersAssemble.jpg,1712322043012,9639fd0e27193b0afdc1bef10cacc0af1f6c1e973d257c06638a832bf6dbf87b +assets/assets/BigThunderMountain.jpg,1712322043013,1ee55528dc73951f1f730e42da712dfafb582272fcb0f1d77e6d4862088470eb +assets/assets/BlancheNeige.jpg,1712322043015,3212d2d887086b013c0409efcf3afbd869ce1270065265118df997ae95a3b965 +assets/assets/BuzzLightyear.jpg,1712322043018,2910a93d7aa1ef51a9a6b3f06583ce3c8183ee9c8806f32233d8bb6f60a6b941 +assets/assets/CabaneRobinson.jpg,1712322043019,929e3c1e11e18fa3fb2417cd2a0a09dc131452612333a142411e0ec57fac5cbb +assets/assets/CarrouselLancelot.jpg,1712322043021,62d51d233ce92a1279f26b0281904675b8fde0b03af82db03cf4f39b758b0210 +assets/assets/CarsQuatreRouesRallye.jpg,1712322043022,c52831276a2cdc8170e2021f0ad293219ac5465f78e837c2ccbcf4f6cb561273 +assets/assets/CarsRoadTrip.jpg,1712322043024,bb067de454f6fde3bd00c72b6bc4dc6b86fcceba430a4a4c43d3e9aac5504242 +assets/assets/CaseyJr.jpg,1712322043033,cc92df0c85afd247c24fc8893f7a5181476e09bdab8689b19a7e07d09dff77ab +assets/assets/CrushCoaster.jpg,1712322043034,77fea0f7f9ec0dfe858aa6cc479c8e8d669ef1535dcdcaff32592bd8a4c8682e assets/assets/disneyland.json,1712322043099,e6a43798a4f8d0f5d47cdbc9dbb2be1ee8e09575cdadaa5d4ffa6d6a3c372520 +assets/assets/DisneyRailroad.jpg,1712322043042,a0e3d19d7064a2546068f3acb5bbb9c91162fb2be5fd45c30b3b8f97b1d6a50e assets/assets/disney_studios.json,1712325875104,992dc23f49ab12a78dfeb21c3f7f58aa8ea07beafeac97bc42a3439f88b41bf8 assets/assets/Dumbo.jpg,1712322043044,a6fae6b9f16f9285d8396de5be3e59af4ad6bbc1888f33ac2d3bbacbacfee13d +assets/assets/FrontierlandPlayground.jpg,1712322043045,ce18e1c6681eed47eddad5716645ab3dc4ffedcb678c86dd7244f1964981dad8 +assets/assets/HyperspaceMountain.jpg,1712322043047,8fb9bac13436aa74c08ca9824747fe6edbb5046e27da5c23bc2690042ae5c32c +assets/assets/IndianaJones.jpg,1712322043049,b9c51b01b84f6c042f8a27dbe3e80f731990319594c19c85706847975873e096 +assets/assets/ItsaSmallWorld.jpg,1712322043050,d3b790015d295d0f1f525fd9ddd4fd588cfef2fb89872398ee91caa4e4a44efb assets/assets/Logo.jpg,1712322043051,5ad2225c5bc4ba1267afd50b32353320d99495d10f07a90af6fedcac1d2db2a9 -assets/assets/Autopia.jpg,1712322043011,74e95c36b19a3a658e15e7509c84b7877dc95c5e78bb5befb05d3e2064fd100b +assets/assets/MainStreetVehicles.jpg,1712322043053,46bce9046eb08f290aad5803d80444082c3ead9dfdae8894bf000b3e8fc93bb7 assets/assets/MeetSpiderman.jpg,1712322043054,b33cf5c2b44f375aa987932fcaa9450a5526a51b65ce625eeafc4501ea1b2c66 assets/assets/MickeyPhilharMagic.jpg,1712322043055,68668552bd8f674885e690e9f20fc5249d6ceb5b7c41b9a3d82a2e6dd7c4c44a -assets/assets/PassageAladin.jpg,1712322043059,c6e26525192e9bba3e904db8a96357a4f21459feb34ae35ad39e26ac669acd29 -assets/assets/Pinocchio.jpg,1712322043067,d2a6b2a370348b509f43e8bfa013908ca157bfa1b77f6d6d42eef0f6b6f50b91 -assets/assets/CrushCoaster.jpg,1712322043034,77fea0f7f9ec0dfe858aa6cc479c8e8d669ef1535dcdcaff32592bd8a4c8682e -assets/assets/PeterPan.jpg,1712322043064,2c862907492ac0e9c314a4572c3d5a416c4a57d56c3f8d7731ede422850fc6ae -assets/assets/Titre.png,1712322043090,d583b42746ad89384a88e562d3adb5514d7f0b5dcac10548ab41a921fd558799 -assets/assets/HyperspaceMountain.jpg,1712322043047,8fb9bac13436aa74c08ca9824747fe6edbb5046e27da5c23bc2690042ae5c32c assets/assets/Nautilus.jpg,1712322043056,6742554ad52954fffc658e0b887f6cbc56cdbb1ca3ac61e1686872312e340a6c -assets/assets/RCracer.jpg,1712322043073,eeb9b40e10a21ead2b339e366a56a3bd91da8b4587fa16e5ed8841fbe5e7087c -assets/assets/RencontreMickey.jpg,1712322043075,eb7b9fe51890db9cf89f7f013c40fced820829ac92ad69d13de80a4cdf528854 -assets/assets/Starport.jpg,1712322043083,1dd151832792167a6dbab7b0d90a9081118509402b188c0d8f93bef17aee9d79 -assets/fonts/MaterialIcons-Regular.otf,1712433437815,5c41be645038f16d99763f67d4e09462b8ba16321417ce8d78fe560c49b8754b -assets/assets/ArtDisney.jpg,1712322043009,4239fc3c104e265a2ff6129c2aa34fd0254cc1b3269e765eb527c4d6ad4a91e5 -assets/assets/AvengersAssemble.jpg,1712322043012,9639fd0e27193b0afdc1bef10cacc0af1f6c1e973d257c06638a832bf6dbf87b -assets/assets/BigThunderMountain.jpg,1712322043013,1ee55528dc73951f1f730e42da712dfafb582272fcb0f1d77e6d4862088470eb -assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1712433437812,42dfe961d1bdb0edb64562f74fb15f2f3dbe754bb2a3ad701ea5acbee95a3dd8 -assets/shaders/ink_sparkle.frag,1712433436243,591c7517d5cb43eb91ea451e0d3f9f585cbf8298cf6c46a9144b77cb0775a406 assets/assets/Orbitron.jpg,1712322043058,4efac70c00432e9cc485f6aa9e376139c4b651a0e4934ae65a8f26b5e255c74b -assets/assets/ItsaSmallWorld.jpg,1712322043050,d3b790015d295d0f1f525fd9ddd4fd588cfef2fb89872398ee91caa4e4a44efb -assets/assets/TaniereDragon.jpg,1712322043084,c88b0724f8091d7856db6518748ae6f1d86e1486afdfd3a3b7b1fcc4d09482fd -assets/assets/CarsQuatreRouesRallye.jpg,1712322043022,c52831276a2cdc8170e2021f0ad293219ac5465f78e837c2ccbcf4f6cb561273 -assets/assets/CarrouselLancelot.jpg,1712322043021,62d51d233ce92a1279f26b0281904675b8fde0b03af82db03cf4f39b758b0210 -assets/assets/BlancheNeige.jpg,1712322043015,3212d2d887086b013c0409efcf3afbd869ce1270065265118df997ae95a3b965 -assets/assets/ZigZagSpin.jpg,1712322043097,090544d1879572528030e8d4b4f559373358b8ea443c8f64e6eb1c1c896db727 -assets/assets/IndianaJones.jpg,1712322043049,b9c51b01b84f6c042f8a27dbe3e80f731990319594c19c85706847975873e096 +assets/assets/PassageAladin.jpg,1712322043059,c6e26525192e9bba3e904db8a96357a4f21459feb34ae35ad39e26ac669acd29 assets/assets/PavillonPrincesses.jpg,1712322043061,bf6f26e9b343d3471a701548b2439de9ab39241b492057156b286d9313bb7b4e +assets/assets/PaysContesFees.jpg,1712322043063,bc5ad2eb22700c0ed62d5c7453bc542210f6207e6d93fb518c2c406c3be2b112 +assets/assets/PeterPan.jpg,1712322043064,2c862907492ac0e9c314a4572c3d5a416c4a57d56c3f8d7731ede422850fc6ae assets/assets/PhantomManor.jpg,1712322043066,582761b31cf76467798063e8496b0dd390bd21a26552ea55513e06389420fc54 -assets/assets/Ratatouille.jpg,1712322043074,c549b8b14d34b260ad49952f974bbe201b2d582e1cf8bf03715270ca8f9cf7b2 -assets/assets/CarsRoadTrip.jpg,1712322043024,bb067de454f6fde3bd00c72b6bc4dc6b86fcceba430a4a4c43d3e9aac5504242 -assets/assets/FrontierlandPlayground.jpg,1712322043045,ce18e1c6681eed47eddad5716645ab3dc4ffedcb678c86dd7244f1964981dad8 -assets/assets/MainStreetVehicles.jpg,1712322043053,46bce9046eb08f290aad5803d80444082c3ead9dfdae8894bf000b3e8fc93bb7 +assets/assets/Pinocchio.jpg,1712322043067,d2a6b2a370348b509f43e8bfa013908ca157bfa1b77f6d6d42eef0f6b6f50b91 assets/assets/PirateCaribbean.jpg,1712322043068,cbf79fed93b477b0df073aa46142c7c2788967650849b380d0083d3a2aaa5730 -canvaskit/canvaskit.js,1712251121146,74085af9000ef48a5c5cb81313ee654ca4f6a8438643620415145274523a698f -assets/assets/StarTours.jpg,1712322043082,af7ccf539a9c501d899209876efb1938669ba931ac597556d4cc024326359a32 assets/assets/PirateGalleon.jpg,1712322043070,348334ad31c2ed82fa3ff3a0af55a811f812170dc97482d65257f80f6301c630 assets/assets/PiratesBeach.jpg,1712322043072,d681f5c2116bcce9273f73b8347bb21c06d41505b030301d3840b67c120eef64 -assets/assets/ToySoldiersParachuteDrop.jpg,1712322043092,296a953265e147d3419ed0b7239a25dd66facfbc0ad33cffcb52d311c3eb8ad5 -canvaskit/skwasm.worker.js,1712251121294,3fd50075667dba6e3822f8300deafbd0236ef4ddaa09228f2d07fefdfc22c905 -canvaskit/skwasm.js,1712251121249,ea7b5728dd099712b1ee59c47cadffab7891c3612f4567edc838fdeceded3560 -icons/Icon-192.png,1712322043189,5fd961c51d8eb53baacac01f8e53743a76f66a43390a11f5df042e8c618ad64a -icons/Icon-512.png,1712322043190,1de493563deb283e6ad70f0d5a89cfd61e37343df3b919c9862c5a41699ac5bc +assets/assets/Ratatouille.jpg,1712322043074,c549b8b14d34b260ad49952f974bbe201b2d582e1cf8bf03715270ca8f9cf7b2 +assets/assets/RCracer.jpg,1712322043073,eeb9b40e10a21ead2b339e366a56a3bd91da8b4587fa16e5ed8841fbe5e7087c +assets/assets/RencontreMickey.jpg,1712322043075,eb7b9fe51890db9cf89f7f013c40fced820829ac92ad69d13de80a4cdf528854 assets/assets/RiverRogue.jpg,1712322043077,4f55c1030d66993693f6298df035e6d4499983e9a3098485fe8a2a33a11c9fea -icons/Icon-maskable-192.png,1712322043191,f7ac56197638aec92f195c5344d15395c2cbf8a5ae74e846c5b4156b64f05e38 -assets/assets/PaysContesFees.jpg,1712322043063,bc5ad2eb22700c0ed62d5c7453bc542210f6207e6d93fb518c2c406c3be2b112 assets/assets/RustlerRoundup.jpg,1712322043078,21ae8abf6df5e662f9676c9223a42640beec0466b2a0eaedb95f59a1f4b32be3 -icons/Icon-maskable-512.png,1712322043192,ea58e5c49bc4dcdc5db0a9fe2f25b2a3152f85ef9094f0d020de0aa318451a1d +assets/assets/SpidermanWeb.jpg,1712322043081,d2e2386fe42cd6db5e30852ec617f5291d6811b728213259debbdf5184036b16 +assets/assets/Starport.jpg,1712322043083,1dd151832792167a6dbab7b0d90a9081118509402b188c0d8f93bef17aee9d79 +assets/assets/StarTours.jpg,1712322043082,af7ccf539a9c501d899209876efb1938669ba931ac597556d4cc024326359a32 +assets/assets/TaniereDragon.jpg,1712322043084,c88b0724f8091d7856db6518748ae6f1d86e1486afdfd3a3b7b1fcc4d09482fd assets/assets/TapisVolants.jpg,1712322043085,162782c270f74534f7ed81e877ee2468282c6d783c6eb702a71240d5224d967e -assets/assets/CabaneRobinson.jpg,1712322043019,929e3c1e11e18fa3fb2417cd2a0a09dc131452612333a142411e0ec57fac5cbb -canvaskit/chromium/canvaskit.js,1712251121207,765f1da9cc7d4436b770238da368cde4175891ee3efe25b1d527f89085676c56 assets/assets/TeaCups.jpg,1712322043087,706f513dbf8ff90819054d9062a91f0b8ee55c25bed9f7520917c3c000cd4a62 -assets/assets/BuzzLightyear.jpg,1712322043018,2910a93d7aa1ef51a9a6b3f06583ce3c8183ee9c8806f32233d8bb6f60a6b941 -assets/assets/SpidermanWeb.jpg,1712322043081,d2e2386fe42cd6db5e30852ec617f5291d6811b728213259debbdf5184036b16 -assets/NOTICES,1712433436049,376ae2854b73faea8c69c5a8983b8390a6409b7b346507257aff57d2fd3216da -canvaskit/canvaskit.js.symbols,1712251121153,128193b5dcf67bd21064f3a0e3144f40ca5d994a29f6548235ca5c14d3648a24 +assets/assets/Titre.png,1712322043090,d583b42746ad89384a88e562d3adb5514d7f0b5dcac10548ab41a921fd558799 +assets/assets/ToySoldiersParachuteDrop.jpg,1712322043092,296a953265e147d3419ed0b7239a25dd66facfbc0ad33cffcb52d311c3eb8ad5 assets/assets/TwilightZoneTowerofTerror.jpg,1712322043096,6484ed203a26b64469073f49462a85a0b4862b9f8ec0fdeacc6a0fd2ad9a9245 -assets/assets/AdventureIsle.jpg,1712322043001,b31da5c512d6b6ff88ed5caed835b90a567749699ec53123381f5660b279d5b1 -canvaskit/chromium/canvaskit.js.symbols,1712251121213,3d33b487a1e36b6145e0efe7a3f6f9826844301de61343a6761e22f3030ed3d9 +assets/assets/ZigZagSpin.jpg,1712322043097,090544d1879572528030e8d4b4f559373358b8ea443c8f64e6eb1c1c896db727 +assets/fonts/MaterialIcons-Regular.otf,1712433437815,5c41be645038f16d99763f67d4e09462b8ba16321417ce8d78fe560c49b8754b +assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1712433437812,42dfe961d1bdb0edb64562f74fb15f2f3dbe754bb2a3ad701ea5acbee95a3dd8 +assets/shaders/ink_sparkle.frag,1712433436243,591c7517d5cb43eb91ea451e0d3f9f585cbf8298cf6c46a9144b77cb0775a406 +canvaskit/canvaskit.js,1712251121146,74085af9000ef48a5c5cb81313ee654ca4f6a8438643620415145274523a698f +canvaskit/canvaskit.js.symbols,1712251121153,128193b5dcf67bd21064f3a0e3144f40ca5d994a29f6548235ca5c14d3648a24 +canvaskit/canvaskit.wasm,1712251121205,146684bc3d008b6447f94d6fccd220e7952e0d91f16db5665787739cf78e2788 +canvaskit/skwasm.js,1712251121249,ea7b5728dd099712b1ee59c47cadffab7891c3612f4567edc838fdeceded3560 canvaskit/skwasm.js.symbols,1712251121266,f91e30b4c5f94a2c35f80b1c75d6db43d23602dbca69f243242b0b15d5b914d6 -assets/assets/AliceLabyrinth.jpg,1712322043007,db21614723efcc285577a56129a004d7cb37fbba00390f96e04f5e7a3950c9ba -assets/assets/DisneyRailroad.jpg,1712322043042,a0e3d19d7064a2546068f3acb5bbb9c91162fb2be5fd45c30b3b8f97b1d6a50e -main.dart.js,1712433434535,8955c353382994a51f9772abe6f5e368e96df4cb1729daeb3da27bf4b5dc1397 -assets/assets/CaseyJr.jpg,1712322043033,cc92df0c85afd247c24fc8893f7a5181476e09bdab8689b19a7e07d09dff77ab canvaskit/skwasm.wasm,1712251121292,d03ac87729205c75879766cbcd225e669a9766552d3b64a08b255116e23f4671 +canvaskit/skwasm.worker.js,1712251121294,3fd50075667dba6e3822f8300deafbd0236ef4ddaa09228f2d07fefdfc22c905 +canvaskit/chromium/canvaskit.js,1712251121207,765f1da9cc7d4436b770238da368cde4175891ee3efe25b1d527f89085676c56 +canvaskit/chromium/canvaskit.js.symbols,1712251121213,3d33b487a1e36b6145e0efe7a3f6f9826844301de61343a6761e22f3030ed3d9 canvaskit/chromium/canvaskit.wasm,1712251121246,d39a626014748054f5ec9b684bfecf18dd19e640643e4ba5b98a21e62e4b61ab -canvaskit/canvaskit.wasm,1712251121205,146684bc3d008b6447f94d6fccd220e7952e0d91f16db5665787739cf78e2788 +icons/Icon-192.png,1712322043189,5fd961c51d8eb53baacac01f8e53743a76f66a43390a11f5df042e8c618ad64a +icons/Icon-512.png,1712322043190,1de493563deb283e6ad70f0d5a89cfd61e37343df3b919c9862c5a41699ac5bc +icons/Icon-maskable-192.png,1712322043191,f7ac56197638aec92f195c5344d15395c2cbf8a5ae74e846c5b4156b64f05e38 +icons/Icon-maskable-512.png,1712322043192,ea58e5c49bc4dcdc5db0a9fe2f25b2a3152f85ef9094f0d020de0aa318451a1d diff --git a/dashboard/dashboard/.vscode/settings.json b/dashboard/dashboard/.vscode/settings.json index c5f3f6b..0be1c0c 100644 --- a/dashboard/dashboard/.vscode/settings.json +++ b/dashboard/dashboard/.vscode/settings.json @@ -1,3 +1,4 @@ { - "java.configuration.updateBuildConfiguration": "interactive" + "java.configuration.updateBuildConfiguration": "automatic", + "java.compile.nullAnalysis.mode": "automatic" } \ No newline at end of file diff --git a/dashboard/dashboard/android/app/build.gradle b/dashboard/dashboard/android/app/build.gradle index d9bba1a..a359d59 100644 --- a/dashboard/dashboard/android/app/build.gradle +++ b/dashboard/dashboard/android/app/build.gradle @@ -36,7 +36,11 @@ android { jvmTarget = '11' } - org.gradle.java.home = "C:\\Program Files\\Java\\jdk-11" + if (System.getenv("JAVA_HOME") != null) { + // Set the Java home path for Gradle if JAVA_HOME is defined + System.setProperty("org.gradle.java.home", System.getenv("JAVA_HOME")) + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' diff --git a/dashboard/dashboard/lib/main.dart b/dashboard/dashboard/lib/main.dart index 085bb96..64219fe 100644 --- a/dashboard/dashboard/lib/main.dart +++ b/dashboard/dashboard/lib/main.dart @@ -1325,8 +1325,7 @@ class _MyHomePageState extends State { child: Column( children: [ Container( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.05), + padding: const EdgeInsets.only(top: 50), decoration: BoxDecoration( borderRadius: BorderRadius.circular(20.0), // Arrondir les bords ), @@ -1334,8 +1333,11 @@ class _MyHomePageState extends State { borderRadius: BorderRadius.circular(20.0), child: Image.asset( 'assets/Titre.png', - width: 450, // Ajustez la largeur du logo - height: 60, // Ajustez la hauteur du logo + width: MediaQuery.of(context).size.width * + 0.8, // Ajustez la largeur du logo + height: MediaQuery.of(context).size.width * + 0.8 / + 8.75, // Ajustez la hauteur du logo fit: BoxFit.fill, ), ), @@ -1351,27 +1353,228 @@ class _MyHomePageState extends State { }, ), SizedBox( - // PROBLEME - height: 1000, - child: Expanded( - child: Column( - children: [ - SizedBox( - height: 500, - width: MediaQuery.of(context).size.width, - child: Align( - alignment: Alignment.topLeft, - // ignore: unnecessary_null_comparison - child: disneylandAttractions == null - ? const CircularProgressIndicator() - : Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * - 0.04), - child: Container( - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * - 0.01), + height: 1700, + child: Column( + // PROBLEME + children: [ + Column( + children: [ + SizedBox( + height: 540, + width: MediaQuery.of(context).size.width, + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: disneylandAttractions == null + ? const CircularProgressIndicator() + : Padding( + padding: const EdgeInsets.only(top: 40), + child: Container( + padding: const EdgeInsets.all(10), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + const Text( + 'Disneyland', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 25.0, + color: Colors.white, + ), + ), + PopupMenuButton( + initialValue: selectedView, + onSelected: _onViewChanged, + itemBuilder: + (BuildContext context) { + return [ + 'Toutes les attractions', + 'Main Street U.S.A', + 'Frontierland', + 'Adventureland', + 'Fantasyland', + 'Discoveryland', + ].map((String view) { + return PopupMenuItem( + value: view, + child: Text(view), + ); + }).toList(); + }, + child: Padding( + padding: EdgeInsets.only( + left: MediaQuery.of(context) + .size + .width * + 0.004), + child: const Icon( + Icons.arrow_drop_down, + color: Colors + .white, // Définit la couleur de l'icône en blanc + ), + ), + ), + ], + ), + Padding( + padding: + const EdgeInsets.only(top: 20), + child: SizedBox( + height: 420, + width: screenSize.width * 0.72, + child: ListView.builder( + itemCount: + filteredDisneylandAttractions + .length, + itemBuilder: (context, index) { + var attraction = + filteredDisneylandAttractions[ + index]; + return Container( + margin: const EdgeInsets.only( + bottom: 16), + child: Card( + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 20.0), + ), + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.008), + leading: ClipRRect( + borderRadius: + BorderRadius + .circular(10.0), + child: Image.asset( + attraction.photoUrl, + width: + screenSize.width * + 0.10, + height: 60, + fit: BoxFit.cover, + ), + ), + title: Text( + attraction.name, + overflow: TextOverflow + .ellipsis, + style: const TextStyle( + color: Colors.black, + ), + ), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight + .bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight + .bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( + attraction + .isAvailable + ? Icons + .check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction + .isFavorite + ? Icons.star + : Icons + .star_border, + color: + Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], + ), + ), + ), + ); + }, + ), + ), + ), + ], + ), + ), + ), + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width, + height: 520, + child: Align( + alignment: Alignment.topLeft, + // ignore: unnecessary_null_comparison + child: studioAttractions == null + ? const CircularProgressIndicator() + : Container( + padding: const EdgeInsets.all(16), child: Column( children: [ Row( @@ -1379,11 +1582,11 @@ class _MyHomePageState extends State { MainAxisAlignment.center, children: [ const Text( - 'Disneyland', + 'Disney Studios', style: TextStyle( fontWeight: FontWeight.bold, - fontSize: 25.0, color: Colors.white, + fontSize: 25.0, ), ), PopupMenuButton( @@ -1393,11 +1596,9 @@ class _MyHomePageState extends State { (BuildContext context) { return [ 'Toutes les attractions', - 'Main Street U.S.A', - 'Frontierland', - 'Adventureland', - 'Fantasyland', - 'Discoveryland', + 'Marvel Avengers Campus', + 'Production Courtyard', + 'Toon Studio', ].map((String view) { return PopupMenuItem( value: view, @@ -1405,6 +1606,7 @@ class _MyHomePageState extends State { ); }).toList(); }, + offset: const Offset(200, 0), child: Padding( padding: EdgeInsets.only( left: MediaQuery.of(context) @@ -1420,418 +1622,56 @@ class _MyHomePageState extends State { ), ], ), - SizedBox( - height: 400, - width: screenSize.width * 0.72, - child: ListView.builder( - itemCount: - filteredDisneylandAttractions - .length, - itemBuilder: (context, index) { - var attraction = - filteredDisneylandAttractions[ - index]; - return Container( - margin: EdgeInsets.only( - bottom: MediaQuery.of(context) - .size - .height * - 0.016), - child: Card( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular( - 20.0), - ), - elevation: 5, - color: Colors.white, - child: ListTile( - contentPadding: - EdgeInsets.symmetric( - horizontal: - MediaQuery.of( - context) - .size - .width * - 0.008), - leading: ClipRRect( + Padding( + padding: const EdgeInsets.only(top: 20), + child: SizedBox( + height: 420, + width: screenSize.width * 0.72, + child: ListView.builder( + itemCount: filteredStudioAttractions + .length, + itemBuilder: (context, index) { + var attraction = + filteredStudioAttractions[ + index]; + return Container( + margin: const EdgeInsets.only( + bottom: 16), + child: Card( + shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( - 10.0), - child: Image.asset( - attraction.photoUrl, - width: screenSize.width * - 0.10, - height: - screenSize.height * - 0.057, - fit: BoxFit.cover, - ), - ), - title: Text( - attraction.name, - overflow: - TextOverflow.ellipsis, - style: const TextStyle( - color: Colors.black, - ), - ), - subtitle: Text.rich( - TextSpan( - text: - 'Temps d\'attente: ', - style: const TextStyle( - fontWeight: - FontWeight.bold), - children: [ - TextSpan( - text: - '${attraction.waitTime} minutes', - style: TextStyle( - fontWeight: - FontWeight.bold, - color: getColorForWaitTime( - attraction - .waitTime), - ), - ), - ], - ), + 20.0), ), - trailing: Row( - mainAxisSize: - MainAxisSize.min, - children: [ - Icon( - attraction.isAvailable - ? Icons.check_circle - : Icons.cancel, - color: attraction - .isAvailable - ? Colors.green - : Colors.red, + elevation: 5, + color: Colors.white, + child: ListTile( + contentPadding: + EdgeInsets.symmetric( + horizontal: + MediaQuery.of( + context) + .size + .width * + 0.0083), + leading: ClipRRect( + borderRadius: + BorderRadius.circular( + 10.0), + child: Image.asset( + attraction.photoUrl, + width: + screenSize.width * + 0.10, + height: 57, + fit: BoxFit.cover, ), - SizedBox( - width: MediaQuery.of( - context) - .size - .width * - 0.004, - ), - IconButton( - icon: Icon( - attraction.isFavorite - ? Icons.star - : Icons - .star_border, - color: Colors.black, - ), - onPressed: () { - setState(() { - attraction - .isFavorite = - !attraction - .isFavorite; - if (attraction - .isFavorite) { - favoriteAttractions - .add( - attraction); - } else { - favoriteAttractions - .remove( - attraction); - } - }); - }, - ), - ], - ), - ), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width, - height: 500, - child: Align( - alignment: Alignment.topLeft, - // ignore: unnecessary_null_comparison - child: studioAttractions == null - ? const CircularProgressIndicator() - : Container( - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * 0.016), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - const Text( - 'Disney Studios', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 25.0, - ), - ), - PopupMenuButton( - initialValue: selectedView, - onSelected: _onViewChanged, - itemBuilder: (BuildContext context) { - return [ - 'Toutes les attractions', - 'Marvel Avengers Campus', - 'Production Courtyard', - 'Toon Studio', - ].map((String view) { - return PopupMenuItem( - value: view, - child: Text(view), - ); - }).toList(); - }, - offset: const Offset(200, 0), - child: Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context) - .size - .width * - 0.004), - child: const Icon( - Icons.arrow_drop_down, - color: Colors - .white, // Définit la couleur de l'icône en blanc - ), - ), - ), - ], - ), - SizedBox( - height: - MediaQuery.of(context).size.height * - 0.02, - ), - SizedBox( - height: 400, - width: screenSize.width * 0.72, - child: ListView.builder( - itemCount: - filteredStudioAttractions.length, - itemBuilder: (context, index) { - var attraction = - filteredStudioAttractions[index]; - return Container( - margin: EdgeInsets.only( - bottom: MediaQuery.of(context) - .size - .height * - 0.016), - child: Card( - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(20.0), - ), - elevation: 5, - color: Colors.white, - child: ListTile( - contentPadding: - EdgeInsets.symmetric( - horizontal: - MediaQuery.of( - context) - .size - .width * - 0.0083), - leading: ClipRRect( - borderRadius: - BorderRadius.circular( - 10.0), - child: Image.asset( - attraction.photoUrl, - width: - screenSize.width * 0.10, - height: screenSize.height * - 0.057, - fit: BoxFit.cover, - ), - ), - title: Text( - attraction.name, - overflow: - TextOverflow.ellipsis, - ), - subtitle: Text.rich( - TextSpan( - text: 'Temps d\'attente: ', - style: const TextStyle( - fontWeight: - FontWeight.bold), - children: [ - TextSpan( - text: - '${attraction.waitTime} minutes', - style: TextStyle( - fontWeight: - FontWeight.bold, - color: - getColorForWaitTime( - attraction - .waitTime), - ), - ), - ], - ), - ), - trailing: Row( - mainAxisSize: - MainAxisSize.min, - children: [ - Icon( - attraction.isAvailable - ? Icons.check_circle - : Icons.cancel, - color: - attraction.isAvailable - ? Colors.green - : Colors.red, ), - SizedBox( - width: - MediaQuery.of(context) - .size - .width * - 0.004, - ), - IconButton( - icon: Icon( - attraction.isFavorite - ? Icons.star - : Icons.star_border, - color: Colors.black, - ), - onPressed: () { - setState(() { - attraction - .isFavorite = - !attraction - .isFavorite; - if (attraction - .isFavorite) { - favoriteAttractions - .add( - attraction); - } else { - favoriteAttractions - .remove( - attraction); - } - }); - }, + title: Text( + attraction.name, + overflow: + TextOverflow.ellipsis, ), - ], - ), - ), - ), - ); - }, - ), - ), - ], - ), - ), - ), - ), - ], - ), - ), - ), - Padding( - padding: EdgeInsets.only( - left: MediaQuery.of(context).size.width * 0.04), - child: Align( - alignment: Alignment.centerLeft, - child: SizedBox( - width: screenSize.width * 0.9, - child: SizedBox( - height: screenSize.height * 0.6, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildAttractionsInfoContainer(), - SizedBox( - height: MediaQuery.of(context).size.height * 0.01, - ), - Container( - constraints: BoxConstraints( - maxHeight: - MediaQuery.of(context).size.height * 0.464), - child: SizedBox( - width: 400, - child: Expanded( - child: Container( - margin: EdgeInsets.all( - MediaQuery.of(context).size.height * 0.016), - padding: EdgeInsets.all( - MediaQuery.of(context).size.height * 0.016), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(20.0), - boxShadow: [ - BoxShadow( - color: const Color.fromARGB(255, 0, 0, 0) - .withOpacity(0.3), - spreadRadius: 1, - blurRadius: 2, - offset: const Offset(2, 3), - ), - ], - ), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - const Text( - 'Attractions Favorites', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 18.0, - ), - ), - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.01, // 1% de la hauteur de l'écran - width: - MediaQuery.of(context).size.width * - 0.208, - ), - favoriteAttractions.isEmpty - ? const Text( - 'Aucune attraction favorite actuellement', - style: TextStyle( - fontStyle: FontStyle.italic, - ), - ) - : Column( - children: [ - for (var attraction - in favoriteAttractions) - ListTile( - title: - Text(attraction.name), subtitle: Text.rich( TextSpan( text: @@ -1856,29 +1696,183 @@ class _MyHomePageState extends State { ], ), ), - trailing: Icon( - attraction.isAvailable - ? Icons.check_circle - : Icons.cancel, - color: + trailing: Row( + mainAxisSize: + MainAxisSize.min, + children: [ + Icon( attraction.isAvailable + ? Icons + .check_circle + : Icons.cancel, + color: attraction + .isAvailable ? Colors.green : Colors.red, + ), + SizedBox( + width: MediaQuery.of( + context) + .size + .width * + 0.004, + ), + IconButton( + icon: Icon( + attraction + .isFavorite + ? Icons.star + : Icons + .star_border, + color: Colors.black, + ), + onPressed: () { + setState(() { + attraction + .isFavorite = + !attraction + .isFavorite; + if (attraction + .isFavorite) { + favoriteAttractions + .add( + attraction); + } else { + favoriteAttractions + .remove( + attraction); + } + }); + }, + ), + ], ), ), - ], - ), + ), + ); + }, + ), + ), + ), ], ), ), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 20.0), + child: Align( + alignment: Alignment.topCenter, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + buildAttractionsInfoContainer(), + Container( + constraints: const BoxConstraints(maxHeight: 460), + child: SizedBox( + width: 400, + child: Expanded( + child: Container( + margin: const EdgeInsets.all(16), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(20.0), + boxShadow: [ + BoxShadow( + color: + const Color.fromARGB(255, 0, 0, 0) + .withOpacity(0.3), + spreadRadius: 1, + blurRadius: 2, + offset: const Offset(2, 3), + ), + ], + ), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + const Text( + 'Attractions Favorites', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 18.0, + ), + ), + SizedBox( + height: 10, + width: MediaQuery.of(context) + .size + .width * + 0.208, + ), + favoriteAttractions.isEmpty + ? const Text( + 'Aucune attraction favorite actuellement', + style: TextStyle( + fontStyle: FontStyle.italic, + ), + ) + : Column( + children: [ + for (var attraction + in favoriteAttractions) + ListTile( + title: + Text(attraction.name), + subtitle: Text.rich( + TextSpan( + text: + 'Temps d\'attente: ', + style: const TextStyle( + fontWeight: + FontWeight + .bold), + children: [ + TextSpan( + text: + '${attraction.waitTime} minutes', + style: TextStyle( + fontWeight: + FontWeight + .bold, + color: getColorForWaitTime( + attraction + .waitTime), + ), + ), + ], + ), + ), + trailing: Icon( + attraction.isAvailable + ? Icons.check_circle + : Icons.cancel, + color: attraction + .isAvailable + ? Colors.green + : Colors.red, + ), + ), + ], + ), + ], + ), + ), + ), ), ), ), - ), - ], + ], + ), ), ), - ), + ], ), ), ], @@ -1932,6 +1926,7 @@ class _MyHomePageState extends State { selectedView = view ?? 'Disneyland'; // Mise à jour de la vue sélectionnée if (view != null && !selectedFilters.contains(view)) { List lands = [ + 'Toutes les attractions', 'Frontierland', 'Adventureland', 'Fantasyland', @@ -1940,6 +1935,7 @@ class _MyHomePageState extends State { ]; List landsstudio = [ + 'Toutes les attractions', 'Toon Studio', 'Marvel Avengers Campus', 'Production Courtyard', @@ -2064,7 +2060,6 @@ class _MyHomePageState extends State { .toList(); break; } - print(selectedFilters); } } } @@ -2140,7 +2135,7 @@ class SmallFilterWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.08), + padding: const EdgeInsets.only(top: 80), child: SizedBox( width: 400, child: Column( @@ -2152,10 +2147,11 @@ class SmallFilterWidget extends StatelessWidget { padding: EdgeInsets.only( left: MediaQuery.of(context).size.width * 0.02), child: const Text( - 'Filtres :', + 'Filtres : ', style: TextStyle( fontSize: 18.0, color: Colors.white, + fontWeight: FontWeight.bold, ), ), ), @@ -2176,7 +2172,8 @@ class SmallFilterWidget extends StatelessWidget { ], ), Padding( - padding: const EdgeInsets.only(top: 5, left: 70), + padding: EdgeInsets.only( + top: 5, left: MediaQuery.of(context).size.width * 0.04), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [