From c90885d8ddd9c0dc53810de61710e26528a6c306 Mon Sep 17 00:00:00 2001 From: Paras1089 Date: Fri, 7 Jun 2024 22:02:54 +0530 Subject: [PATCH 1/2] evenSreen --- lib/custom_widgets/event_page_cards.dart | 82 ++++++++++++++++++++++++ lib/screens/event_screen.dart | 29 ++++++++- lib/screens/landing_screen.dart | 3 +- pubspec.lock | 56 +++++++++++----- 4 files changed, 152 insertions(+), 18 deletions(-) create mode 100644 lib/custom_widgets/event_page_cards.dart diff --git a/lib/custom_widgets/event_page_cards.dart b/lib/custom_widgets/event_page_cards.dart new file mode 100644 index 0000000..9295cb3 --- /dev/null +++ b/lib/custom_widgets/event_page_cards.dart @@ -0,0 +1,82 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class EventPageCards extends StatelessWidget { + const EventPageCards( + {super.key, + required this.categoryName, + required this.imageList, + required this.eventName}); + final String categoryName; + final String eventName; + final List imageList; + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 10), + child: Row( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Title( + color: Colors.black, + child: Text( + categoryName, + style: GoogleFonts.inriaSerif( + fontWeight: FontWeight.w400, fontSize: 18), + )), + Icon(Icons.filter_list, color: Colors.grey, size: 20.0), + ], + ), + ], + ), + ), + Container( + child: SizedBox( + width: 400, + height: 150, + child: ListView.builder( + shrinkWrap: true, + physics: const BouncingScrollPhysics(), + scrollDirection: Axis.horizontal, + itemCount: imageList.length, + itemBuilder: (context, index) { + return GestureDetector( + onTap: () {}, + child: Column( + children: [ + SizedBox( + height: 100, + width: 150, + child: Image.asset( + imageList[index], + width: 150, + height: 150, + ), + ), + Title(color: Colors.black, + child: Text( + eventName, + style: GoogleFonts.inriaSerif( + fontWeight: FontWeight.w400, fontSize: 18), + )) + ], + ), + ); + }, + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/event_screen.dart b/lib/screens/event_screen.dart index 080d3a6..b4d4470 100644 --- a/lib/screens/event_screen.dart +++ b/lib/screens/event_screen.dart @@ -1,10 +1,37 @@ +import 'package:dit_events/custom_widgets/event_page_cards.dart'; import 'package:flutter/material.dart'; +import '../custom_widgets/club_list.dart'; + class EventScreen extends StatelessWidget { const EventScreen({super.key}); @override Widget build(BuildContext context) { - return Text('This is event screen'); + return Column( + children: [ + const EventPageCards( + categoryName: 'UPCOMING EVENTS', + imageList: [ + 'Assets/photo1.png', + 'Assets/photo1.png', + 'Assets/photo1.png', + 'Assets/photo1.png', + 'Assets/photo1.png', + ], + eventName: 'Name', + ), + const EventPageCards( + categoryName: 'PAST EVENTS', + imageList: [ + 'Assets/photo1.png', + 'Assets/photo1.png', + 'Assets/photo1.png', + ], + eventName: 'Name 2', + ), + ], + ); + Text('This is event screen'); } } diff --git a/lib/screens/landing_screen.dart b/lib/screens/landing_screen.dart index 8485dcd..8debe58 100644 --- a/lib/screens/landing_screen.dart +++ b/lib/screens/landing_screen.dart @@ -1,3 +1,4 @@ +import 'package:dit_events/screens/event_screen.dart'; import 'package:dit_events/screens/naa_screen.dart'; import 'package:flutter/material.dart'; @@ -7,7 +8,7 @@ class LandingScreen extends StatelessWidget { @override Widget build(BuildContext context) { return const Scaffold( - body: NewsScreen(), + body: EventScreen(), ); } } diff --git a/pubspec.lock b/pubspec.lock index aeda3d4..aa86c12 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -115,6 +115,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -127,34 +151,34 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.12.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: @@ -268,10 +292,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" typed_data: dependency: transitive description: @@ -288,14 +312,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: + vm_service: dependency: transitive description: - name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "14.2.1" win32: dependency: transitive description: @@ -313,5 +337,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" From ac1c0fd32a8e55c709829410a59df12c76bc6a2a Mon Sep 17 00:00:00 2001 From: Paras1089 Date: Sat, 8 Jun 2024 22:24:30 +0530 Subject: [PATCH 2/2] eventScreen --- lib/custom_widgets/event_page_cards.dart | 62 +++++++++++++----------- lib/screens/event_screen.dart | 4 +- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/lib/custom_widgets/event_page_cards.dart b/lib/custom_widgets/event_page_cards.dart index 9295cb3..5cf9ffd 100644 --- a/lib/custom_widgets/event_page_cards.dart +++ b/lib/custom_widgets/event_page_cards.dart @@ -8,7 +8,7 @@ class EventPageCards extends StatelessWidget { required this.imageList, required this.eventName}); final String categoryName; - final String eventName; + final List eventName; final List imageList; @override Widget build(BuildContext context) { @@ -22,19 +22,21 @@ class EventPageCards extends StatelessWidget { padding: const EdgeInsets.fromLTRB(16, 0, 16, 10), child: Row( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - //crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Title( - color: Colors.black, - child: Text( - categoryName, - style: GoogleFonts.inriaSerif( - fontWeight: FontWeight.w400, fontSize: 18), - )), - Icon(Icons.filter_list, color: Colors.grey, size: 20.0), - ], + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + //crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Title( + color: Colors.black, + child: Text( + categoryName, + style: GoogleFonts.inriaSerif( + fontWeight: FontWeight.w400, fontSize: 18), + )), + Icon(Icons.filter_list, color: Colors.grey, size: 32.0), + ], + ), ), ], ), @@ -42,7 +44,7 @@ class EventPageCards extends StatelessWidget { Container( child: SizedBox( width: 400, - height: 150, + height: 300, child: ListView.builder( shrinkWrap: true, physics: const BouncingScrollPhysics(), @@ -54,20 +56,26 @@ class EventPageCards extends StatelessWidget { child: Column( children: [ SizedBox( - height: 100, - width: 150, - child: Image.asset( - imageList[index], - width: 150, - height: 150, + height: 290, + width: 250, + child: Column( + children: [ + Image.asset( + imageList[index], + width: 200, + height: 260, + ), + Title( + color: Colors.black, + child: Text( + eventName[index], + style: GoogleFonts.inriaSerif( + fontWeight: FontWeight.w400, + fontSize: 20), + )) + ], ), ), - Title(color: Colors.black, - child: Text( - eventName, - style: GoogleFonts.inriaSerif( - fontWeight: FontWeight.w400, fontSize: 18), - )) ], ), ); diff --git a/lib/screens/event_screen.dart b/lib/screens/event_screen.dart index b4d4470..542cdd9 100644 --- a/lib/screens/event_screen.dart +++ b/lib/screens/event_screen.dart @@ -19,7 +19,7 @@ class EventScreen extends StatelessWidget { 'Assets/photo1.png', 'Assets/photo1.png', ], - eventName: 'Name', + eventName:[ 'Name', 'name3','name4','name5','name6'] ), const EventPageCards( categoryName: 'PAST EVENTS', @@ -28,7 +28,7 @@ class EventScreen extends StatelessWidget { 'Assets/photo1.png', 'Assets/photo1.png', ], - eventName: 'Name 2', + eventName: ['Name 2','name7','name8',] ), ], );