diff --git a/android/app/build.gradle b/android/app/build.gradle index ecb18fe..b6c4e68 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -53,7 +53,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "be.unov.mymuseum.tablet_app" - minSdkVersion 20 + minSdkVersion 21 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/lib/Components/audio_player.dart b/lib/Components/audio_player.dart index 61d97ef..4fada11 100644 --- a/lib/Components/audio_player.dart +++ b/lib/Components/audio_player.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:just_audio/just_audio.dart'; +import 'package:just_audio_cache/just_audio_cache.dart'; import 'package:tablet_app/Models/tabletContext.dart'; import 'package:tablet_app/app_context.dart'; @@ -100,7 +101,7 @@ class _AudioPlayerFloatingContainerState extends State with TickerProviderStateM _controller!.forward(); } }); + + var primaryColor = tabletAppContext.configuration != null ? tabletAppContext.configuration!.primaryColor != null ? new Color(int.parse(tabletAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)) : kTestSecondColor : kTestSecondColor; return Center( child: SizedBox( height: size.height * 0.1, child: RotationTransition( turns: Tween(begin: 0.0, end: 3.0).animate(_controller!), child: tabletAppContext.configuration != null && tabletAppContext.configuration!.loaderImageUrl != null ? - Image.network(tabletAppContext.configuration!.loaderImageUrl!) + //Image.network(tabletAppContext.configuration!.loaderImageUrl!) + CachedNetworkImage( + imageUrl: tabletAppContext.configuration!.loaderImageUrl!, + progressIndicatorBuilder: (context, url, downloadProgress) => + CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor), + errorWidget: (context, url, error) => Icon(Icons.error), + ) : Icon(Icons.museum_outlined, color: kTestSecondColor, size: size.height*0.1), ), ), diff --git a/lib/Components/show_element_for_resource.dart b/lib/Components/show_element_for_resource.dart index e07a987..b9a146e 100644 --- a/lib/Components/show_element_for_resource.dart +++ b/lib/Components/show_element_for_resource.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:typed_data'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:manager_api/api.dart'; @@ -16,28 +17,15 @@ showElementForResource(ResourceDTO resourceDTO, AppContext appContext, bool isAu switch(resourceDTO.type) { case ResourceType.Image: - return Image.network( - resourceDTO.url!, - fit:BoxFit.fill, - loadingBuilder: (BuildContext context, Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) { - return child; - } - return Center( - child: CircularProgressIndicator( - color: primaryColor, - value: loadingProgress.expectedTotalBytes != null - ? loadingProgress.cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, - ), - ); - }, - ); - break; case ResourceType.ImageUrl: - return Image.network( + return CachedNetworkImage( + imageUrl: resourceDTO.url!, + fit: BoxFit.fill, + progressIndicatorBuilder: (context, url, downloadProgress) => + CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor), + errorWidget: (context, url, error) => Icon(Icons.error), + ); + /*return Image.network( resourceDTO.url!, fit:BoxFit.fill, loadingBuilder: (BuildContext context, Widget child, @@ -55,7 +43,7 @@ showElementForResource(ResourceDTO resourceDTO, AppContext appContext, bool isAu ), ); }, - ); + );*/ case ResourceType.Audio: return AudioPlayerFloatingContainer(audioBytes: null, resourceURl: resourceDTO.url!, isAuto: isAuto); /*return FutureBuilder( diff --git a/lib/Components/video_viewer.dart b/lib/Components/video_viewer.dart index 02f2333..9aeab67 100644 --- a/lib/Components/video_viewer.dart +++ b/lib/Components/video_viewer.dart @@ -1,6 +1,7 @@ +import 'package:cached_video_player/cached_video_player.dart'; import 'package:flutter/material.dart'; import 'package:tablet_app/Components/loading_common.dart'; -import 'package:video_player/video_player.dart'; +//import 'package:video_player/video_player.dart'; import '../../constants.dart'; class VideoViewer extends StatefulWidget { @@ -12,13 +13,12 @@ class VideoViewer extends StatefulWidget { } class _VideoViewer extends State { - late VideoPlayerController _controller; + late CachedVideoPlayerController _controller; @override void initState() { super.initState(); - _controller = VideoPlayerController.networkUrl(Uri.parse( - widget.videoUrl)) + _controller = CachedVideoPlayerController.network(widget.videoUrl) // Uri.parse() ..initialize().then((_) { // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed. setState(() {}); @@ -51,7 +51,7 @@ class _VideoViewer extends State { child: _controller.value.isInitialized ? AspectRatio( aspectRatio: _controller.value.aspectRatio, - child: VideoPlayer(_controller), + child: CachedVideoPlayer(_controller), ) : Center( child: Container( diff --git a/lib/Components/video_viewer_youtube.dart b/lib/Components/video_viewer_youtube.dart index 1eb8ea5..d2904fc 100644 --- a/lib/Components/video_viewer_youtube.dart +++ b/lib/Components/video_viewer_youtube.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:manager_api/api.dart'; import 'package:tablet_app/constants.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart' as iframe; -import 'package:youtube_player_flutter/youtube_player_flutter.dart'; +//import 'package:youtube_player_flutter/youtube_player_flutter.dart'; class VideoViewerYoutube extends StatefulWidget { final String videoUrl; @@ -19,13 +19,13 @@ class VideoViewerYoutube extends StatefulWidget { class _VideoViewerYoutube extends State { iframe.YoutubePlayer? _videoViewWeb; - YoutubePlayer? _videoView; + //YoutubePlayer? _videoView; @override void initState() { String? videoId; if (widget.videoUrl.length > 0 ) { - videoId = YoutubePlayer.convertUrlToId(widget.videoUrl); + //videoId = YoutubePlayer.convertUrlToId(widget.videoUrl); if (widget.webView) { final _controllerWeb = iframe.YoutubePlayerController( @@ -53,7 +53,7 @@ class _VideoViewerYoutube extends State { handleColor: Colors.amberAccent, ),*/ ); - } else { + } else /*{ // Cause memory issue on tablet videoId = YoutubePlayer.convertUrlToId(widget.videoUrl); YoutubePlayerController _controller = YoutubePlayerController( @@ -77,7 +77,7 @@ class _VideoViewerYoutube extends State { handleColor: Colors.amberAccent, ), ); - } + }*/ super.initState(); } } @@ -91,6 +91,6 @@ class _VideoViewerYoutube extends State { @override Widget build(BuildContext context) => widget.videoUrl.length > 0 ? - (widget.webView ? _videoViewWeb! : _videoView!): + _videoViewWeb!: //(widget.webView ? _videoViewWeb! : _videoView!) Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte", style: new TextStyle(fontSize: kNoneInfoOrIncorrect))); } \ No newline at end of file diff --git a/lib/Screens/Configuration/config_view.dart b/lib/Screens/Configuration/config_view.dart index d1a168d..f4269b7 100644 --- a/lib/Screens/Configuration/config_view.dart +++ b/lib/Screens/Configuration/config_view.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:device_info/device_info.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -358,9 +359,9 @@ boxDecoration(SectionDTO section) { image: new DecorationImage( fit: BoxFit.cover, colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop), - image: new NetworkImage( + image: CachedNetworkImageProvider(section.imageSource!), /*new NetworkImage( section.imageSource!, - ), + ),*/ ), boxShadow: [ BoxShadow( diff --git a/lib/Screens/MainView/main_view.dart b/lib/Screens/MainView/main_view.dart index 3e617db..d4fe97c 100644 --- a/lib/Screens/MainView/main_view.dart +++ b/lib/Screens/MainView/main_view.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'dart:math'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -139,9 +140,9 @@ class _MainViewWidget extends State { image: new DecorationImage( fit: BoxFit.cover, colorFilter: new ColorFilter.mode(Colors.white.withOpacity(0.8), BlendMode.lighten), - image: new NetworkImage( + image: CachedNetworkImageProvider(configurationDTO.imageSource!),/*new NetworkImage( configurationDTO.imageSource!, - ), + ),*/ ), ) : null, child: Column( @@ -256,9 +257,9 @@ class _MainViewWidget extends State { image: new DecorationImage( fit: BoxFit.cover, colorFilter: new ColorFilter.mode(Colors.grey.withOpacity(0.1), BlendMode.color), - image: new NetworkImage( + image: CachedNetworkImageProvider(configurationDTO.imageSource!),/*new NetworkImage( configurationDTO.imageSource!, - ), + ),*/ ), ) : null, child: Stack( @@ -505,9 +506,9 @@ boxDecoration(SectionDTO section, bool isSelected) { image: section.imageSource != null ? new DecorationImage( fit: !isSelected || kIsWeb ? BoxFit.cover : BoxFit.contain, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(kIsWeb ? 0.3 : 0.3), BlendMode.dstATop) : null, - image: new NetworkImage( + image: CachedNetworkImageProvider(section.imageSource!),/*new NetworkImage( section.imageSource!, - ), + ),*/ ): null, boxShadow: [ BoxShadow( diff --git a/lib/Screens/Map/marker_view.dart b/lib/Screens/Map/marker_view.dart index 635375a..795673e 100644 --- a/lib/Screens/Map/marker_view.dart +++ b/lib/Screens/Map/marker_view.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -161,9 +162,9 @@ class _MarkerInfoWidget extends State { aspectRatio: 16 / 9, child: ClipRect( child: i.imageSource != null ? PhotoView( - imageProvider: new NetworkImage( + imageProvider: CachedNetworkImageProvider(i.imageSource), /*new NetworkImage( i.imageSource, - ), + ),*/ minScale: PhotoViewComputedScale.contained * 0.8, maxScale: PhotoViewComputedScale.contained * 3.0, backgroundDecoration: BoxDecoration( diff --git a/lib/Screens/Menu/menu_view.dart b/lib/Screens/Menu/menu_view.dart index 8e52387..1bf7781 100644 --- a/lib/Screens/Menu/menu_view.dart +++ b/lib/Screens/Menu/menu_view.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; @@ -220,9 +221,9 @@ boxDecoration(SectionDTO section, bool isSelected) { image: section.imageSource != null ? new DecorationImage( fit: kIsWeb ? BoxFit.cover : BoxFit.contain, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop) : null, - image: new NetworkImage( + image: CachedNetworkImageProvider(section.imageSource!), /*new NetworkImage( section.imageSource!, - ), + ),*/ ): null, boxShadow: [ BoxShadow( diff --git a/lib/Screens/Puzzle/puzzle_piece.dart b/lib/Screens/Puzzle/puzzle_piece.dart index 601a5a1..f6b57a4 100644 --- a/lib/Screens/Puzzle/puzzle_piece.dart +++ b/lib/Screens/Puzzle/puzzle_piece.dart @@ -1,13 +1,13 @@ import 'dart:math'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tablet_app/Models/tabletContext.dart'; import 'package:tablet_app/app_context.dart'; -import 'package:tablet_app/constants.dart'; class PuzzlePiece extends StatefulWidget { - final Image image; + final CachedNetworkImage image; final Size imageSize; final int row; final int col; diff --git a/lib/Screens/Puzzle/puzzle_view.dart b/lib/Screens/Puzzle/puzzle_view.dart index 1fc7adf..f0eac9c 100644 --- a/lib/Screens/Puzzle/puzzle_view.dart +++ b/lib/Screens/Puzzle/puzzle_view.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:async'; import 'dart:io'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:manager_api/api.dart'; import 'package:provider/provider.dart'; @@ -44,20 +45,27 @@ class _PuzzleView extends State { Size size = MediaQuery.of(context).size; final appContext = Provider.of(context, listen: false); TabletAppContext tabletAppContext = appContext.getContext(); - TranslationAndResourceDTO? messageDebut = puzzleDTO.messageDebut != null ? puzzleDTO.messageDebut!.firstWhere((message) => message.language!.toUpperCase() == tabletAppContext.language!.toUpperCase()) : null; + + print(puzzleDTO.messageDebut); + TranslationAndResourceDTO? messageDebut = puzzleDTO.messageDebut != null && puzzleDTO.messageDebut!.length > 0 ? puzzleDTO.messageDebut!.firstWhere((message) => message.language!.toUpperCase() == tabletAppContext.language!.toUpperCase()) : null; if(messageDebut != null) { showMessage(messageDebut, appContext, context, size); } getRealWidgetSize(); + + if(puzzleDTO.image != null && puzzleDTO.image!.resourceUrl != null) { + //splitImage(Image.network(puzzleDTO.image!.resourceUrl!)); + splitImage(CachedNetworkImage( + imageUrl: puzzleDTO.image!.resourceUrl!, + fit: BoxFit.fill, + errorWidget: (context, url, error) => Icon(Icons.error), + )); + } }); super.initState(); - - if(puzzleDTO.image != null && puzzleDTO.image!.resourceUrl != null) { - splitImage(Image.network(puzzleDTO.image!.resourceUrl!)); - } } Future getRealWidgetSize() async { @@ -71,27 +79,67 @@ class _PuzzleView extends State { } // we need to find out the image size, to be used in the PuzzlePiece widget - Future getImageSize(Image image) async { + /*Future getImageSize(CachedNetworkImage image) async { Completer completer = Completer(); - image.image + /*image.image .resolve(const ImageConfiguration()) .addListener(ImageStreamListener((ImageInfo info, bool _) { completer.complete( Size(info.image.width.toDouble(), info.image.height.toDouble())); - })); + }));*/ + + CachedNetworkImage( + imageUrl: 'https://example.com/image.jpg', + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error), + imageBuilder: (BuildContext context, ImageProvider imageProvider) { + Completer completer = Completer(); + + imageProvider + .resolve(const ImageConfiguration()) + .addListener(ImageStreamListener((ImageInfo info, bool _) { + completer.complete( + Size(info.image.width.toDouble(), info.image.height.toDouble())); + })); + + return CachedNetworkImage( + imageUrl: 'https://example.com/image.jpg', + placeholder: (context, url) => CircularProgressIndicator(), + errorWidget: (context, url, error) => Icon(Icons.error), + imageBuilder: (context, imageProvider) { + return Image( + image: imageProvider, + loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) { + return child; + } else { + return Center( + child: CircularProgressIndicator( + value: loadingProgress.expectedTotalBytes != null + ? loadingProgress.cumulativeBytesLoaded / (loadingProgress.expectedTotalBytes ?? 1) + : null, + ), + ); + } + }, + ); + }, + ); + }, + ); Size imageSize = await completer.future; return imageSize; - } + }*/ // here we will split the image into small pieces // using the rows and columns defined above; each piece will be added to a stack - void splitImage(Image image) async { - Size imageSize = await getImageSize(image); + void splitImage(CachedNetworkImage image) async { + //Size imageSize = await getImageSize(image); //imageSize = realWidgetSize!; - imageSize = Size(realWidgetSize!.width * 1.25, realWidgetSize!.height * 1.25); + Size imageSize = Size(realWidgetSize!.width * 1.25, realWidgetSize!.height * 1.25); for (int x = 0; x < puzzleDTO.rows!; x++) { for (int y = 0; y < puzzleDTO.cols!; y++) { @@ -139,7 +187,7 @@ class _PuzzleView extends State { Size size = MediaQuery.of(context).size; final appContext = Provider.of(context, listen: false); TabletAppContext tabletAppContext = appContext.getContext(); - TranslationAndResourceDTO? messageFin = puzzleDTO.messageFin != null ? puzzleDTO.messageFin!.firstWhere((message) => message.language!.toUpperCase() == tabletAppContext.language!.toUpperCase()) : null; + TranslationAndResourceDTO? messageFin = puzzleDTO.messageFin != null && puzzleDTO.messageFin!.length > 0 ? puzzleDTO.messageFin!.firstWhere((message) => message.language!.toUpperCase() == tabletAppContext.language!.toUpperCase()) : null; if(messageFin != null) { showMessage(messageFin, appContext, context, size); @@ -158,27 +206,13 @@ class _PuzzleView extends State { padding: const EdgeInsets.all(10.0), child: isSplittingImage ? Center(child: LoadingCommon()) : puzzleDTO.image!.resourceUrl == null || realWidgetSize == null - ? Container( - width: 50, - height: 50, - color: Colors.cyan, - child: InkWell(onTap: () { - Size size = MediaQuery.of(context).size; - final appContext = Provider.of(context, listen: false); - TabletAppContext tabletAppContext = appContext.getContext(); - TranslationAndResourceDTO? messageFin = puzzleDTO.messageFin != null ? puzzleDTO.messageFin!.firstWhere((message) => message.language!.toUpperCase() == tabletAppContext.language!.toUpperCase()) : null; - - if(messageFin != null) { - // Alert dialog - showMessage(messageFin, appContext, context, size); - } - },),)//Center(child: Text("Invalid image")) + ? Center(child: Text("Invalid image")) : Center( child: Padding( padding: const EdgeInsets.all(8.0), child: Container( - width: tabletAppContext.puzzleSize != null ? tabletAppContext.puzzleSize!.width : realWidgetSize!.width * 0.8, - height: tabletAppContext.puzzleSize != null ? tabletAppContext.puzzleSize!.height +1.5 : realWidgetSize!.height * 0.8, + width: tabletAppContext.puzzleSize != null && tabletAppContext.puzzleSize!.width > 0 ? tabletAppContext.puzzleSize!.width : realWidgetSize!.width * 0.8, + height: tabletAppContext.puzzleSize != null && tabletAppContext.puzzleSize!.height > 0 ? tabletAppContext.puzzleSize!.height +1.5 : realWidgetSize!.height * 0.85, child: Stack( children: pieces, ), diff --git a/lib/Screens/Quizz/quizz_view.dart b/lib/Screens/Quizz/quizz_view.dart index 924a54a..60b7efd 100644 --- a/lib/Screens/Quizz/quizz_view.dart +++ b/lib/Screens/Quizz/quizz_view.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:confetti/confetti.dart'; import 'package:flutter/foundation.dart'; @@ -123,9 +124,9 @@ class _QuizzView extends State { image: levelToShow.source_ != null ? new DecorationImage( fit: BoxFit.contain, opacity: 0.85, - image: new NetworkImage( + image: CachedNetworkImageProvider(levelToShow.source_), /*new NetworkImage( levelToShow.source_, - ), + )*/ ): null, borderRadius: BorderRadius.all( Radius.circular(50.0)), border: Border.all( @@ -138,9 +139,9 @@ class _QuizzView extends State { decoration: BoxDecoration( color: const Color(0xff7c94b6), image: DecorationImage( - image: new NetworkImage( + image: CachedNetworkImageProvider(levelToShow.source_),/*new NetworkImage( levelToShow.source_, - ), + ),*/ fit: BoxFit.cover, ), borderRadius: BorderRadius.all( Radius.circular(50.0)), @@ -306,9 +307,9 @@ class _QuizzView extends State { image: i.resourceUrl != null ? new DecorationImage( fit: BoxFit.cover, opacity: 0.35, - image: new NetworkImage( + image: CachedNetworkImageProvider(i.resourceUrl!),/* new NetworkImage( i.resourceUrl!, - ), + ),*/ ): null, boxShadow: [ BoxShadow( diff --git a/lib/Screens/Quizz/showResponses.dart b/lib/Screens/Quizz/showResponses.dart index 729eb01..dd65aa2 100644 --- a/lib/Screens/Quizz/showResponses.dart +++ b/lib/Screens/Quizz/showResponses.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:developer'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; @@ -79,9 +80,9 @@ class _ShowReponsesWidget extends State { image: i.resourceUrl != null ? new DecorationImage( fit: BoxFit.contain, opacity: 0.35, - image: new NetworkImage( + image: CachedNetworkImageProvider(i.resourceUrl!),/*new NetworkImage( i.resourceUrl!, - ), + ),*/ ): null, boxShadow: [ BoxShadow( diff --git a/lib/Screens/Slider/slider_view.dart b/lib/Screens/Slider/slider_view.dart index 4fd6a0f..bbe9ecf 100644 --- a/lib/Screens/Slider/slider_view.dart +++ b/lib/Screens/Slider/slider_view.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; @@ -252,9 +253,9 @@ class _SliderView extends State { case ResourceType.Image: case ResourceType.ImageUrl: widgetToInclude = PhotoView( - imageProvider: new NetworkImage( + imageProvider: CachedNetworkImageProvider(i.resourceUrl!),/*new NetworkImage( i.resourceUrl!, - ), + ),*/ minScale: PhotoViewComputedScale.contained * 0.8, maxScale: PhotoViewComputedScale.contained * 3.0, backgroundDecoration: BoxDecoration( diff --git a/lib/Screens/Video/video_view.dart b/lib/Screens/Video/video_view.dart index 313d5c2..35befea 100644 --- a/lib/Screens/Video/video_view.dart +++ b/lib/Screens/Video/video_view.dart @@ -4,8 +4,9 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:manager_api/api.dart'; import 'package:tablet_app/constants.dart'; -import 'package:youtube_player_iframe/youtube_player_iframe.dart' as iframe; import 'package:youtube_player_flutter/youtube_player_flutter.dart'; +import 'package:youtube_player_iframe/youtube_player_iframe.dart' as iframe; +//import 'package:youtube_player_flutter/youtube_player_flutter.dart'; class VideoView extends StatefulWidget { final SectionDTO? section; diff --git a/lib/main.dart b/lib/main.dart index e9a6061..b340638 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -99,10 +99,11 @@ class _MyAppState extends State { const Locale('fr', 'FR'), ],*/ theme: ThemeData( + primaryColor: widget.tabletAppContext != null ? widget.tabletAppContext!.configuration != null ? widget.tabletAppContext!.configuration!.primaryColor != null ? new Color(int.parse(widget.tabletAppContext!.configuration!.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kTestSecondColor : kTestSecondColor : kTestSecondColor, primarySwatch: Colors.grey, scaffoldBackgroundColor: widget.tabletAppContext != null ? widget.tabletAppContext!.configuration != null ? widget.tabletAppContext!.configuration!.secondaryColor != null ? new Color(int.parse(widget.tabletAppContext!.configuration!.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : kBackgroundGrey : kBackgroundGrey, //fontFamily: "Vollkorn", - textTheme: TextTheme(bodyText1: TextStyle(color: kMainRed)), + textTheme: TextTheme(bodyLarge: TextStyle(color: kMainRed)), visualDensity: VisualDensity.adaptivePlatformDensity, ), routes: { @@ -114,4 +115,3 @@ class _MyAppState extends State { ); } } - diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 49dd2ec..c63a011 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -9,22 +9,20 @@ import audio_session import firebase_core import firebase_storage import just_audio -import package_info_plus import path_provider_foundation +import shared_preferences_foundation import sqflite import url_launcher_macos -import video_player_avfoundation -import wakelock_plus +import wakelock_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin")) JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) - FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) - FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin")) - WakelockPlusMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockPlusMacosPlugin")) + WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) } diff --git a/pubspec.yaml b/pubspec.yaml index 890bcff..da55df9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,11 +47,14 @@ dependencies: confetti: ^0.7.0 flutter_launcher_icons: ^0.13.1 # All but web #flutter_svg_provider: ^1.0.6 - flutter_widget_from_html: ^0.10.1 + flutter_widget_from_html: ^0.14.10+1 flutter_pdfview: ^1.3.2 firebase_storage: ^11.5.6 firebase_core: ^2.24.2 - video_player: ^2.8.1 + #video_player: ^2.8.1 + cached_video_player: ^2.0.4 + cached_network_image: ^3.3.1 + just_audio_cache: ^0.1.2 openapi_generator_cli: ^4.13.1 openapi_generator: ^4.13.1