push new binding
continuous-integration/drone/push Build is failing Details

pull/20/head
Lucas Delanier 2 years ago
parent 9aeca9c1de
commit b85825b81d

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -6,6 +6,7 @@ import '../views/ingame_screen.dart';
import '../views/main_screen.dart'; import '../views/main_screen.dart';
import '../views/rank_screen.dart'; import '../views/rank_screen.dart';
import '../views/welcome_screen.dart'; import '../views/welcome_screen.dart';
import '../widgets/ingame_widgets.dart';
final GoRouter router = GoRouter( final GoRouter router = GoRouter(
routes: <RouteBase>[ routes: <RouteBase>[
@ -36,7 +37,7 @@ final GoRouter router = GoRouter(
GoRoute( GoRoute(
path: 'in-game', path: 'in-game',
builder: (BuildContext context, GoRouterState state) { builder: (BuildContext context, GoRouterState state) {
return const InGameScreen(); return InGameScreen();
}, },
), ),
], ],

@ -24,8 +24,8 @@ class StubData extends IManager {
_initRounds(); _initRounds();
_initGameDetails(); _initGameDetails();
_initGame(); _initGame();
players[8].games = games; userCurrent = players[8] as User;
userCurrent = players[8]; userCurrent.games = games;
} }
IUserManager get userMgr => _userMgr; IUserManager get userMgr => _userMgr;
@ -51,8 +51,7 @@ class StubData extends IManager {
Achievement("Win a game") Achievement("Win a game")
], ],
[], [],
Stat(10, 2, 12, 130, 7, 6, 700, 58.33, 30.2) Stat(10, 2, 12, 130, 7, 6, 700, 58.33, 30.2)),
),
User( User(
9, 9,
"Dave", "Dave",
@ -64,8 +63,7 @@ class StubData extends IManager {
Achievement("Win a game") Achievement("Win a game")
], ],
[], [],
Stat(2, 7, 9, 80, 4, 3, 250, 27.77, 10.55) Stat(2, 7, 9, 80, 4, 3, 250, 27.77, 10.55))
)
]; ];
List<GameDetail> _gameDetails = []; List<GameDetail> _gameDetails = [];

@ -29,9 +29,7 @@ class _GameScreenState extends State<GameScreen> {
], ],
)), )),
), ),
Align( Container(
alignment: AlignmentDirectional.topCenter,
child: Container(
height: 120, height: 120,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
@ -41,12 +39,9 @@ class _GameScreenState extends State<GameScreen> {
child: Text( child: Text(
"Scores", "Scores",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold, color: Colors.white, fontSize: 20),
color: Colors.white,
fontSize: 20),
)), )),
), ),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
@ -54,19 +49,14 @@ class _GameScreenState extends State<GameScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
ButtonNewParty(), ButtonNewParty(),
SizedBox(width: 20), const SizedBox(width: 20),
ButtonJoinParty(), ButtonJoinParty(),
], ],
), ),
Align( Container(
alignment: Alignment.bottomCenter,
child: Positioned(
bottom: 0,
child: Container(
height: MediaQuery.of(context).size.height - 140, height: MediaQuery.of(context).size.height - 140,
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: ListCardGame(), child: ListCardGame(),
)),
), ),
], ],
) )

@ -1,13 +1,16 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'ingame_widgets.dart';
class ButtonNewParty extends StatelessWidget { class ButtonNewParty extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ElevatedButton( return ElevatedButton(
onPressed: () {}, onPressed: () => context.go('/in-game'),
child: Text("+ New game"), child: Text("+ New game"),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
side: BorderSide( side: BorderSide(
@ -139,6 +142,65 @@ class NewGameModal extends StatelessWidget {
} }
} }
class ScoreBoardModal extends StatelessWidget {
const ScoreBoardModal({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Dialog(
child: Stack(
alignment: Alignment.topCenter,
children: [
Transform.scale(
scale: 1.14,
child: Image.asset("assets/images/image_scoreboard.png")),
SizedBox(
height: 245,
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Expanded(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Stack(
alignment: Alignment.topCenter,
children: [
Positioned(
child: PodiumGameOverWidget(
isfirst: 2,
pseudo: 'Lucas',
score: 123,
),
top: 70,
left: 30,
),
Positioned(
child: PodiumGameOverWidget(
isfirst: 1,
pseudo: 'Momo',
score: 160,
),
top: 10,
),
Positioned(
child: PodiumGameOverWidget(
isfirst: 3,
pseudo: 'popo',
score: 110,
),
top: 70,
right: 30,
)
],
),
)),
]),
)
],
),
);
}
}
class ButtonJoinParty extends StatelessWidget { class ButtonJoinParty extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,4 +1,5 @@
import 'package:bowl_in/main.dart'; import 'package:bowl_in/main.dart';
import 'package:bowl_in/widgets/button_new_party.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
@ -111,14 +112,14 @@ class CardGame extends StatelessWidget {
spacing: 5, spacing: 5,
runSpacing: 5, runSpacing: 5,
children: game.playersId children: game.playersId
.map((item) => ProfilPicture( .map((e) => ProfilPicture(
path: MyApp.controller.userMgr path: MyApp.controller.userMgr
.getUserById(item) .getUserById(e)
.image, .image
.toString(),
)) ))
.toList(), .toList()))),
))), const Spacer(),
Spacer(),
Padding( Padding(
padding: EdgeInsets.fromLTRB(0, 30, 15, 0), padding: EdgeInsets.fromLTRB(0, 30, 15, 0),
child: GradientText( child: GradientText(
@ -144,7 +145,13 @@ class CardGame extends StatelessWidget {
), ),
], ],
), ),
onTap: () => context.go('/in-game'), onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return ScoreBoardModal();
});
},
)); ));
} }
} }

Loading…
Cancel
Save