-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added route for event purchase view
- Loading branch information
Showing
6 changed files
with
233 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
import 'package:cached_network_image/cached_network_image.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
import 'package:pylons_wallet/components/space_widgets.dart'; | ||
import 'package:pylons_wallet/model/event.dart'; | ||
import 'package:pylons_wallet/utils/constants.dart'; | ||
|
||
class EventPurchaseView extends StatefulWidget { | ||
const EventPurchaseView({super.key, required this.events}); | ||
|
||
final Events events; | ||
|
||
@override | ||
State<EventPurchaseView> createState() => _EventPurchaseViewState(); | ||
} | ||
|
||
class _EventPurchaseViewState extends State<EventPurchaseView> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return EventPassViewContent( | ||
events: widget.events, | ||
); | ||
} | ||
} | ||
|
||
class EventPassViewContent extends StatelessWidget { | ||
const EventPassViewContent({ | ||
super.key, | ||
required this.events, | ||
}); | ||
|
||
final Events events; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return ColoredBox( | ||
color: AppColors.kBlack87, | ||
child: SafeArea( | ||
child: Scaffold( | ||
backgroundColor: AppColors.kBlack87, | ||
appBar: AppBar( | ||
backgroundColor: Colors.black, | ||
flexibleSpace: Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 20.w), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
const Icon( | ||
Icons.arrow_back_ios, | ||
color: AppColors.kWhite, | ||
), | ||
Text( | ||
'Event Pass', | ||
style: TextStyle( | ||
fontSize: 18.sp, | ||
fontWeight: FontWeight.w700, | ||
color: AppColors.kWhite, | ||
), | ||
), | ||
GestureDetector( | ||
onTap: () {}, | ||
child: SvgPicture.asset(shareIcon), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
body: Column( | ||
children: [ | ||
Container( | ||
margin: EdgeInsets.symmetric(horizontal: 20.w), | ||
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h), | ||
decoration: BoxDecoration(color: AppColors.kBlue), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
events.eventName, | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontSize: 25.sp, fontWeight: FontWeight.w700, color: AppColors.kWhite), | ||
), | ||
VerticalSpace(20.h), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Date', | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontSize: 11.sp, fontWeight: FontWeight.w400, color: AppColors.kWhite), | ||
), | ||
Text( | ||
events.startDate, | ||
style: Theme.of(context).textTheme.labelSmall?.copyWith(fontSize: 15.sp, fontWeight: FontWeight.w700, color: AppColors.kWhite), | ||
), | ||
], | ||
), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Time', | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontSize: 11.sp, fontWeight: FontWeight.w400, color: AppColors.kWhite), | ||
), | ||
Text( | ||
events.startTime, | ||
style: Theme.of(context).textTheme.labelSmall?.copyWith(fontSize: 15.sp, fontWeight: FontWeight.w700, color: AppColors.kWhite), | ||
), | ||
], | ||
) | ||
], | ||
), | ||
VerticalSpace(20.h), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'LOCATION', | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontSize: 11.sp, fontWeight: FontWeight.w400, color: AppColors.kWhite), | ||
), | ||
Text( | ||
events.location, | ||
style: Theme.of(context).textTheme.labelSmall?.copyWith(fontSize: 15.sp, fontWeight: FontWeight.w700, color: AppColors.kWhite), | ||
), | ||
], | ||
), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'PRICE', | ||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontSize: 11.sp, fontWeight: FontWeight.w400, color: AppColors.kWhite), | ||
), | ||
Text( | ||
events.price == "0" ? "Free" : events.price, | ||
style: Theme.of(context).textTheme.labelSmall?.copyWith(fontSize: 15.sp, fontWeight: FontWeight.w700, color: AppColors.kWhite), | ||
), | ||
], | ||
) | ||
], | ||
), | ||
VerticalSpace(20.h), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'PERKS', | ||
style: TextStyle(fontSize: 11.sp, fontWeight: FontWeight.w400, color: AppColors.kWhite), | ||
), | ||
SizedBox(height: 1.h), | ||
Row( | ||
children: [ | ||
SvgPicture.asset(kDiamondIcon), | ||
SizedBox(width: 5.w), | ||
Text( | ||
'x ${events.listOfPerks?.length}', | ||
style: TextStyle(fontSize: 15.sp, color: AppColors.kWhite, fontWeight: FontWeight.bold), | ||
), | ||
SizedBox(width: 5.w), | ||
Text( | ||
'Redeem', | ||
style: TextStyle(fontSize: 15.sp, color: AppColors.kGreenText, fontWeight: FontWeight.bold), | ||
) | ||
], | ||
) | ||
], | ||
), | ||
], | ||
), | ||
], | ||
), | ||
), | ||
Container( | ||
margin: EdgeInsets.symmetric(horizontal: 20.w), | ||
child: CachedNetworkImage( | ||
fit: BoxFit.fill, | ||
imageUrl: events.thumbnail, | ||
errorWidget: (a, b, c) => const Center( | ||
child: Icon( | ||
Icons.error_outline, | ||
color: AppColors.kWhite, | ||
)), | ||
// placeholder: (context, url) => Shimmer(color: AppColors.kLightGray, child: const SizedBox.expand()), | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters