From d57b4dcf4695dd2ffe39954d2bf45ca33dcd8b8d Mon Sep 17 00:00:00 2001 From: delanierlucas Date: Tue, 29 Nov 2022 14:35:21 +0100 Subject: [PATCH] text on spot page when no spot available --- .../lib/views/pages/main/w_spot.dart | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart index 3f908e3..b02575d 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_spot.dart @@ -51,7 +51,14 @@ class _SpotsWidgetState extends State { Align( alignment: FractionalOffset.bottomCenter, child: MyApp.controller.currentUser.spots.isEmpty - ? Container() + ? const Center( + child: SizedBox( + width: 300, + height: 300, + child: riv.RiveAnimation.asset( + 'assets/images/search_spot_animation.riv'), + ), + ) : OpenContainer( closedColor: Colors.transparent, closedElevation: 0, @@ -64,14 +71,6 @@ class _SpotsWidgetState extends State { }, ), ), - const Center( - child: SizedBox( - width: 300, - height: 300, - child: riv.RiveAnimation.asset( - 'assets/images/search_spot_animation.riv'), - ), - ), Positioned( top: height * 0.68, width: width, @@ -166,26 +165,48 @@ class _SpotsWidgetState extends State { )), ), ), + MyApp.controller.currentUser.spots.isEmpty? + SafeArea(child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + MyApp.controller.currentUser.spots.isEmpty? + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Quelques instants...', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w500, + fontSize: 25), + ), + const Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 0)), + Text( + 'Nous cherchons des profils a vous proposer.', + style: TextStyle( + color: Colors.grey.withOpacity(0.4), fontSize: 15), + ), + ], + ) : + Container(), + + ] + ) + ),): Padding( padding: const EdgeInsets.fromLTRB(20, 60, 0, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - MyApp.controller.currentUser.spots.isEmpty - ? '' - : MyApp.controller.currentUser.spots.last.music.name, + Text(MyApp.controller.currentUser.spots.last.music.name, style: TextStyle( fontFamily: 'DMSans', color: Colors.white.withOpacity(1), fontSize: 20, fontWeight: FontWeight.w800), ), - Text( - MyApp.controller.currentUser.spots.isEmpty - ? '' - : MyApp - .controller.currentUser.spots.last.music.artist, + Text(MyApp.controller.currentUser.spots.last.music.artist, style: TextStyle( fontFamily: 'DMSans', color: Colors.white.withOpacity(1),