Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mb/416/game page #465

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added ludos/mobile/assets/images/header_gow.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
226 changes: 226 additions & 0 deletions ludos/mobile/lib/game_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
import 'package:flutter/material.dart';
import 'helper/colors.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';


class GamePage extends StatefulWidget {
const GamePage({super.key});

@override
State<GamePage> createState() => _GamePageState();
}
class _GamePageState extends State<GamePage> {
@override
Widget build(BuildContext context) {

return Scaffold(
backgroundColor: const Color(0xFF101c2c),
appBar: AppBar(
backgroundColor: const Color(0xFFf89c34),
title: const Text('God of War (2018)'),
),
body: SingleChildScrollView(
padding: EdgeInsets.all(16.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
width: 200.0,
height: 200.0,
child: Image.asset('assets/images/header_gow.jpg'),
),
const SizedBox(height: 10),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
TextButton(
style: TextButton.styleFrom(
foregroundColor: MyColors.lightBlue),
onPressed: () {},
child: Text('adventure'),
),
TextButton(
style: TextButton.styleFrom(
foregroundColor: MyColors.lightBlue),
onPressed: () {},
child: Text('singleplayer'),
),
TextButton(
style: TextButton.styleFrom(
foregroundColor: MyColors.lightBlue),
onPressed: () {},
child: Text('action'),
),
TextButton(
style: TextButton.styleFrom(
foregroundColor: MyColors.lightBlue),
onPressed: () {},
child: Text('mythology'),
),
],
),
),
Row(
children: [
RatingBar.builder(
initialRating: 3,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 40,
itemBuilder: (context, _) => const Icon(
Icons.star,
color: MyColors.orange,
),
onRatingUpdate: (rating) {
print(rating);
},
),
SizedBox(width: 8), // Add some spacing between RatingBar and Text
const Text(' Rating: 4.3/5',style: TextStyle(
color: MyColors.orange,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
],
),

const SizedBox(height: 10),

const Text(
' His vengeance against the Gods of Olympus years behind him, Kratos now lives as a man in the realm of Norse Gods and monsters. It is in this harsh, unforgiving world that he must fight to survive… and teach his son to do the same.',
style: TextStyle(
color: MyColors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const SizedBox(height: 20),
const Text('Estimating Time: 120 hours',style: TextStyle(
color: MyColors.orange,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const SizedBox(height: 20),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(
height: 3.0,
thickness: 3.0,
color: Color(0xFF589cb4),
),
Container(
padding: const EdgeInsets.all(15.0),
child: const Text(
'A stunningly beautiful game with characters you grow to love. This is quite the adventure and I was all in within a few minutes of starting. In the midst of Norse mythology, it is a sweet and heartwarming story about a father and a son building a relationship.',
softWrap: true,
style: TextStyle(color: Colors.white)),
),
Container(

child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.thumb_up_sharp)),
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.thumb_down_sharp)),
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.comment)),
const Text(
'10 hours ago',
style: TextStyle(color: Colors.white),
),
Container(
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: Color(0xFFf89c34)),
onPressed: () {},
child: Text('@sena'),
),
),

],
),
),
const Divider(
height: 3.0,
thickness: 3.0,
color: Color(0xFF589cb4),
),
],
),
const SizedBox(height: 20),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const Divider(
height: 3.0,
thickness: 3.0,
color: Color(0xFF589cb4),
),
Container(
padding: const EdgeInsets.all(15.0),
child: const Text(
'Great story, characters, voice acting, cinematics, etc. The game world is huge and diverse and you travel by foot, by boat and (ultimately) by fast travel through mystic gates. ',
softWrap: true,
style: TextStyle(color: Colors.white)),
),
Container(

child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.thumb_up_sharp)),
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.thumb_down_sharp)),
IconButton(
color: Colors.white,
onPressed: () {},
icon: const Icon(Icons.comment)),
const Text(
'2 days ago',
style: TextStyle(color: Colors.white),
),
Container(
child: TextButton(
style: TextButton.styleFrom(
foregroundColor: Color(0xFFf89c34)),
onPressed: () {},
child: Text('@sena'),
),
),

],
),
),
const Divider(
height: 3.0,
thickness: 3.0,
color: Color(0xFF589cb4),
),
],
),
],
),
),
);
}
}
14 changes: 13 additions & 1 deletion ludos/mobile/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:ludos_mobile_app/change_password.dart';
import 'package:ludos_mobile_app/game_page.dart';
import 'login_page.dart';
import 'userProvider.dart';
import 'package:provider/provider.dart';
Expand Down Expand Up @@ -50,7 +51,18 @@ class Home extends StatelessWidget {
},
),
if (userProvider.isLoggedIn)

ListTile(
title: const Text(
'God of War',
style: TextStyle(color: MyColors.white),
),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const GamePage(),
));
},
),
if (userProvider.isLoggedIn)
ListTile(
title: const Text(
'Log Out',
Expand Down
10 changes: 9 additions & 1 deletion ludos/mobile/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
flutter_rating_bar:
dependency: "direct dev"
description:
name: flutter_rating_bar
sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93
url: "https://pub.dev"
source: hosted
version: "4.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -242,4 +250,4 @@ packages:
version: "0.1.4-beta"
sdks:
dart: ">=3.1.3 <4.0.0"
flutter: ">=1.16.0"
flutter: ">=2.5.0"
2 changes: 1 addition & 1 deletion ludos/mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dev_dependencies:
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0

flutter_rating_bar: ^4.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

Expand Down