mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
All in cache (normally.. hum) + fix puzzle layout issue
This commit is contained in:
parent
4e6c281b84
commit
5f425eb65a
@ -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
|
||||
|
||||
@ -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<AudioPlayerFloatingContai
|
||||
});
|
||||
});*/
|
||||
|
||||
await player.setUrl(widget.resourceURl);
|
||||
await player.dynamicSet(url: widget.resourceURl);
|
||||
if(widget.isAuto) {
|
||||
//player.play(BytesSource(audiobytes));
|
||||
//await player.setAudioSource(LoadedSource(audiobytes));
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
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';
|
||||
@ -44,13 +45,21 @@ class _LoadingCommonState extends State<LoadingCommon> 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),
|
||||
),
|
||||
),
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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<VideoViewer> {
|
||||
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<VideoViewer> {
|
||||
child: _controller.value.isInitialized
|
||||
? AspectRatio(
|
||||
aspectRatio: _controller.value.aspectRatio,
|
||||
child: VideoPlayer(_controller),
|
||||
child: CachedVideoPlayer(_controller),
|
||||
)
|
||||
: Center(
|
||||
child: Container(
|
||||
|
||||
@ -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<VideoViewerYoutube> {
|
||||
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<VideoViewerYoutube> {
|
||||
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<VideoViewerYoutube> {
|
||||
handleColor: Colors.amberAccent,
|
||||
),
|
||||
);
|
||||
}
|
||||
}*/
|
||||
super.initState();
|
||||
}
|
||||
}
|
||||
@ -91,6 +91,6 @@ class _VideoViewerYoutube extends State<VideoViewerYoutube> {
|
||||
|
||||
@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)));
|
||||
}
|
||||
@ -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(
|
||||
|
||||
@ -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<MainViewWidget> {
|
||||
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<MainViewWidget> {
|
||||
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(
|
||||
|
||||
@ -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<MarkerViewWidget> {
|
||||
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(
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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<PuzzleView> {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
final appContext = Provider.of<AppContext>(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<void> getRealWidgetSize() async {
|
||||
@ -71,27 +79,67 @@ class _PuzzleView extends State<PuzzleView> {
|
||||
}
|
||||
|
||||
// we need to find out the image size, to be used in the PuzzlePiece widget
|
||||
Future<Size> getImageSize(Image image) async {
|
||||
/*Future<Size> getImageSize(CachedNetworkImage image) async {
|
||||
Completer<Size> completer = Completer<Size>();
|
||||
|
||||
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<Size> completer = Completer<Size>();
|
||||
|
||||
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<PuzzleView> {
|
||||
Size size = MediaQuery.of(context).size;
|
||||
final appContext = Provider.of<AppContext>(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<PuzzleView> {
|
||||
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<AppContext>(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,
|
||||
),
|
||||
|
||||
@ -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<QuizzView> {
|
||||
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<QuizzView> {
|
||||
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<QuizzView> {
|
||||
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(
|
||||
|
||||
@ -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<ShowReponsesWidget> {
|
||||
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(
|
||||
|
||||
@ -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<SliderView> {
|
||||
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(
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -99,10 +99,11 @@ class _MyAppState extends State<MyApp> {
|
||||
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<MyApp> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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"))
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user