mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 00:21:19 +00:00
Show default message when null or empty
This commit is contained in:
parent
da8b3d88de
commit
ba70827448
@ -145,12 +145,14 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
||||
),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
if(sliderDTO.images != null && sliderDTO.images.length > 1)
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).size.height * 0.35,
|
||||
right: 60,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
if (sliderDTO.images.length > 0)
|
||||
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.chevron_right,
|
||||
@ -159,12 +161,14 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
||||
),
|
||||
)
|
||||
),
|
||||
Positioned(
|
||||
if(sliderDTO.images != null && sliderDTO.images.length > 1)
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).size.height * 0.35,
|
||||
left: 60,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
if (sliderDTO.images.length > 0)
|
||||
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
},
|
||||
child: Icon(
|
||||
Icons.chevron_left,
|
||||
@ -189,6 +193,8 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
||||
)
|
||||
),
|
||||
),
|
||||
if(sliderDTO.images == null || sliderDTO.images.length == 0)
|
||||
Center(child: Text("Aucune image à afficher"))
|
||||
// Description
|
||||
/*Container(
|
||||
height: sliderDTO.images != null && sliderDTO.images.length > 0 ? size.height *0.3 : size.height *0.6,
|
||||
|
||||
@ -23,31 +23,32 @@ class _VideoViewWidget extends State<VideoViewWidget> {
|
||||
print(videoDTO);
|
||||
|
||||
String videoId;
|
||||
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_);
|
||||
print(videoId);
|
||||
if (videoDTO.source_ != null && videoDTO.source_.length > 0 ) {
|
||||
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_);
|
||||
|
||||
super.initState();
|
||||
YoutubePlayerController _controller = YoutubePlayerController(
|
||||
initialVideoId: videoId,
|
||||
flags: YoutubePlayerFlags(
|
||||
autoPlay: true,
|
||||
controlsVisibleAtStart: false,
|
||||
loop: true,
|
||||
hideControls: false,
|
||||
hideThumbnail: false,
|
||||
),
|
||||
);
|
||||
|
||||
YoutubePlayerController _controller = YoutubePlayerController(
|
||||
initialVideoId: videoId,
|
||||
flags: YoutubePlayerFlags(
|
||||
autoPlay: true,
|
||||
controlsVisibleAtStart: false,
|
||||
loop: true,
|
||||
hideControls: false,
|
||||
hideThumbnail: false,
|
||||
),
|
||||
);
|
||||
|
||||
_videoView = YoutubePlayer(
|
||||
controller: _controller,
|
||||
showVideoProgressIndicator: false,
|
||||
/*progressIndicatorColor: Colors.amber,
|
||||
_videoView = YoutubePlayer(
|
||||
controller: _controller,
|
||||
showVideoProgressIndicator: false,
|
||||
/*progressIndicatorColor: Colors.amber,
|
||||
progressColors: ProgressBarColors(
|
||||
playedColor: Colors.amber,
|
||||
handleColor: Colors.amberAccent,
|
||||
),*/
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -57,5 +58,5 @@ class _VideoViewWidget extends State<VideoViewWidget> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _videoView;
|
||||
Widget build(BuildContext context) => videoDTO.source_ != null && videoDTO.source_.length > 0 ? _videoView : Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte"));
|
||||
}
|
||||
@ -45,5 +45,5 @@ class _WebViewWidget extends State<WebViewWidget> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _webView;
|
||||
Widget build(BuildContext context) => webDTO.source_ != null && webDTO.source_.length > 0 ? _webView : Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide"));
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user