Skip to content

Commit

Permalink
Made changes to app bar adding pes buzz logo and title with user auth…
Browse files Browse the repository at this point in the history
…entication icon as well as date
  • Loading branch information
shashank16sundar committed Oct 24, 2023
1 parent 13f7394 commit b7dde1d
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 81 deletions.
Binary file added assets/logos/PesBuzzLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:pesbuzz/screens/splash_screen.dart';
import 'package:firebase_core/firebase_core.dart';

Expand All @@ -16,8 +17,15 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: false,
title: 'PES Buzz',
theme: ThemeData(
textTheme: GoogleFonts.poppinsTextTheme(),
appBarTheme: const AppBarTheme(
toolbarHeight: 75,
centerTitle: true,
backgroundColor: Colors.transparent,
shadowColor: Colors.transparent,
),
primaryColor: const Color(0xFF4169E1), // Royal Blue
scaffoldBackgroundColor: Colors.white, // Background color
scaffoldBackgroundColor: Colors.white,
),
home: const SplashScreen(),
);
Expand Down
61 changes: 28 additions & 33 deletions lib/screens/event_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,67 +55,62 @@ class EventDetailScreen extends StatelessWidget {
),
child: ListView(
physics: const BouncingScrollPhysics(),
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
padding: const EdgeInsets.fromLTRB(10, 20, 10, 0),
children: [
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Flexible(
child: Container(
padding: const EdgeInsets.all(5),
decoration: const BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
color: Colors.grey,
),
child: Text(
overflow: TextOverflow.ellipsis,
newsItem.clubName,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: Colors.black),
),
child: Text(
overflow: TextOverflow.ellipsis,
newsItem.clubName,
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(
fontWeight: FontWeight.w500,
fontSize: 18,
color: Colors.black),
),
),
Text(
overflow: TextOverflow.ellipsis,
newsItem.date,
style:
Theme.of(context).textTheme.bodyLarge!.copyWith(
// fontWeight: FontWeight.bold,
height: 1.25,
style: Theme.of(context)
.textTheme
.bodyLarge!
.copyWith(
fontWeight: FontWeight.w500,
fontSize: 15,
color: Colors.black),
),
],
),
// const SizedBox(height: 20),
const SizedBox(height: 10),
const SizedBox(height: 25),
Text(
newsItem.headline,
overflow: TextOverflow.ellipsis,
overflow: TextOverflow.visible,
style: Theme.of(context)
.textTheme
.headlineSmall!
.headlineMedium!
.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: Colors.black),
fontWeight: FontWeight.bold,
fontSize: 24,
height: 1.25,
color: Colors.black,
),
),
const SizedBox(
height: 10,
height: 20,
),
Text(
newsItem.description,
overflow: TextOverflow.ellipsis,
overflow: TextOverflow.visible,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
fontWeight: FontWeight.w500,
fontSize: 20,
fontSize: 18,
height: 1.25,
color: Colors.black),
),
Expand Down
111 changes: 97 additions & 14 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '/widgets/display_firestore_data.dart';

class HomeScreen extends StatefulWidget {
Expand All @@ -10,26 +11,108 @@ class _HomeScreenState extends State<HomeScreen> {
PageController pageController = PageController();
int currentIndex = 0;

String _getMonth(int month) {
switch (month) {
case 1:
return 'January';
case 2:
return 'February';
case 3:
return 'March';
case 4:
return 'April';
case 5:
return 'May';
case 6:
return 'June';
case 7:
return 'July';
case 8:
return 'August';
case 9:
return 'September';
case 10:
return 'October';
case 11:
return 'November';
case 12:
return 'December';
default:
return 'Unknown';
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('PES Buzz'),
backgroundColor: const Color(0xFF4169E1),
),
body: PageView(
controller: pageController,
onPageChanged: (index) {
setState(() {
currentIndex = index;
});
},
children: <Widget>[
DisplayFirestoreData(category: 'Trendy'),
DisplayFirestoreData(category: 'Sports'),
DisplayFirestoreData(category: 'Department'),
backgroundColor: const Color(0xffE2F9EE),
leadingWidth: 65,
leading: const Padding(
padding: EdgeInsets.only(left: 5.0),
child: Image(image: AssetImage('assets/logos/PesBuzzLogo.png')),
),
title: const Text(
'PES Buzz',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 28,
),
),
actions: [
IconButton(
onPressed: () {},
icon: const FaIcon(
FontAwesomeIcons.user,
color: Colors.black,
),
)
],
),
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xffE2F9EE),
Color(0xffFBFBD4),
],
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(
top: 10, left: 20, right: 20, bottom: 10),
child: Text(
'${DateTime.now().day.toString().padLeft(2, '0')}th ${_getMonth(DateTime.now().month)}, ${DateTime.now().year}',
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
Expanded(
child: PageView(
controller: pageController,
onPageChanged: (index) {
setState(() {
currentIndex = index;
});
},
children: <Widget>[
DisplayFirestoreData(category: 'Trendy'),
DisplayFirestoreData(category: 'Sports'),
DisplayFirestoreData(category: 'Department'),
],
),
),
],
),
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: currentIndex,
onTap: (index) {
Expand Down
66 changes: 33 additions & 33 deletions lib/widgets/news_item_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class NewsItemCard extends StatelessWidget {
children: [
ImageContainer(
// padding: const EdgeInsets.all(10),
margin: const EdgeInsets.all(20),
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
borderRadius: const BorderRadius.all(Radius.circular(20)),
boxShadow: const [
BoxShadow(
blurRadius: 10,
blurRadius: 5,
offset: Offset(1, 1),
color: Colors.grey,
),
Expand All @@ -37,40 +37,40 @@ class NewsItemCard extends StatelessWidget {
imageUrl: newsItem.imageUrl,
),
Flexible(
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
// height: MediaQuery.of(context).size.height * 0.4,
padding: const EdgeInsets.all(5),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10)),
color: Colors.grey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
newsItem.headline,
style: Theme.of(context).textTheme.headlineSmall!.copyWith(
fontSize: 21,
fontWeight: FontWeight.bold,
height: 1.5,
color: Colors.black,
),
),
child: Text(
Text(
newsItem.clubName,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: Colors.black),
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.headlineSmall!.copyWith(
fontWeight: FontWeight.w500,
fontSize: 18,
height: 1,
color: const Color(0xff7B6C6C),
),
),
),
Text(
newsItem.headline,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.headlineSmall!.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: Colors.black),
),
Text(
newsItem.date,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: Colors.black),
),
]),
Text(
newsItem.date,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontWeight: FontWeight.bold,
height: 1.25,
color: const Color(0xff7B6C6C),
),
),
],
),
),
],
),
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: "direct main"
description:
name: font_awesome_flutter
sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08"
url: "https://pub.dev"
source: hosted
version: "10.6.0"
google_fonts:
dependency: "direct main"
description:
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ dependencies:
cloud_firestore: ^4.9.3
flutter_spinkit: ^5.2.0
another_flutter_splash_screen: ^1.2.0
font_awesome_flutter: ^10.6.0

dev_dependencies:
flutter_test:
Expand All @@ -64,6 +65,7 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- assets/animations/
- assets/logos/

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware
Expand Down

0 comments on commit b7dde1d

Please sign in to comment.