diff --git a/Sources/bowlin_project/lib/views/game_screen.dart b/Sources/bowlin_project/lib/views/game_screen.dart index 636359c..b7c3548 100644 --- a/Sources/bowlin_project/lib/views/game_screen.dart +++ b/Sources/bowlin_project/lib/views/game_screen.dart @@ -43,7 +43,9 @@ class _GameScreenState extends State { )), ), Column( + verticalDirection: VerticalDirection.down, mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, @@ -56,7 +58,9 @@ class _GameScreenState extends State { Container( height: MediaQuery.of(context).size.height - 140, width: MediaQuery.of(context).size.width, - child: ListCardGame(), + child: Center( + child: ListCardGame(), + ), ), ], ) diff --git a/Sources/bowlin_project/lib/widgets/ingame_widgets.dart b/Sources/bowlin_project/lib/widgets/ingame_widgets.dart index ef56c0f..704279f 100644 --- a/Sources/bowlin_project/lib/widgets/ingame_widgets.dart +++ b/Sources/bowlin_project/lib/widgets/ingame_widgets.dart @@ -325,11 +325,12 @@ class _InGameCardConfigState extends State { onDelete: onDelete, onReorder: onReorder, ), - Spacer(), - Image( - image: AssetImage("assets/images/start_sentence.png"), + Align( + child: Image( + height: MediaQuery.of(context).size.height * 0.15, + image: AssetImage("assets/images/start_sentence.png"), + ), ), - Spacer(), Padding( padding: EdgeInsets.fromLTRB(15, 0, 15, 15), child: ElevatedButton( @@ -496,6 +497,7 @@ class _UserInGameState extends State { decoration: TextDecoration.none, color: Color(0xff241E40))), ), + Spacer(), (widget.player is User && (widget.player as User).id == MyApp.controller.userCurrent.id) ? Icon(Icons.lock, color: Colors.amber) diff --git a/Sources/bowlin_project/lib/widgets/scores_list_widget.dart b/Sources/bowlin_project/lib/widgets/scores_list_widget.dart index a9716a9..b758235 100644 --- a/Sources/bowlin_project/lib/widgets/scores_list_widget.dart +++ b/Sources/bowlin_project/lib/widgets/scores_list_widget.dart @@ -17,28 +17,77 @@ class CardGame extends StatelessWidget { @override Widget build(BuildContext context) { initializeDateFormatting(); - return Padding( - padding: EdgeInsets.fromLTRB(41, 0, 41, 10), - child: GestureDetector( - child: Stack( - alignment: AlignmentDirectional.centerEnd, - children: [ - Container( - margin: EdgeInsets.fromLTRB(10, 0, 10, 0), - height: 100, - width: 300, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - topRight: Radius.circular(8), - bottomRight: Radius.circular(15), - bottomLeft: Radius.circular(15)), - image: DecorationImage( - image: AssetImage("assets/images/card_game.png"), - ), + return GestureDetector( + child: Stack( + alignment: AlignmentDirectional.centerEnd, + children: [ + Container( + margin: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 100, + width: 300, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomRight: Radius.circular(15), + bottomLeft: Radius.circular(15)), + image: DecorationImage( + image: AssetImage("assets/images/card_game.png"), + ), + ), + child: Stack( + children: [ + Positioned( + top: 0, + right: 0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Toast( + value: DateFormat('dd MMMM', 'fr_FR') + .format(game.date)), + Toast(value: DateFormat('HH:mm').format(game.date)), + ], + )), + Positioned( + left: 0, + top: 0, + child: Padding( + padding: EdgeInsets.fromLTRB(10, 35, 0, 0), + child: SizedBox( + width: 130, + child: Wrap( + spacing: 5, + runSpacing: 5, + children: game.players + .map((e) => ProfilPicture( + path: e.image.toString(), + )) + .toList())), + )), + Positioned( + right: 0, + bottom: 0, + child: Padding( + padding: EdgeInsets.fromLTRB(0, 25, 15, 0), + child: GradientText( + game.pointsCurrentUser.toString(), + style: TextStyle( + fontSize: 40.0, + fontWeight: FontWeight.w900, + fontStyle: FontStyle.italic, + ), + gradientType: GradientType.linear, + gradientDirection: GradientDirection.ttb, + radius: 2.5, + colors: [ + Color(0xff181818), + Color(0xff626262), + ], + )), ), - child: Padding( - padding: EdgeInsets.fromLTRB(120, 0, 3, 0), + Positioned( + right: 0, child: ClipRect( clipBehavior: Clip.hardEdge, child: Opacity( @@ -81,76 +130,20 @@ class CardGame extends StatelessWidget { ), ], ))), - )), - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.fromLTRB(5, 3, 10, 3), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Toast( - value: DateFormat('dd MMMM', 'fr_FR') - .format(game.date)), - Toast(value: DateFormat('HH:mm').format(game.date)), - ], - )), - Stack( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: EdgeInsets.fromLTRB(25, 15, 0, 0), - child: SizedBox( - width: 130, - child: Wrap( - spacing: 5, - runSpacing: 5, - children: game.players - .map((e) => ProfilPicture( - path: e.image.toString(), - )) - .toList()))), - const Spacer(), - Padding( - padding: EdgeInsets.fromLTRB(0, 25, 15, 0), - child: GradientText( - game.pointsCurrentUser.toString(), - style: TextStyle( - fontSize: 40.0, - fontWeight: FontWeight.w900, - fontStyle: FontStyle.italic, - ), - gradientType: GradientType.linear, - gradientDirection: GradientDirection.ttb, - radius: 2.5, - colors: [ - Color(0xff181818), - Color(0xff626262), - ], - )), - ], - ), - ], - ), + ) ], - ), - ], - ), - onTap: () { - showDialog( - context: context, - builder: (BuildContext context) { - return ScoreBoardModal( - gamedetail: - MyApp.controller.gameMgr.getGameById(game.id)); - }); - }, - )); + )), + ], + ), + onTap: () { + showDialog( + context: context, + builder: (BuildContext context) { + return ScoreBoardModal( + gamedetail: MyApp.controller.gameMgr.getGameById(game.id)); + }); + }, + ); } } @@ -171,7 +164,9 @@ class ListCardGame extends StatelessWidget { shrinkWrap: false, itemCount: MyApp.controller.userCurrent.games.length, itemBuilder: (BuildContext context, int index) { - return CardGame(game: MyApp.controller.userCurrent.games[index]); + return Center( + child: CardGame(game: MyApp.controller.userCurrent.games[index]), + ); }, )); }