|
|
@ -1,13 +1,22 @@
|
|
|
|
|
|
|
|
import 'package:bowl_in/main.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';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
|
|
|
import 'package:intl/date_symbol_data_local.dart';
|
|
|
|
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:simple_gradient_text/simple_gradient_text.dart';
|
|
|
|
import 'package:simple_gradient_text/simple_gradient_text.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import '../model/Game.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class CardGame extends StatelessWidget {
|
|
|
|
class CardGame extends StatelessWidget {
|
|
|
|
|
|
|
|
final Game game;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CardGame({Key? key, required this.game}) : super(key: key);
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
initializeDateFormatting();
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(41, 0, 41, 10),
|
|
|
|
padding: EdgeInsets.fromLTRB(41, 0, 41, 10),
|
|
|
|
child: GestureDetector(
|
|
|
|
child: GestureDetector(
|
|
|
@ -29,7 +38,7 @@ class CardGame extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(130, 3, 0, 0),
|
|
|
|
padding: EdgeInsets.fromLTRB(120, 3, 3, 0),
|
|
|
|
child: ClipRect(
|
|
|
|
child: ClipRect(
|
|
|
|
clipBehavior: Clip.hardEdge,
|
|
|
|
clipBehavior: Clip.hardEdge,
|
|
|
|
child: Opacity(
|
|
|
|
child: Opacity(
|
|
|
@ -37,7 +46,7 @@ class CardGame extends StatelessWidget {
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
GradientText(
|
|
|
|
GradientText(
|
|
|
|
"125",
|
|
|
|
game.pointsCurrentUser.toString(),
|
|
|
|
style: GoogleFonts.karla(
|
|
|
|
style: GoogleFonts.karla(
|
|
|
|
fontSize: 105.0,
|
|
|
|
fontSize: 105.0,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
@ -56,7 +65,7 @@ class CardGame extends StatelessWidget {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GradientText(
|
|
|
|
GradientText(
|
|
|
|
"125",
|
|
|
|
game.pointsCurrentUser.toString(),
|
|
|
|
style: GoogleFonts.karla(
|
|
|
|
style: GoogleFonts.karla(
|
|
|
|
fontSize: 105.0,
|
|
|
|
fontSize: 105.0,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
@ -77,13 +86,17 @@ class CardGame extends StatelessWidget {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(5, 5, 10, 3),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Toast(),
|
|
|
|
Toast(
|
|
|
|
Toast(),
|
|
|
|
value: DateFormat('dd MMMM', 'fr_FR')
|
|
|
|
|
|
|
|
.format(game.date)),
|
|
|
|
|
|
|
|
Toast(value: DateFormat('HH:mm').format(game.date)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Stack(
|
|
|
|
Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
@ -97,21 +110,19 @@ class CardGame extends StatelessWidget {
|
|
|
|
child: Wrap(
|
|
|
|
child: Wrap(
|
|
|
|
spacing: 5,
|
|
|
|
spacing: 5,
|
|
|
|
runSpacing: 5,
|
|
|
|
runSpacing: 5,
|
|
|
|
children: [
|
|
|
|
children: game.playersId
|
|
|
|
ProfilPicture(),
|
|
|
|
.map((item) => ProfilPicture(
|
|
|
|
ProfilPicture(),
|
|
|
|
path: MyApp.controller.userMgr
|
|
|
|
ProfilPicture(),
|
|
|
|
.getUserById(item)
|
|
|
|
ProfilPicture(),
|
|
|
|
.image,
|
|
|
|
ProfilPicture(),
|
|
|
|
))
|
|
|
|
ProfilPicture(),
|
|
|
|
.toList(),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(0, 30, 15, 0),
|
|
|
|
padding: EdgeInsets.fromLTRB(0, 30, 15, 0),
|
|
|
|
child: GradientText(
|
|
|
|
child: GradientText(
|
|
|
|
"125",
|
|
|
|
game.pointsCurrentUser.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 40.0,
|
|
|
|
fontSize: 40.0,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
@ -151,36 +162,27 @@ class ListCardGame extends StatelessWidget {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ScrollConfiguration(
|
|
|
|
return ScrollConfiguration(
|
|
|
|
behavior: CustomScroll(),
|
|
|
|
behavior: CustomScroll(),
|
|
|
|
child: ListView(
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: false,
|
|
|
|
shrinkWrap: false,
|
|
|
|
children: <Widget>[
|
|
|
|
itemCount: MyApp.controller.userCurrent.games.length,
|
|
|
|
CardGame(),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
CardGame(),
|
|
|
|
return CardGame(game: MyApp.controller.userCurrent.games[index]);
|
|
|
|
CardGame(),
|
|
|
|
},
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
CardGame(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class ProfilPicture extends StatelessWidget {
|
|
|
|
class ProfilPicture extends StatelessWidget {
|
|
|
|
|
|
|
|
final String path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ProfilPicture({Key? key, required this.path}) : super(key: key);
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: 25,
|
|
|
|
height: 25,
|
|
|
|
width: 25,
|
|
|
|
width: 25,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: DecorationImage(image: AssetImage(path), fit: BoxFit.cover),
|
|
|
|
image: AssetImage("assets/images/image_user_green.png"),
|
|
|
|
|
|
|
|
fit: BoxFit.cover),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -188,6 +190,9 @@ class ProfilPicture extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class Toast extends StatelessWidget {
|
|
|
|
class Toast extends StatelessWidget {
|
|
|
|
|
|
|
|
final String value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Toast({Key? key, required this.value}) : super(key: key);
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
@ -200,7 +205,7 @@ class Toast extends StatelessWidget {
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.fromLTRB(11.0, 3, 11.0, 3),
|
|
|
|
padding: EdgeInsets.fromLTRB(11.0, 3, 11.0, 3),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
"12 janv.",
|
|
|
|
value,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|