mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
Show default message when null or empty
This commit is contained in:
parent
da8b3d88de
commit
ba70827448
@ -145,11 +145,13 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if(sliderDTO.images != null && sliderDTO.images.length > 1)
|
||||||
Positioned(
|
Positioned(
|
||||||
top: MediaQuery.of(context).size.height * 0.35,
|
top: MediaQuery.of(context).size.height * 0.35,
|
||||||
right: 60,
|
right: 60,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (sliderDTO.images.length > 0)
|
||||||
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -159,11 +161,13 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
if(sliderDTO.images != null && sliderDTO.images.length > 1)
|
||||||
Positioned(
|
Positioned(
|
||||||
top: MediaQuery.of(context).size.height * 0.35,
|
top: MediaQuery.of(context).size.height * 0.35,
|
||||||
left: 60,
|
left: 60,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (sliderDTO.images.length > 0)
|
||||||
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -189,6 +193,8 @@ class _SliderViewWidget extends State<SliderViewWidget> {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if(sliderDTO.images == null || sliderDTO.images.length == 0)
|
||||||
|
Center(child: Text("Aucune image à afficher"))
|
||||||
// Description
|
// Description
|
||||||
/*Container(
|
/*Container(
|
||||||
height: sliderDTO.images != null && sliderDTO.images.length > 0 ? size.height *0.3 : size.height *0.6,
|
height: sliderDTO.images != null && sliderDTO.images.length > 0 ? size.height *0.3 : size.height *0.6,
|
||||||
|
|||||||
@ -23,10 +23,8 @@ class _VideoViewWidget extends State<VideoViewWidget> {
|
|||||||
print(videoDTO);
|
print(videoDTO);
|
||||||
|
|
||||||
String videoId;
|
String videoId;
|
||||||
|
if (videoDTO.source_ != null && videoDTO.source_.length > 0 ) {
|
||||||
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_);
|
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_);
|
||||||
print(videoId);
|
|
||||||
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
YoutubePlayerController _controller = YoutubePlayerController(
|
YoutubePlayerController _controller = YoutubePlayerController(
|
||||||
initialVideoId: videoId,
|
initialVideoId: videoId,
|
||||||
@ -50,6 +48,9 @@ class _VideoViewWidget extends State<VideoViewWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_videoView = null;
|
_videoView = null;
|
||||||
@ -57,5 +58,5 @@ class _VideoViewWidget extends State<VideoViewWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@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
|
@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