Import 'Packagefluttermaterial - Dart
Import 'Packagefluttermaterial - Dart
dart';
import 'package:gap/gap.dart';
import 'package:garpo_application/widgets/vertical_dashlines.dart';
import '../utils/app_layout.dart';
import '../utils/app_styles.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
@override
_VoucherState createState() => _VoucherState();
}
@override
Widget build(BuildContext context) {
//print('Ticket number is ${ticket['number']}');
final size = AppLayout.getSize(context);
return SizedBox(
width: size.width * 0.85,
height: AppLayout.getHeight(105),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
margin: EdgeInsets.only(
right: AppLayout.getWidth(10), bottom: AppLayout.getHeight(5)),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
//P200off
Container(
width: AppLayout.getWidth(88),
decoration: BoxDecoration(
color: const Color(0xFF526799),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(AppLayout.getHeight(21)),
bottomLeft: Radius.circular(AppLayout.getWidth(21))),
),
padding: EdgeInsets.all(AppLayout.getHeight(12)),
child: Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RichText(
text: TextSpan(
style: Styles.headLineStyle2
.copyWith(color: Colors.white),
//style: DefaultTextStyle.of(context.style),
children: <TextSpan>[
const TextSpan(text: "₱"),
TextSpan(
text: "${widget.vouch['vworth']}",
style: Styles.headLineStyle1
.copyWith(color: Colors.white)),
])),
Gap(AppLayout.getHeight(3)),
Text(
"Available until",
style: Styles.headLineStyle6
.copyWith(color: Colors.white, fontSize: 7),
),
Text(
"${widget.vouch['vexpire']}",
style: Styles.headLineStyle6
.copyWith(color: Colors.white, fontSize: 7),
),
],
)
],
),
),
//lines
Container(
width: AppLayout.getWidth(15),
//padding: EdgeInsets.all(AppLayout.getHeight(6)),
color: const Color(0xFF526799), //const Color (0xFFF37B67),
child: Column(
children: [
SizedBox(
height: AppLayout.getHeight(10),
width: AppLayout.getWidth(20),
child: DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight:
Radius.circular(AppLayout.getWidth(20)),
bottomLeft:
Radius.circular(AppLayout.getWidth(20)),
))),
),
Container(
height: AppLayout.getHeight(80),
width: double.infinity,
margin: EdgeInsets.only(
right: AppLayout.getWidth(5),
left: AppLayout.getWidth(5),
),
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius:
BorderRadius.circular(AppLayout.getHeight(18)),
),
child: const VerticalDash(),
),
SizedBox(
height: AppLayout.getHeight(10),
width: AppLayout.getWidth(20),
child: DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(AppLayout.getWidth(20)),
topRight:
Radius.circular(AppLayout.getWidth(20)),
))),
)
],
),
),
//rest ticket
Container(
//height: AppLayout.getHeight(100),
width: AppLayout.getWidth(200),
decoration: BoxDecoration(
color: const Color(0xFF526799),
borderRadius: BorderRadius.only(
topRight: Radius.circular(AppLayout.getHeight(21)),
bottomRight:
Radius.circular(AppLayout.getWidth(21)))),
padding: EdgeInsets.all(AppLayout.getHeight(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: AppLayout.getHeight(30),
width: AppLayout.getHeight(30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
AppLayout.getHeight(8)),
color: Colors.white,
border:
Border.all(color: Colors.grey.shade300),
image: DecorationImage(
image: AssetImage(
"assets/images/$
{widget.vouch['vlogo']}"))),
),
Gap(AppLayout.getWidth(5)),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${widget.vouch['vname']}",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.white),
),
Gap(AppLayout.getHeight(3)),
Text(
"${widget.vouch['vinfo']}",
style: TextStyle(
color: Colors.white,
fontSize: 7,
fontWeight: FontWeight.w400),
),
],
)
],
),
Gap(AppLayout.getWidth(30)),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
Icons.stars,
color: Colors.lightBlueAccent.shade400,
size: 15.0,
),
Gap(AppLayout.getWidth(2)),
Text(
"${widget.vouch['vpts']} pts",
style: Styles.headLineStyle6.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600),
),
Gap(AppLayout.getWidth(40)),
GestureDetector(
onTap: _redeemPoints,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
AppLayout.getHeight(10)),
color: Colors.blueAccent,
border: Border.all(
color: Colors.lightBlueAccent)),
padding: const EdgeInsets.symmetric(
horizontal: 3, vertical: 3),
child: const Text(" Use Now ",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 10))),
),
])
/* Gap(AppLayout.getHeight(30)),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
Icons.stars,
color: Colors.lightBlueAccent.shade400,
size: 15.0,
),
Gap(AppLayout.getWidth(2)),
Text(
"${widget.vouch['vpts']} pts",
style: Styles.headLineStyle6.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600),
),
Gap(AppLayout.getWidth(60)),
SizedBox(
height: AppLayout.getHeight(20),
width: AppLayout.getWidth(50),
child: ElevatedButton(
onPressed: () {
// add your onPressed logic here
},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppLayout.getHeight(10)),
side: const BorderSide(
color: Colors.lightBlueAccent),
),
backgroundColor: Colors.blueAccent,
),
child: const Text(
"Get",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 10,
),
),
),
),
],
) */
],
)
],
),
)
],
)),
),
);
}
}