7/31/1
This commit is contained in:
@@ -25,11 +25,24 @@ class InviteDriverScreen extends StatelessWidget {
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
MyTextForm(
|
||||
controller: controller.invitePhoneController,
|
||||
label: 'Enter driver\'s phone'.tr,
|
||||
hint: 'Enter driver\'s phone'.tr,
|
||||
type: TextInputType.phone),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: MyTextForm(
|
||||
controller: controller.invitePhoneController,
|
||||
label: 'Enter driver\'s phone'.tr,
|
||||
hint: 'Enter driver\'s phone'.tr,
|
||||
type: TextInputType.phone,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.contacts),
|
||||
onPressed: () async {
|
||||
await controller.pickContact();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
@@ -49,7 +62,6 @@ class InviteDriverScreen extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
GetBuilder<InviteController>(builder: (controller) {
|
||||
return SizedBox(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
height: Get.height * .4,
|
||||
child: controller.driverInvitationData.isEmpty
|
||||
? Center(
|
||||
@@ -61,7 +73,6 @@ class InviteDriverScreen extends StatelessWidget {
|
||||
: ListView.builder(
|
||||
itemCount: controller.driverInvitationData.length,
|
||||
itemBuilder: (context, index) {
|
||||
// Ensure the 'countOfInvitDriver' key exists and is parseable as an int
|
||||
int countOfInvitDriver = 0;
|
||||
if (controller.driverInvitationData[index]
|
||||
.containsKey('countOfInvitDriver')) {
|
||||
@@ -72,25 +83,24 @@ class InviteDriverScreen extends StatelessWidget {
|
||||
0;
|
||||
}
|
||||
|
||||
// Calculate the progress value, ensuring it is between 0 and 1
|
||||
double progressValue = countOfInvitDriver / 100.0;
|
||||
if (progressValue > 1.0) progressValue = 1.0;
|
||||
if (progressValue < 0.0) progressValue = 0.0;
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
controller.onSelectDriverInvitation(index);
|
||||
},
|
||||
child: Container(
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
controller.onSelectDriverInvitation(index);
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: AppColor.accentColor.withOpacity(
|
||||
.5), // Background color of the container
|
||||
color:
|
||||
AppColor.accentColor.withOpacity(.5),
|
||||
),
|
||||
width: Get.width * .85,
|
||||
child: ClipRRect(
|
||||
@@ -104,10 +114,11 @@ class InviteDriverScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${controller.driverInvitationData[index]['invitorName']} ${controller.driverInvitationData[index]['countOfInvitDriver']} / 100 ${'Trip'.tr}'),
|
||||
],
|
||||
Text(
|
||||
'${controller.driverInvitationData[index]['invitorName']} ${controller.driverInvitationData[index]['countOfInvitDriver']} / 100 ${'Trip'.tr}',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user