|
|
@ -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, 0, 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,
|
|
|
@ -80,8 +89,10 @@ class CardGame extends StatelessWidget {
|
|
|
|
Row(
|
|
|
|
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(
|
|
|
@ -111,7 +122,7 @@ class CardGame extends StatelessWidget {
|
|
|
|
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,22 +162,12 @@ 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(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -188,6 +189,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 +204,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,
|
|
|
|