You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
5.1 KiB
143 lines
5.1 KiB
3 years ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:teso/Classes/API Clasess/Campaign.dart';
|
||
|
import 'package:teso/providers/pageAnimations.dart';
|
||
|
import 'package:teso/util/consts.dart';
|
||
|
import 'package:jiffy/jiffy.dart';
|
||
|
import 'package:teso/Pages/Sub_Pages/Campaign/AuditionPage.dart';
|
||
|
|
||
|
buildCampaign(BuildContext context, Campaign campaignItem) {
|
||
|
return Container(
|
||
|
width: MediaQuery.of(context).size.width,
|
||
|
//height: 120,
|
||
|
// padding: EdgeInsets.only(
|
||
|
// left: 10,
|
||
|
// right: 10,
|
||
|
// ),
|
||
|
child: Material(
|
||
|
elevation: 2.5,
|
||
|
child: SingleChildScrollView(
|
||
|
scrollDirection: Axis.horizontal,
|
||
|
child: Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||
|
children: [
|
||
|
Container(
|
||
|
width: 90,
|
||
|
height: 95,
|
||
|
decoration: BoxDecoration(
|
||
|
border: Border.all(
|
||
|
color: Colors.grey,
|
||
|
width: 0.5,
|
||
|
),
|
||
|
borderRadius: BorderRadius.only(
|
||
|
topRight: Radius.circular(30),
|
||
|
topLeft: Radius.circular(30),
|
||
|
bottomLeft: Radius.circular(30),
|
||
|
bottomRight: Radius.circular(30),
|
||
|
),
|
||
|
),
|
||
|
child: ClipRRect(
|
||
|
borderRadius: BorderRadius.only(
|
||
|
topLeft: Radius.circular(30.0),
|
||
|
topRight: Radius.circular(30.0),
|
||
|
bottomLeft: Radius.circular(30),
|
||
|
bottomRight: Radius.circular(30),
|
||
|
),
|
||
|
child: Image(
|
||
|
width: MediaQuery.of(context).size.width * 0.28,
|
||
|
height: 110,
|
||
|
fit: BoxFit.fill,
|
||
|
image: NetworkImage(campaignItem.targetProduct != null
|
||
|
? productURL + campaignItem.targetProduct
|
||
|
: ""),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
width: MediaQuery.of(context).size.width - 105,
|
||
|
//height: 110,
|
||
|
padding: EdgeInsets.all(5),
|
||
|
child: Column(
|
||
|
children: [
|
||
|
Container(
|
||
|
width: double.infinity,
|
||
|
child: Wrap(
|
||
|
direction: Axis.horizontal,
|
||
|
children: [
|
||
|
Text(
|
||
|
"Campaign Title : ",
|
||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||
|
),
|
||
|
Text(campaignItem.title)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
width: double.infinity,
|
||
|
child: Wrap(
|
||
|
direction: Axis.horizontal,
|
||
|
children: [
|
||
|
Text(
|
||
|
"Description : ",
|
||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||
|
),
|
||
|
Text(
|
||
|
campaignItem.description.length > 90
|
||
|
? campaignItem.description.substring(0, 90) +
|
||
|
"...."
|
||
|
: campaignItem.description,
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
width: double.infinity,
|
||
|
child: Wrap(
|
||
|
direction: Axis.horizontal,
|
||
|
children: [
|
||
|
Text(
|
||
|
"Start Date : ",
|
||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||
|
),
|
||
|
Text(Jiffy(campaignItem.startDate).yMMMMd),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
Container(
|
||
|
width: double.infinity,
|
||
|
child: Align(
|
||
|
alignment: Alignment.centerRight,
|
||
|
child: Container(
|
||
|
width: 90,
|
||
|
child: ElevatedButton(
|
||
|
style: ElevatedButton.styleFrom(
|
||
|
shape: RoundedRectangleBorder(
|
||
|
borderRadius: BorderRadius.all(
|
||
|
Radius.circular(20.0),
|
||
|
),
|
||
|
),
|
||
|
primary: accentMain,
|
||
|
),
|
||
|
onPressed: () => Navigator.push(
|
||
|
context,
|
||
|
PageTransition(
|
||
|
child: Audition(
|
||
|
campaign: campaignItem,
|
||
|
),
|
||
|
type: PageTransitionType.rightToLeft,
|
||
|
),
|
||
|
),
|
||
|
child: Text("Join"),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|