Skip to content

Commit

Permalink
UI beautified
Browse files Browse the repository at this point in the history
  • Loading branch information
praptisharma28 committed Feb 9, 2024
1 parent a84d079 commit cd6e55f
Show file tree
Hide file tree
Showing 13 changed files with 363 additions and 159 deletions.
11 changes: 11 additions & 0 deletions assets/images/location.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/app/configs/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class AppColors {

static const Color blackTextColor = Color(0xFF040303);
static const Color greyTextColor = Color(0xFF9698A9);

static const Color greyLightColor = Color.fromARGB(255, 236, 237, 242);
static const Color backgroundColorDark = Color(0xFF303030);
}
116 changes: 73 additions & 43 deletions lib/ui/pages/home_page.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
//import 'dart:js';

import 'package:card_swiper/card_swiper.dart';
import 'package:event_app/app/configs/colors.dart';
import 'package:event_app/app/resources/constant/named_routes.dart';
import 'package:event_app/bloc/event_cubit.dart';
import 'package:event_app/controllers/Home%20Page%20controllers/location_controller.dart';
import 'package:event_app/data/event_model.dart';
import 'package:event_app/models/Home%20page%20models/locationModel.dart';
import 'package:event_app/ui/pages/profile_page.dart';
import 'package:event_app/ui/pages/view_all_page.dart';
import 'package:event_app/ui/widgets/card_event_this_month.dart';
import 'package:event_app/ui/widgets/card_popular_event.dart';
import 'package:event_app/ui/widgets/custom_app_bar.dart';
import 'package:event_app/ui/widgets/my_navigation_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';

import 'view_all_page.dart';


class HomePage extends StatefulWidget {
Expand Down Expand Up @@ -83,30 +86,31 @@ class _HomePageState extends State<HomePage> {
const Text(
"Popular Event",
style: TextStyle(
fontWeight: FontWeight.w500,
fontSize: 16,
fontWeight: FontWeight.w700,
fontSize: 18,
),
),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ViewAllPage(isPopularEvent: true,)),
builder: (context) => const ViewAllPage(isPopularEvent: true,)),
);
},
child: const Text(
"View All",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
color: AppColors.greyTextColor),
fontWeight: FontWeight.w500,
fontSize: 14,
color: AppColors.primaryColor
),
),
)
],
),
),
const SizedBox(height: 16),
const SizedBox(height: 8),
BlocBuilder<EventCubit, EventState>(
builder: (context, state) {
if (state is EventError) {
Expand All @@ -118,37 +122,46 @@ class _HomePageState extends State<HomePage> {
}
},
),
const SizedBox(height: 24),
const SizedBox(height: 12),
Divider(height: 1,
endIndent: 16,
indent: 16,
thickness: 0.5,
color: Theme.of(context).disabledColor.withOpacity(0.1),
),
const SizedBox(height: 8),
Padding(
padding: EdgeInsets.symmetric(horizontal: 24),
padding: const EdgeInsets.symmetric(horizontal: 24,vertical: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Event This Month",
style: TextStyle(
fontWeight: FontWeight.w500, fontSize: 16),
fontWeight: FontWeight.w600,
fontSize: 18),
),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ViewAllPage(isPopularEvent: false,)),
builder: (context) => const ViewAllPage(isPopularEvent: false,)),
);
},
child: const Text(
"View All",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
color: AppColors.greyTextColor),
color: AppColors.primaryColor
),
),
)
],
),
),
const SizedBox(height: 16),
const SizedBox(height: 8),
BlocBuilder<EventCubit, EventState>(
builder: (context, state) {
if (state is EventError) {
Expand All @@ -173,37 +186,45 @@ class _HomePageState extends State<HomePage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
address_locality,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 8),
Row(children: [
SizedBox(width: 4),
Expanded(
flex: 3,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
Image.asset(
'assets/images/location.png',
width: 20,
),
const SizedBox(width: 8),
Text(
address_country,
style: const TextStyle(
fontSize: 14,
color: AppColors.greyTextColor,
fontWeight: FontWeight.w600,
),
),
]),
const SizedBox(height: 8),
Text(
address_country,
style: TextStyle(
fontSize: 12,
color: AppColors.greyTextColor,
fontWeight: FontWeight.w400,
address_locality,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
]),
],
],
),
),
const Spacer(),
GestureDetector(
onTap: () {
// Navigate to the specific page here

Navigator.push(
context,
MaterialPageRoute(builder: (context) => ProfilePage()),
MaterialPageRoute(builder: (context) => const ProfilePage()),
);
},
child: Container(
Expand All @@ -230,7 +251,7 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(50)),
color: AppColors.whiteColor,
color: AppColors.greyLightColor,
),
child: Row(
children: [
Expand All @@ -239,19 +260,28 @@ class _HomePageState extends State<HomePage> {
const Text(
"Search event...",
style: TextStyle(
color: AppColors.greyTextColor, fontWeight: FontWeight.w400),
color: AppColors.greyTextColor,
fontWeight: FontWeight.w500
),
)
],
),
);

_listPopularEvent(List<EventModel> events) => Container(
width: double.infinity,
_listPopularEvent(List<EventModel> events) => SizedBox(
width: MediaQuery.of(context).size.width,
height: 270,
padding: const EdgeInsets.only(left: 16),
child: ListView.builder(
child: Swiper(
physics: const BouncingScrollPhysics(),
scrollDirection: Axis.horizontal,
autoplay: true,
pagination: const SwiperPagination(
alignment: Alignment.bottomCenter
),
control: const SwiperControl(
size: 0,
padding: EdgeInsets.all(0)
),
itemCount: events.length,
itemBuilder: (context, index) => GestureDetector(
onTap: () => Navigator.pushNamed(
Expand All @@ -265,10 +295,10 @@ class _HomePageState extends State<HomePage> {
);

_listEventThisMonth(List<EventModel> events) => Container(
height: 300,
height: 320,
margin: const EdgeInsets.symmetric(horizontal: 24),
child: ListView.builder(
physics: const BouncingScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
itemCount: events.length,
reverse: true,
itemBuilder: (context, index) => BlocBuilder<EventCubit, EventState>(
Expand Down
15 changes: 9 additions & 6 deletions lib/ui/widgets/card_event_this_month.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class CardEventThisMonth extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 90,
height: 95,
margin: const EdgeInsets.only(bottom: 12),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: AppColors.whiteColor,
Expand All @@ -26,8 +26,8 @@ class CardEventThisMonth extends StatelessWidget {
child: Image.network(
eventModel.image,
fit: BoxFit.cover,
width: 60,
height: double.infinity,
width: 75,
height: 75,
),
),
const SizedBox(width: 12),
Expand All @@ -36,7 +36,10 @@ class CardEventThisMonth extends StatelessWidget {
children: [
Text(
eventModel.title,
style: const TextStyle(fontWeight: FontWeight.w500),
style: const TextStyle(
fontSize: 15,
letterSpacing: 0.3,
fontWeight: FontWeight.w700),
),
const SizedBox(height: 4),
Row(
Expand Down Expand Up @@ -64,7 +67,7 @@ class CardEventThisMonth extends StatelessWidget {
const Spacer(),
Container(
height: 50,
width: 35,
width: 50,
decoration: BoxDecoration(
color: AppColors.primaryLightColor,
borderRadius: BorderRadius.circular(10),
Expand Down
Loading

0 comments on commit cd6e55f

Please sign in to comment.