merge pull request 'Views_implementation'
continuous-integration/drone/push Build is failing
Details
@ -0,0 +1,16 @@
|
||||
# bowlin_project
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
@ -1,4 +1,4 @@
|
||||
package com.example.bowl_in
|
||||
package com.example.bowlin_project
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
Before Width: | Height: | Size: 564 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 406 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 762 B |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,45 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../views/game_screen.dart';
|
||||
import '../views/ingame_screen.dart';
|
||||
import '../views/main_screen.dart';
|
||||
import '../views/rank_screen.dart';
|
||||
import '../views/welcome_screen.dart';
|
||||
|
||||
final GoRouter router = GoRouter(
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const MainScreen();
|
||||
},
|
||||
routes: <RouteBase>[
|
||||
GoRoute(
|
||||
path: 'games',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const GameScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: 'ranking',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const RankScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: 'splash',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const WelcomeScreen();
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: 'in-game',
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
return const InGameScreen();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
@ -0,0 +1,17 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class BowlInFont {
|
||||
BowlInFont._();
|
||||
|
||||
static const _kFontFam = 'BowlInFont';
|
||||
static const String? _kFontPkg = null;
|
||||
|
||||
static const IconData stats_icon =
|
||||
IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData profil_icon =
|
||||
IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData home_icon =
|
||||
IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
static const IconData rank_icon =
|
||||
IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class GradientText extends StatelessWidget {
|
||||
const GradientText(
|
||||
this.text, {
|
||||
required this.gradient,
|
||||
this.style,
|
||||
});
|
||||
|
||||
final String text;
|
||||
final TextStyle? style;
|
||||
final Gradient gradient;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ShaderMask(
|
||||
blendMode: BlendMode.srcIn,
|
||||
shaderCallback: (bounds) => gradient.createShader(
|
||||
Rect.fromLTWH(0, 0, bounds.width, bounds.height),
|
||||
),
|
||||
child: Text(text, style: style),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/analysis_card.dart';
|
||||
import '../widgets/scores_list_widget.dart';
|
||||
|
||||
class AnalysisScreen extends StatefulWidget {
|
||||
const AnalysisScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AnalysisScreen> createState() => _AnalysisScreenState();
|
||||
}
|
||||
|
||||
class _AnalysisScreenState extends State<AnalysisScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ScrollConfiguration(
|
||||
behavior: CustomScroll(),
|
||||
child: SingleChildScrollView(
|
||||
child: Stack(alignment: Alignment.topCenter, children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 1.45,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Image.asset("assets/images/background_analysis.png"),
|
||||
Positioned(
|
||||
top: 150,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 180,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Positioned(
|
||||
left: 34,
|
||||
child: SpareCard(score: 12),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
child: StrikeCard(score: 12),
|
||||
),
|
||||
Positioned(
|
||||
right: 34,
|
||||
child: GameCard(score: 12),
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.topCenter,
|
||||
child: Container(
|
||||
height: 120,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_analysis.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Analysis",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xff1ABAE0),
|
||||
fontSize: 20),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 100,
|
||||
child: Wrap(
|
||||
direction: Axis.vertical,
|
||||
spacing: 10,
|
||||
verticalDirection: VerticalDirection.up,
|
||||
children: [
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
StatsCard(title: "Average", val: 12),
|
||||
],
|
||||
))
|
||||
]),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/button_new_party.dart';
|
||||
import '../widgets/scores_list_widget.dart';
|
||||
|
||||
class GameScreen extends StatefulWidget {
|
||||
const GameScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<GameScreen> createState() => _GameScreenState();
|
||||
}
|
||||
|
||||
class _GameScreenState extends State<GameScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.topCenter,
|
||||
child: Container(
|
||||
height: 120,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_score.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Scores",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
fontSize: 20),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ButtonNewParty(),
|
||||
SizedBox(width: 20),
|
||||
ButtonJoinParty(),
|
||||
],
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Positioned(
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height - 140,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: ListCardGame(),
|
||||
)),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../widgets/button_new_party.dart';
|
||||
import '../widgets/ingame_widgets.dart';
|
||||
import '../widgets/scores_list_widget.dart';
|
||||
|
||||
class InGameScreen extends StatefulWidget {
|
||||
const InGameScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<InGameScreen> createState() => _InGameScreenState();
|
||||
}
|
||||
|
||||
class _InGameScreenState extends State<InGameScreen> {
|
||||
late Widget widgetHolder;
|
||||
|
||||
void initState() {
|
||||
widgetHolder = InGameCardConfig();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 120,
|
||||
),
|
||||
widgetHolder,
|
||||
Spacer(),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
widgetHolder = InGameCardThrow(
|
||||
numberThrow: 2,
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"PLAY",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 40,
|
||||
color: Color(0xff1ABAE0)),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
side: BorderSide(
|
||||
width: 7,
|
||||
color: Color(0xff1ABAE0),
|
||||
),
|
||||
onPrimary: Colors.transparent,
|
||||
primary: Colors.transparent,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(55),
|
||||
),
|
||||
minimumSize: Size(200, 80),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
import 'package:bowl_in/presentation/font.dart';
|
||||
import 'package:bowl_in/views/profile_screen.dart';
|
||||
import 'package:bowl_in/views/rank_screen.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'analysis_screen.dart';
|
||||
import 'game_screen.dart';
|
||||
|
||||
class MainScreen extends StatefulWidget {
|
||||
const MainScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MainScreen> createState() => _MainScreenState();
|
||||
}
|
||||
|
||||
class _MainScreenState extends State<MainScreen> {
|
||||
int currentPageIndex = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: [
|
||||
GameScreen(),
|
||||
RankScreen(),
|
||||
AnalysisScreen(),
|
||||
ProfileScreen()
|
||||
][currentPageIndex],
|
||||
bottomNavigationBar: SizedBox(
|
||||
height: 75,
|
||||
child: NavigationBarTheme(
|
||||
data: const NavigationBarThemeData(
|
||||
indicatorColor: Colors.transparent,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: 200,
|
||||
maxHeight: 200,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.8),
|
||||
blurRadius: 500,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: NavigationBar(
|
||||
animationDuration: const Duration(microseconds: 800),
|
||||
selectedIndex: currentPageIndex,
|
||||
labelBehavior:
|
||||
NavigationDestinationLabelBehavior.alwaysHide,
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
onDestinationSelected: (index) =>
|
||||
setState(() => currentPageIndex = index),
|
||||
backgroundColor: Colors.white,
|
||||
destinations: const [
|
||||
NavigationDestination(
|
||||
icon: Icon(
|
||||
BowlInFont.home_icon,
|
||||
color: Colors.grey,
|
||||
size: 21,
|
||||
),
|
||||
label: 'Profil',
|
||||
selectedIcon: Icon(
|
||||
BowlInFont.home_icon,
|
||||
size: 21,
|
||||
),
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(
|
||||
BowlInFont.rank_icon,
|
||||
color: Colors.grey,
|
||||
size: 21,
|
||||
),
|
||||
label: '',
|
||||
selectedIcon: Icon(
|
||||
BowlInFont.rank_icon,
|
||||
size: 21,
|
||||
),
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(
|
||||
Icons.show_chart,
|
||||
color: Colors.grey,
|
||||
size: 25,
|
||||
),
|
||||
label: '',
|
||||
selectedIcon: Icon(
|
||||
Icons.show_chart,
|
||||
size: 25,
|
||||
),
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(
|
||||
BowlInFont.profil_icon,
|
||||
color: Colors.grey,
|
||||
size: 21,
|
||||
),
|
||||
label: '',
|
||||
selectedIcon: Icon(
|
||||
BowlInFont.profil_icon,
|
||||
size: 21,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/achievements_list_widget.dart';
|
||||
|
||||
class ProfileScreen extends StatefulWidget {
|
||||
const ProfileScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ProfileScreen> createState() => _ProfileScreenState();
|
||||
}
|
||||
|
||||
class _ProfileScreenState extends State<ProfileScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(alignment: Alignment.topCenter, children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height * 1.45,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
]))),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.topCenter,
|
||||
child: Container(
|
||||
height: 120,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_profile.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Profile",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Colors.white, fontSize: 20),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 100),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
verticalDirection: VerticalDirection.up,
|
||||
children: [
|
||||
ListAchievementWidget(nbUnlocked: 1),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(40, 0, 0, 0),
|
||||
child: ProfileWidget()),
|
||||
],
|
||||
)),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../widgets/profil_listpodium_widget.dart';
|
||||
|
||||
class RankScreen extends StatefulWidget {
|
||||
const RankScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<RankScreen> createState() => _RankScreenState();
|
||||
}
|
||||
|
||||
class _RankScreenState extends State<RankScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Align(
|
||||
alignment: AlignmentDirectional.topCenter,
|
||||
child: Container(
|
||||
height: 120,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_ranking.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"Ranking",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Colors.white, fontSize: 20),
|
||||
)),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 70,
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width - 60,
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_podium(1).png"),
|
||||
)),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Positioned(
|
||||
left: 65,
|
||||
top: MediaQuery.of(context).size.height * 0.195,
|
||||
child: ProfilPodiumWidget(isfirst: 0, pseudo: "Louison", score: 122)),
|
||||
Positioned(
|
||||
top: MediaQuery.of(context).size.height * 0.114,
|
||||
child: Align(
|
||||
child: ProfilPodiumWidget(isfirst: 1, pseudo: "Lucas", score: 167),
|
||||
)),
|
||||
Positioned(
|
||||
right: 65,
|
||||
top: MediaQuery.of(context).size.height * 0.219,
|
||||
child: ProfilPodiumWidget(isfirst: 0, pseudo: "David", score: 102),
|
||||
),
|
||||
Positioned(
|
||||
bottom: -40,
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width - 40,
|
||||
height: 500,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_podium.png"),
|
||||
)),
|
||||
child: ListPodium(),
|
||||
)
|
||||
],
|
||||
)),
|
||||
]);
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class WelcomeScreen extends StatelessWidget {
|
||||
const WelcomeScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff19BDE0),
|
||||
Color(0xff4A17DC),
|
||||
],
|
||||
)),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
child: Image(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
image: AssetImage("assets/images/background_welcomepage.png"))),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Image(
|
||||
width: MediaQuery.of(context).size.width - 70,
|
||||
image: AssetImage("assets/images/icon_bowl_in.png")),
|
||||
Spacer(),
|
||||
ButtonConnexion(),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ButtonConnexion extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: () {},
|
||||
child: Icon(
|
||||
Icons.arrow_forward_rounded,
|
||||
color: Colors.white,
|
||||
size: 50.0,
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
side: BorderSide(
|
||||
width: 7,
|
||||
color: Color(0xffFF419B),
|
||||
),
|
||||
onPrimary: Colors.white,
|
||||
primary: Color(0xffF40375),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(35),
|
||||
),
|
||||
minimumSize: Size(90, 90),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,238 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class AchievementWidget extends StatelessWidget {
|
||||
final String imagePath;
|
||||
final String imagePathUnlocked;
|
||||
final int isUnlocked;
|
||||
const AchievementWidget(
|
||||
{Key? key,
|
||||
required this.imagePath,
|
||||
required this.imagePathUnlocked,
|
||||
required this.isUnlocked})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: this.isUnlocked == 0
|
||||
? AssetImage(this.imagePath)
|
||||
: AssetImage(this.imagePathUnlocked),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListAchievementWidget extends StatelessWidget {
|
||||
final int nbUnlocked;
|
||||
const ListAchievementWidget({Key? key, required this.nbUnlocked})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
width: 520,
|
||||
height: 520,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_achievement_table.png"),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 65, 0, 0),
|
||||
child: Wrap(
|
||||
alignment: WrapAlignment.center,
|
||||
runSpacing: 15,
|
||||
spacing: -5,
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(200, 0, 0, 30),
|
||||
child: RotationTransition(
|
||||
turns: new AlwaysStoppedAnimation(5 / 360),
|
||||
child: Text(
|
||||
this.nbUnlocked.toString() + "/9 unlocked",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontSize: 13,
|
||||
color: Color(0xff2461B2)),
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath: 'assets/images/achievements/5friends_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/5friends_unlocked.png',
|
||||
isUnlocked: 0,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath: 'assets/images/achievements/win_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/win_unlocked.png',
|
||||
isUnlocked: 1,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath:
|
||||
'assets/images/achievements/10strikes_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/10strikes_unlocked.png',
|
||||
isUnlocked: 0,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath:
|
||||
'assets/images/achievements/150points_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/150points_unlocked.png',
|
||||
isUnlocked: 0,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath:
|
||||
'assets/images/achievements/2strikeinarow_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/2strikeinarow_unlocked.png',
|
||||
isUnlocked: 1,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath: 'assets/images/achievements/5games_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/5games_unlocked.png',
|
||||
isUnlocked: 1,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath: 'assets/images/achievements/10spares_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/10spares_unlocked.png',
|
||||
isUnlocked: 1,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath:
|
||||
'assets/images/achievements/10x9spins_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/10x9spins_unlocked.png',
|
||||
isUnlocked: 0,
|
||||
),
|
||||
AchievementWidget(
|
||||
imagePath: 'assets/images/achievements/0point_locked.png',
|
||||
imagePathUnlocked:
|
||||
'assets/images/achievements/0point_unlocked.png',
|
||||
isUnlocked: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProfileWidget extends StatelessWidget {
|
||||
const ProfileWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 80,
|
||||
width: 80,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_orange.png"),
|
||||
fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.all(Radius.circular(100)),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Lucas",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 25),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 5),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: '',
|
||||
style: DefaultTextStyle.of(context).style,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: "Highscore :",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white.withOpacity(0.65),
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
TextSpan(
|
||||
text: "122 pts",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Color(0xffF40375).withOpacity(0.75),
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: '',
|
||||
style: DefaultTextStyle.of(context).style,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: "Last game ",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white.withOpacity(0.65),
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
TextSpan(
|
||||
text: "23",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
TextSpan(
|
||||
text: " days(s) ago",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white.withOpacity(0.65),
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class SpareCard extends StatelessWidget {
|
||||
final int score;
|
||||
const SpareCard({Key? key, required this.score}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 100,
|
||||
height: 150,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_spare_card.png"),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 70, 0, 0),
|
||||
child: Text(
|
||||
this.score.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xffF40375),
|
||||
fontSize: 28),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class StrikeCard extends StatelessWidget {
|
||||
final int score;
|
||||
const StrikeCard({Key? key, required this.score}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 150,
|
||||
width: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_strike_card.png"),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 70, 0, 0),
|
||||
child: Text(
|
||||
this.score.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xffF40375),
|
||||
fontSize: 28),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GameCard extends StatelessWidget {
|
||||
final int score;
|
||||
const GameCard({Key? key, required this.score}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 150,
|
||||
width: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_game_card.png"),
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 60, 0, 0),
|
||||
child: Text(
|
||||
this.score.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xffF40375),
|
||||
fontSize: 28),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class StatsCard extends StatelessWidget {
|
||||
final String title;
|
||||
final int val;
|
||||
|
||||
const StatsCard({Key? key, required this.title, required this.val})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 50,
|
||||
width: MediaQuery.of(context).size.width - 70,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 8,
|
||||
offset: Offset(0, 0), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 0, 20, 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
this.title,
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Color(0xff241E40),
|
||||
fontSize: 18),
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
this.val.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 28,
|
||||
color: Color(0xffF40375)),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,168 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class ButtonNewParty extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: () {},
|
||||
child: Text("+ New game"),
|
||||
style: ElevatedButton.styleFrom(
|
||||
side: BorderSide(
|
||||
width: 4,
|
||||
color: Color(0xffFF419B),
|
||||
),
|
||||
onPrimary: Colors.white,
|
||||
primary: Color(0xffF40375),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(35),
|
||||
),
|
||||
minimumSize: Size(130, 37),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NewGameModal extends StatelessWidget {
|
||||
const NewGameModal({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_newgame_modal(1).png")),
|
||||
SizedBox(
|
||||
height: 245,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
|
||||
child: Text("Join game",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w900, fontSize: 18)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Image.asset(
|
||||
"assets/images/sentence_joingame.png",
|
||||
width: 240,
|
||||
),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 0, 8),
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: [
|
||||
Container(
|
||||
width: 290,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffF8F8F8),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
const BoxShadow(
|
||||
color: Colors.grey,
|
||||
),
|
||||
const BoxShadow(
|
||||
color: Colors.black,
|
||||
spreadRadius: -20.0,
|
||||
blurRadius: 12.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 0, 0, 0),
|
||||
child: TextField(
|
||||
maxLength: 6,
|
||||
decoration: new InputDecoration(
|
||||
hintText: 'Party code...',
|
||||
counterStyle: TextStyle(
|
||||
height: double.minPositive,
|
||||
),
|
||||
counterText: "",
|
||||
border: InputBorder.none,
|
||||
),
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xff989898)),
|
||||
),
|
||||
)
|
||||
],
|
||||
)),
|
||||
Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 3, 0, 0),
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: 290,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffB70056),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(
|
||||
"CONFIRM",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold, fontSize: 18),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
onPrimary: Colors.white,
|
||||
primary: Color(0xffF40375),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
minimumSize: Size(290, 45),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ButtonJoinParty extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return NewGameModal();
|
||||
});
|
||||
},
|
||||
child: Text("Join game"),
|
||||
style: ElevatedButton.styleFrom(
|
||||
side: BorderSide(
|
||||
width: 4,
|
||||
color: Color(0xff6B6588),
|
||||
),
|
||||
onPrimary: Colors.white,
|
||||
primary: Color(0xff45405D),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(35),
|
||||
),
|
||||
minimumSize: Size(130, 37),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,717 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:bowl_in/widgets/profil_listpodium_widget.dart';
|
||||
import 'package:bowl_in/widgets/scores_list_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class FinalScoreBoard extends StatefulWidget {
|
||||
const FinalScoreBoard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<FinalScoreBoard> createState() => _FinalScoreBoardState();
|
||||
}
|
||||
|
||||
class _FinalScoreBoardState extends State<FinalScoreBoard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(30, 0, 30, 35),
|
||||
width: double.infinity,
|
||||
height: 470,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/ingame_cardgame.png"),
|
||||
fit: BoxFit.fill),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: CupertinoColors.black.withOpacity(0.15),
|
||||
blurRadius: 10.0,
|
||||
spreadRadius: 5.0,
|
||||
),
|
||||
]),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 5, 15, 50),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: DefaultTextStyle.of(context).style,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'GAME OVER',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 15,
|
||||
color: CupertinoColors.black,
|
||||
fontWeight: FontWeight.w900,
|
||||
decoration: TextDecoration.none)),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
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,
|
||||
)
|
||||
],
|
||||
)),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/congrats_background.png"),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 10),
|
||||
child: Align(
|
||||
child: Text(
|
||||
"Play again",
|
||||
style: GoogleFonts.roboto(
|
||||
decoration: TextDecoration.none,
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
class PodiumGameOverWidget extends StatelessWidget {
|
||||
final int isfirst;
|
||||
final String pseudo;
|
||||
final int score;
|
||||
const PodiumGameOverWidget(
|
||||
{Key? key,
|
||||
required this.isfirst,
|
||||
required this.pseudo,
|
||||
required this.score})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
width: this.isfirst == 1 ? 65 : 50,
|
||||
height: this.isfirst == 1 ? 65 : 50,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_red.png"),
|
||||
fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
),
|
||||
),
|
||||
if (isfirst == 1)
|
||||
Positioned(
|
||||
bottom: -5,
|
||||
right: -30,
|
||||
child: Image.asset(
|
||||
'assets/images/image_trophee.png',
|
||||
height: 60,
|
||||
width: 60,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 3, 0, 0),
|
||||
child: Text(
|
||||
this.pseudo,
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
this.score.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.pink,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: this.isfirst == 1 ? 60 : 40,
|
||||
decoration: TextDecoration.none),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InGameCardConfig extends StatefulWidget {
|
||||
const InGameCardConfig({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<InGameCardConfig> createState() => _InGameCardConfigState();
|
||||
}
|
||||
|
||||
class _InGameCardConfigState extends State<InGameCardConfig> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(30, 0, 30, 35),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 470,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/ingame_cardgame.png"),
|
||||
fit: BoxFit.fill),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: CupertinoColors.black.withOpacity(0.15),
|
||||
blurRadius: 10.0,
|
||||
spreadRadius: 5.0,
|
||||
),
|
||||
]),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 5, 15, 0),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: DefaultTextStyle.of(context).style,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'Party code : ',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 15,
|
||||
color: CupertinoColors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.none)),
|
||||
TextSpan(
|
||||
text: '#172 520',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
color: Color(0xffF40375),
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none)),
|
||||
],
|
||||
),
|
||||
)),
|
||||
ListUserInGame(),
|
||||
Spacer(),
|
||||
Image(
|
||||
image: AssetImage("assets/images/start_sentence.png"),
|
||||
),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 0, 15, 15),
|
||||
child: ElevatedButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
"+ Add a player",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
color: Colors.white),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
elevation: 5,
|
||||
shadowColor: Color(0xffB70056),
|
||||
primary: Color(0xffF40375),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
minimumSize: Size(double.infinity, 50),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListUserInGame extends StatefulWidget {
|
||||
const ListUserInGame({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<ListUserInGame> createState() => _ListUserInGameState();
|
||||
}
|
||||
|
||||
class _ListUserInGameState extends State<ListUserInGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 25, 20, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: new BoxConstraints(
|
||||
maxHeight: 170,
|
||||
),
|
||||
child: ListView(children: [
|
||||
UserInGame(),
|
||||
UserInGame(),
|
||||
UserInGame(),
|
||||
UserInGame(),
|
||||
UserInGame(),
|
||||
])),
|
||||
Text(
|
||||
"3 player(s)",
|
||||
style: GoogleFonts.roboto(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 15,
|
||||
color: CupertinoColors.black,
|
||||
decoration: TextDecoration.none),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class UserInGame extends StatefulWidget {
|
||||
const UserInGame({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<UserInGame> createState() => _UserInGameState();
|
||||
}
|
||||
|
||||
class _UserInGameState extends State<UserInGame> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||
margin: EdgeInsets.fromLTRB(0, 0, 0, 5),
|
||||
height: 45,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
color: Color(0xffF2F2F2),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_cyan.png"),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
"Emre",
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
decoration: TextDecoration.none,
|
||||
color: Color(0xff241E40)),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InGameCardThrow extends StatefulWidget {
|
||||
final int numberThrow;
|
||||
const InGameCardThrow({Key? key, required this.numberThrow})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<InGameCardThrow> createState() => _InGameCardThrowState();
|
||||
}
|
||||
|
||||
class _InGameCardThrowState extends State<InGameCardThrow> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.fromLTRB(30, 0, 30, 35),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 470,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/ingame_cardgame.png"),
|
||||
fit: BoxFit.fill),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: CupertinoColors.black.withOpacity(0.15),
|
||||
blurRadius: 10.0,
|
||||
spreadRadius: 5.0,
|
||||
),
|
||||
]),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(15, 5, 0, 0),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: DefaultTextStyle.of(context).style,
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: 'Round ',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 15,
|
||||
color: CupertinoColors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.none)),
|
||||
TextSpan(
|
||||
text: '1 - 1st',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 18,
|
||||
color: CupertinoColors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
decoration: TextDecoration.none)),
|
||||
TextSpan(
|
||||
text: ' Throw',
|
||||
style: GoogleFonts.roboto(
|
||||
fontSize: 15,
|
||||
color: CupertinoColors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.none)),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Round_picture(
|
||||
pseudo: "Lucas",
|
||||
image: "assets/images/image_user_red.png"),
|
||||
],
|
||||
)),
|
||||
NumberPad(
|
||||
numberThrow: widget.numberThrow,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Round_picture extends StatelessWidget {
|
||||
final String pseudo;
|
||||
final String image;
|
||||
const Round_picture({Key? key, required this.pseudo, required this.image})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 70,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(image: AssetImage(image), fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
pseudo,
|
||||
style: GoogleFonts.roboto(
|
||||
color: CupertinoColors.black,
|
||||
decoration: TextDecoration.none,
|
||||
fontSize: 30),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class StrikeButton extends StatelessWidget {
|
||||
final int currentSelected;
|
||||
final IntCallback onSonChanged;
|
||||
const StrikeButton(
|
||||
{Key? key, required this.onSonChanged, required this.currentSelected})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onSonChanged(10);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/Strike_background.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"STRIKE !",
|
||||
style: GoogleFonts.roboto(
|
||||
color:
|
||||
currentSelected == 10 ? Colors.pink : CupertinoColors.black,
|
||||
decoration: TextDecoration.none,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontSize: 40),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SpareButton extends StatelessWidget {
|
||||
final int currentSelected;
|
||||
final IntCallback onSonChanged;
|
||||
const SpareButton(
|
||||
{Key? key, required this.onSonChanged, required this.currentSelected})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
onSonChanged(10);
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 100,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/Spare_background.png"),
|
||||
)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"SPARE !",
|
||||
style: GoogleFonts.roboto(
|
||||
color:
|
||||
currentSelected == 10 ? Colors.pink : CupertinoColors.black,
|
||||
decoration: TextDecoration.none,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontSize: 40),
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NumberPad extends StatefulWidget {
|
||||
final int numberThrow;
|
||||
const NumberPad({Key? key, required this.numberThrow}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<NumberPad> createState() => _NumberPadState();
|
||||
}
|
||||
|
||||
class _NumberPadState extends State<NumberPad> {
|
||||
int NumSelected = 100;
|
||||
|
||||
void updateId(int newNum) {
|
||||
print(newNum);
|
||||
setState(() {
|
||||
NumSelected = newNum;
|
||||
});
|
||||
}
|
||||
|
||||
void initState() {
|
||||
NumSelected = 100;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(50, 0, 50, 0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 1,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 2,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 3,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 4,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 5,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 6,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 7,
|
||||
isSelectable: 1,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 8,
|
||||
isSelectable: 0,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
Number(
|
||||
currentSelected: NumSelected,
|
||||
num: 9,
|
||||
isSelectable: 0,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.numberThrow == 1
|
||||
? StrikeButton(
|
||||
currentSelected: NumSelected,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
)
|
||||
: SpareButton(
|
||||
currentSelected: NumSelected,
|
||||
onSonChanged: (int newId) {
|
||||
updateId(newId);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
typedef void IntCallback(int id);
|
||||
|
||||
class Number extends StatefulWidget {
|
||||
final int num;
|
||||
final int currentSelected;
|
||||
final int isSelectable;
|
||||
final IntCallback onSonChanged;
|
||||
const Number(
|
||||
{Key? key,
|
||||
required this.num,
|
||||
required this.isSelectable,
|
||||
required this.onSonChanged,
|
||||
required this.currentSelected})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<Number> createState() => _NumberState();
|
||||
}
|
||||
|
||||
class _NumberState extends State<Number> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return widget.isSelectable == 1
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
widget.onSonChanged(widget.num);
|
||||
},
|
||||
child: Text(
|
||||
widget.num.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
color: widget.currentSelected == widget.num
|
||||
? Colors.pink
|
||||
: Colors.black,
|
||||
decoration: TextDecoration.none,
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 50),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
widget.num.toString(),
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.grey,
|
||||
decoration: TextDecoration.none,
|
||||
fontWeight: FontWeight.w300,
|
||||
fontSize: 50),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
import 'package:bowl_in/widgets/scores_list_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class ProfilPodiumWidget extends StatelessWidget {
|
||||
final int isfirst;
|
||||
final String pseudo;
|
||||
final int score;
|
||||
const ProfilPodiumWidget(
|
||||
{Key? key,
|
||||
required this.isfirst,
|
||||
required this.pseudo,
|
||||
required this.score})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
width: this.isfirst == 1 ? 65 : 50,
|
||||
height: this.isfirst == 1 ? 65 : 50,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_red.png"),
|
||||
fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
),
|
||||
),
|
||||
if (isfirst == 1)
|
||||
Positioned(
|
||||
bottom: -5,
|
||||
right: -15,
|
||||
child: Image.asset(
|
||||
'assets/images/image_trophee.png',
|
||||
height: 40,
|
||||
width: 40,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 3, 0, 3),
|
||||
child: Text(
|
||||
this.pseudo,
|
||||
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 70,
|
||||
height: 25,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xff3618A0),
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
this.score.toString() + " pts",
|
||||
style: GoogleFonts.roboto(
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16),
|
||||
),
|
||||
)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ProfilListWidget extends StatelessWidget {
|
||||
final int position;
|
||||
final String pseudo;
|
||||
final int score;
|
||||
|
||||
const ProfilListWidget(
|
||||
{Key? key,
|
||||
required this.position,
|
||||
required this.pseudo,
|
||||
required this.score})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 9),
|
||||
child: Container(
|
||||
width: 300,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(17)),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(18, 0, 18, 0),
|
||||
child: Text(
|
||||
this.position.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14,
|
||||
color: Color(0xffBABABA),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(70)),
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_cyan.png"),
|
||||
fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
this.pseudo,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Color(0xff585858)),
|
||||
),
|
||||
Text(
|
||||
this.score.toString() + " points",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Color(0xffBABABA)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ListPodium extends StatelessWidget {
|
||||
const ListPodium({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(20, 80, 20, 0),
|
||||
child: SizedBox(
|
||||
height: 500,
|
||||
child: ScrollConfiguration(
|
||||
behavior: CustomScroll(),
|
||||
child: ListView(
|
||||
children: [
|
||||
ProfilListWidget(
|
||||
position: 4,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 5,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 6,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 7,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 8,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 9,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 10,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
ProfilListWidget(
|
||||
position: 11,
|
||||
pseudo: 'Emre',
|
||||
score: 35,
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
],
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
@ -0,0 +1,211 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import 'package:simple_gradient_text/simple_gradient_text.dart';
|
||||
|
||||
class CardGame extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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"),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(130, 3, 0, 0),
|
||||
child: ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Opacity(
|
||||
opacity: 0.1,
|
||||
child: Stack(
|
||||
children: [
|
||||
GradientText(
|
||||
"125",
|
||||
style: GoogleFonts.karla(
|
||||
fontSize: 105.0,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontStyle: FontStyle.italic,
|
||||
foreground: Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 1
|
||||
..color = Color(0xff6100FF),
|
||||
),
|
||||
gradientType: GradientType.linear,
|
||||
gradientDirection: GradientDirection.rtl,
|
||||
radius: 2.5,
|
||||
colors: [
|
||||
Color(0xff5500E0),
|
||||
Color(0xff2C2C2C).withOpacity(0),
|
||||
],
|
||||
),
|
||||
GradientText(
|
||||
"125",
|
||||
style: GoogleFonts.karla(
|
||||
fontSize: 105.0,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
gradientType: GradientType.linear,
|
||||
gradientDirection: GradientDirection.rtl,
|
||||
radius: 2.5,
|
||||
colors: [
|
||||
Color(0xff5500E0),
|
||||
Color(0xff2C2C2C).withOpacity(0),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
)),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Toast(),
|
||||
Toast(),
|
||||
],
|
||||
),
|
||||
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: [
|
||||
ProfilPicture(),
|
||||
ProfilPicture(),
|
||||
ProfilPicture(),
|
||||
ProfilPicture(),
|
||||
ProfilPicture(),
|
||||
ProfilPicture(),
|
||||
],
|
||||
),
|
||||
)),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 30, 15, 0),
|
||||
child: GradientText(
|
||||
"125",
|
||||
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: () => context.go('/in-game'),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class CustomScroll extends ScrollBehavior {
|
||||
@override
|
||||
Widget buildViewportChrome(
|
||||
BuildContext context, Widget child, AxisDirection axisDirection) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
class ListCardGame extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ScrollConfiguration(
|
||||
behavior: CustomScroll(),
|
||||
child: ListView(
|
||||
shrinkWrap: false,
|
||||
children: <Widget>[
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
CardGame(),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class ProfilPicture extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 25,
|
||||
width: 25,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/image_user_green.png"),
|
||||
fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Toast extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(0, 3, 10, 0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
color: Color(0xff735CDD),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(11.0, 3, 11.0, 3),
|
||||
child: Text(
|
||||
"12 janv.",
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)));
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 578 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 125 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 260 KiB |
After Width: | Height: | Size: 257 KiB |
After Width: | Height: | Size: 256 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 248 KiB |
After Width: | Height: | Size: 257 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 45 KiB |