Fix: promos discount query and compact car details layout
This commit is contained in:
@@ -121,7 +121,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 4,
|
||||
margin: const EdgeInsets.only(top: 12, bottom: 8),
|
||||
margin: const EdgeInsets.only(top: 8, bottom: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade300,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
@@ -137,11 +137,11 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
|
||||
// ── Car Selection List ───────────────────────────────
|
||||
SizedBox(
|
||||
height: 170,
|
||||
height: 120,
|
||||
child: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.fromLTRB(20, 8, 20, 12),
|
||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 6),
|
||||
itemCount: carTypes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final carType = carTypes[index];
|
||||
@@ -159,7 +159,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
// ── Promo Code & Actions ─────────────────────────────
|
||||
_buildPromoButton(context, controller),
|
||||
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 10),
|
||||
SizedBox(height: MediaQuery.of(context).padding.bottom + 4),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -174,7 +174,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
Widget _buildHeader(RideLifecycleController controller) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(22, 4, 22, 8),
|
||||
padding: const EdgeInsets.fromLTRB(22, 2, 22, 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -211,7 +211,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 6),
|
||||
// Trip Stats Row
|
||||
Row(
|
||||
children: [
|
||||
@@ -265,7 +265,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
Widget _buildStatChip(
|
||||
{required IconData icon, required String value, required Color color}) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withAlpha(20),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
@@ -303,7 +303,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeOutCubic,
|
||||
width: 108,
|
||||
width: 104,
|
||||
decoration: BoxDecoration(
|
||||
gradient: isSelected
|
||||
? LinearGradient(
|
||||
@@ -338,8 +338,8 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
// Selected indicator
|
||||
if (isSelected)
|
||||
Positioned(
|
||||
top: 6,
|
||||
right: 6,
|
||||
top: 4,
|
||||
right: 4,
|
||||
child: Container(
|
||||
width: 18,
|
||||
height: 18,
|
||||
@@ -364,7 +364,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
|
||||
// Card content
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 10, 8, 8),
|
||||
padding: const EdgeInsets.fromLTRB(6, 6, 6, 6),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@@ -374,11 +374,11 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: Image.asset(
|
||||
carType.image,
|
||||
height: 48,
|
||||
height: 44,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 4),
|
||||
|
||||
// Car name
|
||||
FittedBox(
|
||||
@@ -388,7 +388,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontWeight:
|
||||
isSelected ? FontWeight.w800 : FontWeight.w600,
|
||||
fontSize: 13,
|
||||
fontSize: 12,
|
||||
color: isSelected
|
||||
? AppColor.primaryColor
|
||||
: AppColor.writeColor,
|
||||
@@ -397,12 +397,12 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 3),
|
||||
|
||||
// Price tag
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColor.primaryColor
|
||||
@@ -443,14 +443,14 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
if (controller.promoTaken) return const SizedBox.shrink();
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 6, 20, 4),
|
||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 2),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => _showPromoCodeDialog(context, controller),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 14),
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
@@ -951,7 +951,11 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildRayehGaiOption(BuildContext context, RideLifecycleController mapPassengerController, String carTypeName, String price) {
|
||||
Widget _buildRayehGaiOption(
|
||||
BuildContext context,
|
||||
RideLifecycleController mapPassengerController,
|
||||
String carTypeName,
|
||||
String price) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
Reference in New Issue
Block a user