12/12/1
This commit is contained in:
@@ -18,137 +18,136 @@ class HelpCaptain extends StatelessWidget {
|
||||
return MyScafolld(
|
||||
title: 'Helping Page'.tr,
|
||||
body: [
|
||||
Positioned(
|
||||
top: Get.height * .025,
|
||||
right: 20,
|
||||
left: 20,
|
||||
child: Card(
|
||||
color: AppColor.yellowColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: Get.height * .15,
|
||||
right: 20,
|
||||
left: 20,
|
||||
child: Card(
|
||||
elevation: 3,
|
||||
color: AppColor.secondaryColor,
|
||||
Column(
|
||||
children: [
|
||||
Card(
|
||||
color: AppColor.yellowColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<HelpController>(
|
||||
builder: (helpController) => Form(
|
||||
key: helpController.formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: helpController.helpQuestionController,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Enter your Question here',
|
||||
labelText: 'Question',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your Question.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
helpController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (helpController.formKey.currentState!
|
||||
.validate()) {
|
||||
helpController.addHelpQuestion();
|
||||
|
||||
// Clear the feedback form
|
||||
helpController.formKey.currentState!
|
||||
.reset();
|
||||
}
|
||||
},
|
||||
title: 'Submit Question'.tr,
|
||||
),
|
||||
],
|
||||
)),
|
||||
child: Text(
|
||||
'If you need any help or have question this is right site to do that and your welcome'
|
||||
.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
)),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 3,
|
||||
right: 8,
|
||||
left: 8,
|
||||
child: GetBuilder<HelpController>(
|
||||
builder: (helpController) => Container(
|
||||
height: Get.height * .63,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
helpController.helpQuestionDate['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var list =
|
||||
helpController.helpQuestionDate['message'][index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
),
|
||||
Card(
|
||||
elevation: 3,
|
||||
color: AppColor.secondaryColor,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: GetBuilder<HelpController>(
|
||||
builder: (helpController) => Form(
|
||||
key: helpController.formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .8,
|
||||
child: TextFormField(
|
||||
controller:
|
||||
helpController.helpQuestionController,
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
hintText: 'Enter your Question here',
|
||||
labelText: 'Question',
|
||||
),
|
||||
borderRadius: BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController
|
||||
.getHelpRepley(list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Please enter your Question.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
helpController.isLoading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (helpController.formKey.currentState!
|
||||
.validate()) {
|
||||
helpController.addHelpQuestion();
|
||||
|
||||
// Clear the feedback form
|
||||
helpController.formKey.currentState!
|
||||
.reset();
|
||||
}
|
||||
},
|
||||
title: 'Submit Question'.tr,
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
)),
|
||||
GetBuilder<HelpController>(
|
||||
builder: (helpController) => Container(
|
||||
height: 400,
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: ListView.builder(
|
||||
itemCount: helpController.helpQuestionDate['message'] !=
|
||||
null
|
||||
? helpController.helpQuestionDate['message'].length
|
||||
: 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
// if (helpController.helpQuestionDate['message'] ==
|
||||
// null) {
|
||||
// return const CircularProgressIndicator();
|
||||
// }
|
||||
var list =
|
||||
helpController.helpQuestionDate['message'][index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(3),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: AppColor.greenColor,
|
||||
width: 3,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(11)),
|
||||
// elevation: 3,
|
||||
// color: AppColor.greenColor,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
print(list['id']);
|
||||
helpController.getindex(
|
||||
list['id'], list['helpQuestion']);
|
||||
helpController
|
||||
.getHelpRepley(list['id'].toString());
|
||||
Get.to(
|
||||
() => const HelpDetailsReplayPage(),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: Get.width * .6,
|
||||
child: Text(
|
||||
list['helpQuestion'],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
SizedBox(
|
||||
width: Get.width * .3,
|
||||
child: Text(
|
||||
list['datecreated'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)),
|
||||
)
|
||||
);
|
||||
},
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
|
||||
@@ -197,23 +197,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
)),
|
||||
PassengerWalletDialoge(),
|
||||
GetBuilder<PaymentController>(
|
||||
builder: (controller) => Positioned(
|
||||
top: 440,
|
||||
right: 100,
|
||||
left: 100,
|
||||
child: Column(
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'createConnectAccount',
|
||||
onPressed: () {
|
||||
controller.createConnectAccount();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
const PassengerWalletDialoge(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class PointsCaptain extends StatelessWidget {
|
||||
await paymentController.makePaymentStripe(pricePoint, 'USD', () async {
|
||||
await captainWalletController.addDriverPayment('visa', pricePoint);
|
||||
await captainWalletController.addDriverWallet('visa', countPoint);
|
||||
await captainWalletController.getCaptainWalletFromBuyPoints();
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -32,16 +32,32 @@ class WaletCaptain extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Card(
|
||||
elevation: 4,
|
||||
const SizedBox(),
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration.copyWith(
|
||||
color: double.parse(
|
||||
captainWalletController.totalPoints) <
|
||||
100
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: Text(
|
||||
'Total Points is ${captainWalletController.totalPoints} 💎',
|
||||
'Total Points is ${captainWalletController.totalPoints.toString()} 💎',
|
||||
style: AppStyle.headtitle2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
double.parse(captainWalletController.totalPoints
|
||||
.toString()) <
|
||||
100
|
||||
? MyElevatedButton(
|
||||
title: 'Charge your Account', onPressed: () {})
|
||||
: const SizedBox(),
|
||||
Card(
|
||||
elevation: 4,
|
||||
child: Padding(
|
||||
@@ -93,30 +109,39 @@ class WaletCaptain extends StatelessWidget {
|
||||
const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Create Wallet to recive your money',
|
||||
onPressed: () async {
|
||||
PaymentController paymentController =
|
||||
Get.find<PaymentController>();
|
||||
paymentController.createConnectAccount();
|
||||
}),
|
||||
],
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
PaymentController paymentController =
|
||||
Get.put(PaymentController());
|
||||
await paymentController.createTransactionToCaptain(
|
||||
'1000',
|
||||
box.read(BoxName.accountIdStripeConnect));
|
||||
},
|
||||
child: const Text(
|
||||
"Pay to Captain",
|
||||
),
|
||||
)
|
||||
box
|
||||
.read(BoxName.accountIdStripeConnect)
|
||||
.toString()
|
||||
.isEmpty
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title:
|
||||
'Create Wallet to recive your money',
|
||||
onPressed: () async {
|
||||
PaymentController paymentController =
|
||||
Get.find<PaymentController>();
|
||||
paymentController
|
||||
.createConnectAccount();
|
||||
}),
|
||||
],
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () async {
|
||||
// PaymentController paymentController =
|
||||
// Get.put(PaymentController());
|
||||
// await paymentController.createTransactionToCaptain(
|
||||
// '1000',
|
||||
// box.read(BoxName.accountIdStripeConnect));
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Pay to Captain",
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user