Initial commit: Penyerahan final Source code Tugas Akhir
This commit is contained in:
377
lib/screens/checkout/gopay/batas_bayar_gopay.dart
Normal file
377
lib/screens/checkout/gopay/batas_bayar_gopay.dart
Normal file
@ -0,0 +1,377 @@
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:initial_folder/helper/user_info.dart';
|
||||
import 'package:initial_folder/providers/cart_provider.dart';
|
||||
import 'package:initial_folder/providers/carts_provider.dart';
|
||||
import 'package:initial_folder/providers/payments_provider.dart';
|
||||
import 'package:initial_folder/screens/checkout/components/bottom_sheet_detail.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/payment_instruction_gopay.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/qr_code_gopay.dart';
|
||||
import 'package:initial_folder/screens/checkout/success_paid_course.dart';
|
||||
import 'package:initial_folder/size_config.dart';
|
||||
import 'package:initial_folder/theme.dart';
|
||||
import 'package:initial_folder/widgets/login_regist/default_button.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:pusher_client/pusher_client.dart';
|
||||
|
||||
class BatasBayarGopay extends StatefulWidget {
|
||||
final List<String>? idCart;
|
||||
BatasBayarGopay({this.idCart});
|
||||
@override
|
||||
State<BatasBayarGopay> createState() => _BatasBayarGopayState();
|
||||
}
|
||||
|
||||
class _BatasBayarGopayState extends State<BatasBayarGopay> {
|
||||
Channel? _channel;
|
||||
String? statusTransaction;
|
||||
|
||||
Future<void> deleteCourse() async {
|
||||
List<String> idCarts = widget.idCart ?? [];
|
||||
|
||||
idCarts.forEach((element) async {
|
||||
await Provider.of<CartProvider>(context, listen: false)
|
||||
.deleteCart(element);
|
||||
await Provider.of<CartsProvider>(context, listen: false).getCarts();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> initPusher() async {
|
||||
int? idUser = await UsersInfo().getIdUser();
|
||||
|
||||
PusherClient pusher = PusherClient(
|
||||
'92060797e94ac7033edb', PusherOptions(cluster: 'ap1'),
|
||||
autoConnect: false);
|
||||
|
||||
pusher.connect();
|
||||
|
||||
// pusher.onConnectionStateChange((state) {
|
||||
// print(state!.currentState);
|
||||
// });
|
||||
// pusher.onConnectionError((error) {
|
||||
// print(error);
|
||||
// });
|
||||
|
||||
_channel = pusher.subscribe('payment-channel');
|
||||
|
||||
_channel!.bind('paid-event-$idUser', (event) {
|
||||
if (mounted) {
|
||||
final status = jsonDecode(event!.data!);
|
||||
setState(() {
|
||||
statusTransaction = status['status_code'];
|
||||
if (statusTransaction == "201") {
|
||||
print(status['message']);
|
||||
print(widget.idCart);
|
||||
deleteCourse();
|
||||
// Navigator.of(context).pushAndRemoveUntil(
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => SuccessPaidCourse(),
|
||||
// ),
|
||||
// (route) => false,
|
||||
// );
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
initPusher();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var detailOrder = Provider.of<PaymentsProvider>(context).detailOrder;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
'Selesaikan Pembayaran',
|
||||
style: secondaryTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14)),
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
margin:
|
||||
EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(16)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(height: getProportionateScreenHeight(10)),
|
||||
Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Batas akhir pembayaran sampai',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: secondaryColor,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(5)),
|
||||
Text(
|
||||
// 'Rabu, 13 Oktober 2021 (Pukul 19:32)',
|
||||
DateFormat('E, d MMM y (H:m)')
|
||||
.format(detailOrder[0].transactionTimeLimit),
|
||||
style: secondaryTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
color: tenthColor,
|
||||
fontSize: SizeConfig.blockHorizontal! * 3,
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(5)),
|
||||
Text(
|
||||
'Segera selesaikan pembayaran atau pesananmu',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: secondaryColor,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'akan dibatalkan secara otomatis',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: secondaryColor,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(30),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF212121),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: getProportionateScreenWidth(2),
|
||||
right: getProportionateScreenWidth(2)),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16,
|
||||
horizontal: getProportionateScreenWidth(10)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Metode Pembayaran',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(8),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'GoPay',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: getProportionateScreenWidth(50),
|
||||
height: getProportionateScreenWidth(17),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.scaleDown,
|
||||
image: AssetImage('assets/images/gopay2.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(16),
|
||||
),
|
||||
Text(
|
||||
'Kode QR',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(8),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.qr_code),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => QRCodeGopay()));
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(
|
||||
"Scan Kode QR",
|
||||
style: primaryTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(16),
|
||||
),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(8),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Rp. ${NumberFormat.currency(locale: 'id', symbol: '', decimalDigits: 0).format(double.parse(detailOrder[0].totalPayment))}',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(20))),
|
||||
builder: (context) {
|
||||
return BottomSheetDetail();
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"Detail Pembayaran",
|
||||
style: primaryTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(16),
|
||||
),
|
||||
Text(
|
||||
'Status Pembayaran',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Colors.white,
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(8),
|
||||
),
|
||||
Text(
|
||||
statusTransaction == '201' || statusTransaction == null
|
||||
? 'Pending'
|
||||
: 'Success',
|
||||
style: primaryTextStyle.copyWith(
|
||||
color: Color(0xffEDA923),
|
||||
letterSpacing: 1,
|
||||
fontWeight: medium,
|
||||
fontSize: getProportionateScreenWidth(12),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(24),
|
||||
),
|
||||
DefaultButton(
|
||||
text: 'Belanja kursus lainnya',
|
||||
weight: reguler,
|
||||
press: () {
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context, "/home", (r) => false);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(32),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFF212121),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: getProportionateScreenWidth(2),
|
||||
right: getProportionateScreenWidth(2)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16,
|
||||
horizontal: getProportionateScreenWidth(16)),
|
||||
child: Text(
|
||||
'Cara Pembayaran',
|
||||
style: secondaryTextStyle.copyWith(
|
||||
color: tenthColor,
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
color: Color(0xff2D2D2D), thickness: 0.5, height: 0.5),
|
||||
PaymentInstructionGopay()
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: getProportionateScreenHeight(30),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
249
lib/screens/checkout/gopay/bayargopay.dart
Normal file
249
lib/screens/checkout/gopay/bayargopay.dart
Normal file
@ -0,0 +1,249 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:initial_folder/providers/payments_provider.dart';
|
||||
import 'package:initial_folder/screens/checkout/components/bottom_sheet_detail.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/payment_instruction_gopay.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/qr_code_gopay.dart';
|
||||
import 'package:initial_folder/size_config.dart';
|
||||
import 'package:initial_folder/theme.dart';
|
||||
import 'package:initial_folder/widgets/login_regist/default_button.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BayarGopay extends StatelessWidget {
|
||||
BayarGopay({this.idCart});
|
||||
|
||||
final List<String>? idCart;
|
||||
|
||||
static String routeName = "/bayarGopay";
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget bottomNav() {
|
||||
return DefaultButton(
|
||||
text: 'Bayar dengan QRIS',
|
||||
press: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) => GopaySplashScreen(idCart: idCart),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
title: Text(
|
||||
'Bayar Dengan QRIS',
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Consumer<PaymentsProvider>(
|
||||
builder: (context, state, _) {
|
||||
if (state.stateProcess == Process.loading) {
|
||||
return SizedBox(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: Center(child: CircularProgressIndicator()));
|
||||
} else if (state.state == ResultState.gagal) {
|
||||
return Center(child: Text('Terjadi Kesalahan'));
|
||||
} else {
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(16)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: 10),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: getProportionateScreenWidth(2),
|
||||
right: getProportionateScreenWidth(2)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal:
|
||||
getProportionateScreenWidth(15)),
|
||||
child: Text(
|
||||
'Informasi Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onBackground,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
getProportionateScreenWidth(15)),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Order ID',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: reguler,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(10),
|
||||
fontFamily: "Poppins",
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
state.detailOrder[0].idOrder,
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: reguler,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(
|
||||
12),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: state
|
||||
.detailOrder[0].idOrder,
|
||||
)).then(
|
||||
(_) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Berhasil Menyalin Kode Pembayaran'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Salin",
|
||||
style: primaryTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(
|
||||
10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
getProportionateScreenHeight(10)),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: reguler,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(10),
|
||||
fontFamily: "Poppins",
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Rp. ${NumberFormat.currency(locale: 'id', symbol: '').format(double.parse(state.detailOrder[0].totalPayment))}',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(
|
||||
12),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
showModalBottomSheet(
|
||||
backgroundColor:
|
||||
Theme.of(context)
|
||||
.colorScheme
|
||||
.background,
|
||||
elevation: 0.0,
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.vertical(
|
||||
top: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
builder: (context) {
|
||||
return BottomSheetDetail();
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Detail Pembayaran",
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(
|
||||
10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
getProportionateScreenHeight(12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(30)),
|
||||
PaymentInstructionGopay(),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
bottomNav(),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
395
lib/screens/checkout/gopay/gopay_payment_confirmation.dart
Normal file
395
lib/screens/checkout/gopay/gopay_payment_confirmation.dart
Normal file
@ -0,0 +1,395 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_countdown_timer/current_remaining_time.dart';
|
||||
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
||||
import 'package:initial_folder/base_service.dart';
|
||||
import 'package:initial_folder/providers/order_provider.dart';
|
||||
import 'package:initial_folder/providers/payments_provider.dart';
|
||||
import 'package:initial_folder/screens/checkout/components/bottom_sheet_detail.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/payment_instruction_gopay.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../size_config.dart';
|
||||
import '../../../theme.dart';
|
||||
|
||||
class GopayPaymentConfirmation extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var detailOrder =
|
||||
Provider.of<PaymentsProvider>(context, listen: false).detailOrder;
|
||||
var orders = Provider.of<OrderProvider>(context, listen: false).orders;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
centerTitle: true,
|
||||
scrolledUnderElevation: 0.0,
|
||||
title: Text(
|
||||
'Cara Pembayaran',
|
||||
style: secondaryTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: getProportionateScreenWidth(10)),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: getProportionateScreenHeight(290),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
margin: EdgeInsets.symmetric(
|
||||
vertical: getProportionateScreenHeight(9),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10),
|
||||
vertical: getProportionateScreenHeight(15),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Batas Waktu Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontFamily: "Poppins",
|
||||
fontSize: getProportionateScreenWidth(11),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
DateFormat('E, d MMM y H:m WIB')
|
||||
.format(detailOrder[0].transactionTimeLimit),
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
fontSize: SizeConfig.blockHorizontal! * 3,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: sevenColor,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(3),
|
||||
vertical: getProportionateScreenHeight(2),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.access_time,
|
||||
color: baruTextutih,
|
||||
size: getProportionateScreenWidth(14),
|
||||
),
|
||||
SizedBox(width: getProportionateScreenWidth(2)),
|
||||
CountdownTimer(
|
||||
endTime: DateTime.now()
|
||||
.add(Duration(hours: 24))
|
||||
.millisecondsSinceEpoch,
|
||||
widgetBuilder: (_, CurrentRemainingTime? time) {
|
||||
if (time == null) {
|
||||
return Text(
|
||||
'00:00:00',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
letterSpacing: 1,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(10),
|
||||
color: baruTextutih,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
'${time.hours}:${time.min}:${time.sec}',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
letterSpacing: 1,
|
||||
fontSize:
|
||||
getProportionateScreenWidth(10),
|
||||
color: baruTextutih,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(4)),
|
||||
Divider(
|
||||
color: secondaryColor,
|
||||
thickness: 1,
|
||||
),
|
||||
Text(
|
||||
"Kursus",
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontFamily: "Poppins",
|
||||
fontSize: getProportionateScreenWidth(11),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: orders.map((e) {
|
||||
return listCourse(
|
||||
imageUrl: e.imageUrl,
|
||||
instructor: e.instructor,
|
||||
title: e.title,
|
||||
price: e.price,
|
||||
discountPrice: e.discountPrice,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(10)),
|
||||
Text(
|
||||
'Metode Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(5)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"QRIS",
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: getProportionateScreenWidth(50),
|
||||
height: getProportionateScreenWidth(17),
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color:
|
||||
Theme.of(context).colorScheme.brightness ==
|
||||
Brightness.dark
|
||||
? Colors.transparent
|
||||
: baruTexthitam.withOpacity(0.3),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 3,
|
||||
offset: Offset(0, 1),
|
||||
),
|
||||
],
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage("assets/images/qris.png"),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
Text(
|
||||
"Order ID",
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(5)),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
detailOrder[0].idOrder,
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: detailOrder[0].idOrder))
|
||||
.then(
|
||||
(_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Berhasil Menyalin Order ID'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Salin",
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(6)),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Rp. ${NumberFormat.currency(locale: 'id', symbol: '', decimalDigits: 0).format(double.parse(detailOrder[0].totalPayment))}',
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 1,
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: detailOrder[0].totalPayment))
|
||||
.then(
|
||||
(_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'Berhasil Menyalin Total Pembayaran'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Salin",
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
color: primaryColor,
|
||||
fontSize: getProportionateScreenWidth(10),
|
||||
fontWeight: reguler),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(13)),
|
||||
PaymentInstructionGopay(),
|
||||
SizedBox(height: getProportionateScreenHeight(17)),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10)),
|
||||
child: GestureDetector(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
height: getProportionateScreenHeight(42),
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
border: Border.all(
|
||||
color: primaryColor,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Lihat QRIS',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
fontWeight: semiBold,
|
||||
color: baruTextutih,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(21)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget listCourse({
|
||||
String? imageUrl,
|
||||
String? title,
|
||||
String? instructor,
|
||||
String? price,
|
||||
String? discountPrice,
|
||||
int? totalPrices,
|
||||
}) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: getProportionateScreenHeight(9)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: getProportionateScreenWidth(60),
|
||||
height: getProportionateScreenHeight(30),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(imageUrl ??
|
||||
'$baseUrl/uploads/courses_thumbnail/course_thumbnail_default_57.jpg'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: getProportionateScreenWidth(10)),
|
||||
Flexible(
|
||||
flex: 7,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title!,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: thirdTextStyle.copyWith(
|
||||
letterSpacing: 0.5,
|
||||
fontWeight: reguler,
|
||||
fontSize: getProportionateScreenWidth(11),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
102
lib/screens/checkout/gopay/payment_instruction_gopay.dart
Normal file
102
lib/screens/checkout/gopay/payment_instruction_gopay.dart
Normal file
@ -0,0 +1,102 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:styled_text/styled_text.dart';
|
||||
|
||||
import '../../../size_config.dart';
|
||||
import '../../../theme.dart';
|
||||
|
||||
class PaymentInstructionGopay extends StatelessWidget {
|
||||
final TextStyle baris = thirdTextStyle.copyWith(
|
||||
fontFamily: "Poppins",
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
margin: EdgeInsets.only(
|
||||
left: getProportionateScreenWidth(2),
|
||||
right: getProportionateScreenWidth(2)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: getProportionateScreenHeight(15),
|
||||
horizontal: getProportionateScreenWidth(16),
|
||||
),
|
||||
child: Text(
|
||||
'Cara Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontWeight: semiBold,
|
||||
fontSize: getProportionateScreenWidth(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(16)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StyledText(
|
||||
text:
|
||||
'1. Buka aplikasi <bold>Gojek</bold> atau <bold>e-Wallet</bold> apapun milik anda',
|
||||
style: baris,
|
||||
tags: {
|
||||
'bold': StyledTextTag(style: TextStyle(fontWeight: bold)),
|
||||
},
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
StyledText(
|
||||
text:
|
||||
'2. Scan <bold>QR Code</bold> yang tertera dan masukkan nominal sesuai tagihan transaksi',
|
||||
style: baris,
|
||||
tags: {
|
||||
'bold': StyledTextTag(style: TextStyle(fontWeight: bold)),
|
||||
},
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
StyledText(
|
||||
text:
|
||||
'3. Periksa detail transaksi Anda pada aplikasi, lalu tap tombol Bayar.',
|
||||
style: baris,
|
||||
tags: {
|
||||
'bold': StyledTextTag(style: TextStyle(fontWeight: bold)),
|
||||
},
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
StyledText(
|
||||
text: '4. Masukkan pin Anda',
|
||||
style: baris,
|
||||
tags: {
|
||||
'bold': StyledTextTag(style: TextStyle(fontWeight: bold)),
|
||||
},
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
StyledText(
|
||||
text: '5. Transaksi Anda telah selesai',
|
||||
style: baris,
|
||||
tags: {
|
||||
'bold': StyledTextTag(style: TextStyle(fontWeight: bold)),
|
||||
},
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
345
lib/screens/checkout/gopay/qr_code_gopay.dart
Normal file
345
lib/screens/checkout/gopay/qr_code_gopay.dart
Normal file
@ -0,0 +1,345 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:initial_folder/providers/payments_provider.dart';
|
||||
import 'package:initial_folder/screens/checkout/batas_bayar.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/batas_bayar_gopay.dart';
|
||||
import 'package:initial_folder/screens/checkout/gopay/gopay_payment_confirmation.dart';
|
||||
import 'package:initial_folder/screens/profile/account_sign_in/riwayat_transaksi_pending.dart';
|
||||
import 'package:initial_folder/size_config.dart';
|
||||
import 'package:initial_folder/theme.dart';
|
||||
import 'package:initial_folder/widgets/custom_navigator.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class QRCodeGopay extends StatelessWidget {
|
||||
final List<String>? idCart;
|
||||
QRCodeGopay({this.idCart});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var detailOrder =
|
||||
Provider.of<PaymentsProvider>(context, listen: false).detailOrder;
|
||||
return Scaffold(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
scrolledUnderElevation: 0.0,
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10),
|
||||
vertical: getProportionateScreenHeight(10),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/images/qris_background.png",
|
||||
width: getProportionateScreenWidth(328),
|
||||
height: getProportionateScreenHeight(470),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(height: getProportionateScreenHeight(45)),
|
||||
Text(
|
||||
"VOCASIA",
|
||||
style: secondaryTextStyle.copyWith(
|
||||
fontWeight: bold,
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: baruTexthitam,
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(40)),
|
||||
child: Text(
|
||||
"Lakukan pembayaran dengan cara scan code dibawah ini dan lakukan pembayaran sesuai dengan tagihan yang diterima.",
|
||||
textAlign: TextAlign.center,
|
||||
style: secondaryTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(9),
|
||||
color: baruTexthitam,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(15)),
|
||||
Center(
|
||||
child: Container(
|
||||
height: getProportionateScreenHeight(150),
|
||||
width: getProportionateScreenWidth(150),
|
||||
child: Image.network(detailOrder[0].qrCodeUrl!
|
||||
// 'https://api.sandbox.midtrans.com/v2/gopay/916c417c-dd69-455f-9f8d-997b31d38c21/qr-code'
|
||||
),
|
||||
),
|
||||
),
|
||||
// Image.network(),
|
||||
SizedBox(height: getProportionateScreenHeight(5)),
|
||||
Text(
|
||||
'Order ID',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: baruTexthitam,
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(2)),
|
||||
Text(
|
||||
detailOrder[0].idOrder,
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: baruTexthitam,
|
||||
fontWeight: semiBold,
|
||||
letterSpacing: 1,
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(6)),
|
||||
Text(
|
||||
'Total',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: baruTexthitam,
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(2)),
|
||||
Text(
|
||||
'Rp. ${NumberFormat.currency(locale: 'id', symbol: '').format(double.parse(detailOrder[0].totalPayment))}',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: baruTexthitam,
|
||||
fontWeight: semiBold,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
|
||||
// Center(
|
||||
// child: Text(
|
||||
// detailOrder[0].qrCodeUrl!.toString(),
|
||||
// style: thirdTextStyle.copyWith(
|
||||
// fontWeight: semiBold,
|
||||
// fontSize: 14,
|
||||
// color: Color(0xff181818)),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
// GestureDetector(
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.all(16),
|
||||
// width: double.infinity,
|
||||
// height: getProportionateScreenHeight(44),
|
||||
// decoration: BoxDecoration(
|
||||
// color: Color(0xff25D366),
|
||||
// border: Border.all(color: Color(0xff25D366), width: 1),
|
||||
// borderRadius: BorderRadius.circular(10)),
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// 'Pembayaran Gojek',
|
||||
// style: thirdTextStyle.copyWith(
|
||||
// fontSize: 14, color: Color(0xfff4f4f4)),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// onTap: () async {
|
||||
// await openUrl(detailOrder[0].urlGopay!.toString());
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(10)),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10)),
|
||||
child: GestureDetector(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
height: getProportionateScreenHeight(40),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Cara Pembayaran',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(11),
|
||||
fontWeight: semiBold,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.keyboard_arrow_down_outlined,
|
||||
size: getProportionateScreenWidth(22),
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
CustomNavigator(
|
||||
child: GopayPaymentConfirmation(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(20)),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10)),
|
||||
child: GestureDetector(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
height: getProportionateScreenHeight(43),
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
border: Border.all(
|
||||
color: primaryColor,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Unduh QRIS',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
fontWeight: semiBold,
|
||||
color: baruTextutih,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => GopayPaymentConfirmation()));
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: getProportionateScreenWidth(10)),
|
||||
child: GestureDetector(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
width: double.infinity,
|
||||
height: getProportionateScreenHeight(43),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: primaryColor,
|
||||
width: 1,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Cek Status Transaksi',
|
||||
style: thirdTextStyle.copyWith(
|
||||
fontSize: getProportionateScreenWidth(13),
|
||||
color: primaryColor,
|
||||
fontWeight: semiBold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
print(idCart);
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) => BatasBayarGopay(idCart: idCart),
|
||||
// ),
|
||||
// );
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
CustomNavigator(
|
||||
child: RiwayatTransaksiPending(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(height: getProportionateScreenHeight(20)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GopaySplashScreen extends StatefulWidget {
|
||||
final List<String>? idCart;
|
||||
GopaySplashScreen({this.idCart});
|
||||
|
||||
@override
|
||||
State<GopaySplashScreen> createState() => _GopaySplashScreenState();
|
||||
}
|
||||
|
||||
class _GopaySplashScreenState extends State<GopaySplashScreen> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
Timer(
|
||||
Duration(seconds: 2),
|
||||
() => Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => QRCodeGopay(idCart: widget.idCart),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: implement build
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
color: Color(0xff4DC256),
|
||||
alignment: Alignment.center,
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/gopay1.png'),
|
||||
height: 50,
|
||||
),
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> openUrl(String url,
|
||||
{bool forceWebView = false, enableJavaScript = false}) async {
|
||||
await launchUrl(Uri.parse(url));
|
||||
}
|
Reference in New Issue
Block a user