BASE: Implement Localization In Cab Review Screen.
This commit is contained in:
@@ -87,5 +87,9 @@
|
|||||||
"complain": "Complain",
|
"complain": "Complain",
|
||||||
"distance": "Distance",
|
"distance": "Distance",
|
||||||
"km": "KM",
|
"km": "KM",
|
||||||
"duration": "Duration"
|
"duration": "Duration",
|
||||||
|
"howWasTrip": "How was your trip?",
|
||||||
|
"yourFeedbackWillHelp": "Your feedback will help us improve \n driving experience better",
|
||||||
|
"rateFor": "Rate for",
|
||||||
|
"typeComment": "Type comment...."
|
||||||
}
|
}
|
||||||
@@ -87,10 +87,10 @@ class ConstTexts {
|
|||||||
static String distance = "distance";
|
static String distance = "distance";
|
||||||
static String km = "km";
|
static String km = "km";
|
||||||
static String duration = "duration";
|
static String duration = "duration";
|
||||||
static String couponNotFound = "couponNotFound";
|
static String howWasTrip = "howWasTrip";
|
||||||
static String tapToApply = "tapToApply";
|
static String yourFeedbackWillHelp = "yourFeedbackWillHelp";
|
||||||
static String home = "home";
|
static String rateFor = "rateFor";
|
||||||
static String myBookings = "myBookings";
|
static String typeComment = "typeComment";
|
||||||
static String profile = "profile";
|
static String profile = "profile";
|
||||||
static String wallet = "wallet";
|
static String wallet = "wallet";
|
||||||
static String cabServiceType = "cabServiceType";
|
static String cabServiceType = "cabServiceType";
|
||||||
|
|||||||
@@ -880,7 +880,7 @@ class CabOrderDetails extends StatelessWidget {
|
|||||||
|
|
||||||
// Subtotal
|
// Subtotal
|
||||||
_summaryTile(
|
_summaryTile(
|
||||||
ConstTexts.subtotal.tr(),
|
ConstTexts.subtotal.tr(),
|
||||||
Constant.amountShow(
|
Constant.amountShow(
|
||||||
amount: controller.subTotal.value.toString(),
|
amount: controller.subTotal.value.toString(),
|
||||||
),
|
),
|
||||||
@@ -1004,7 +1004,7 @@ class CabOrderDetails extends StatelessWidget {
|
|||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: AppThemeData.semiBoldTextStyle(
|
style: AppThemeData.semiBoldTextStyle(
|
||||||
fontSize: title == "Order Total" ? 18 : 16,
|
fontSize: title == ConstTexts.orderTotal.tr() ? 18 : 16,
|
||||||
color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900,
|
color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
import 'package:customer/constant/const_texts.dart';
|
||||||
import 'package:customer/controllers/cab_review_controller.dart';
|
import 'package:customer/controllers/cab_review_controller.dart';
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@@ -26,8 +28,22 @@ class CabReviewScreen extends StatelessWidget {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
backgroundColor: AppThemeData.primary300,
|
backgroundColor: AppThemeData.primary300,
|
||||||
leading: GestureDetector(onTap: () => Get.back(), child: Icon(Icons.arrow_back_ios, color: isDark ? Colors.white : Colors.black)),
|
leading: GestureDetector(
|
||||||
title: Text(controller.ratingModel.value != null ? "Update Review".tr : "Add Review".tr, style: TextStyle(color: isDark ? Colors.white : Colors.black, fontSize: 16)),
|
onTap: () => Get.back(),
|
||||||
|
child: Icon(
|
||||||
|
Icons.arrow_back_ios,
|
||||||
|
color: isDark ? Colors.white : Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
controller.ratingModel.value != null
|
||||||
|
? ConstTexts.updateReview.tr()
|
||||||
|
: ConstTexts.addReview.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: isDark ? Colors.white : Colors.black,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
body: Obx(
|
body: Obx(
|
||||||
() =>
|
() =>
|
||||||
@@ -38,11 +54,21 @@ class CabReviewScreen extends StatelessWidget {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 20, top: 50, bottom: 20),
|
padding: const EdgeInsets.only(
|
||||||
|
left: 20,
|
||||||
|
right: 20,
|
||||||
|
top: 50,
|
||||||
|
bottom: 20,
|
||||||
|
),
|
||||||
child: Card(
|
child: Card(
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
|
color:
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
isDark
|
||||||
|
? AppThemeData.greyDark50
|
||||||
|
: AppThemeData.grey50,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 65),
|
padding: const EdgeInsets.only(top: 65),
|
||||||
@@ -50,81 +76,181 @@ class CabReviewScreen extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
// Driver Name
|
// Driver Name
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(
|
||||||
|
top: 8.0,
|
||||||
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
controller.order.value!.driver?.fullName() ?? "",
|
controller.order.value!.driver
|
||||||
style: TextStyle(color: isDark ? Colors.white : Colors.black87, fontFamily: AppThemeData.medium, fontSize: 18),
|
?.fullName() ??
|
||||||
|
"",
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black87,
|
||||||
|
fontFamily: AppThemeData.medium,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Car info
|
// Car info
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
controller.driverUser.value?.carNumber?.toUpperCase() ?? '',
|
controller
|
||||||
style: TextStyle(color: isDark ? Colors.white : Colors.black87, fontFamily: AppThemeData.medium),
|
.driverUser
|
||||||
|
.value
|
||||||
|
?.carNumber
|
||||||
|
?.toUpperCase() ??
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black87,
|
||||||
|
fontFamily: AppThemeData.medium,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
"${controller.driverUser.value?.carName} ${controller.driverUser.value?.carMakes}",
|
"${controller.driverUser.value?.carName} ${controller.driverUser.value?.carMakes}",
|
||||||
style: TextStyle(color: isDark ? Colors.white : Colors.black38, fontFamily: AppThemeData.medium),
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black38,
|
||||||
|
fontFamily: AppThemeData.medium,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
const Padding(padding: EdgeInsets.symmetric(vertical: 12), child: Divider(color: Colors.grey)),
|
const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 12,
|
||||||
|
),
|
||||||
|
child: Divider(color: Colors.grey),
|
||||||
|
),
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 16),
|
padding: const EdgeInsets.only(top: 16),
|
||||||
child: Text('How is your trip?'.tr, style: TextStyle(fontSize: 18, color: isDark ? Colors.white : Colors.black, fontWeight: FontWeight.bold, letterSpacing: 2)),
|
child: Text(
|
||||||
|
ConstTexts.howWasTrip.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
'Your feedback will help us improve \n driving experience better'.tr,
|
ConstTexts.yourFeedbackWillHelp.tr(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(color: isDark ? Colors.white : Colors.black.withOpacity(0.60), letterSpacing: 0.8),
|
style: TextStyle(
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black.withOpacity(
|
||||||
|
0.60,
|
||||||
|
),
|
||||||
|
letterSpacing: 0.8,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Rating
|
// Rating
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 20),
|
padding: const EdgeInsets.only(top: 20),
|
||||||
child: Text('Rate for'.tr, style: TextStyle(fontSize: 16, color: isDark ? Colors.white : Colors.black.withOpacity(0.60), letterSpacing: 0.8)),
|
child: Text(
|
||||||
|
ConstTexts.rateFor.tr(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black.withValues(
|
||||||
|
alpha: 0.60,
|
||||||
|
),
|
||||||
|
letterSpacing: 0.8,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
child: Text(
|
child: Text(
|
||||||
controller.order.value!.driver?.fullName() ?? "",
|
controller.order.value!.driver
|
||||||
style: TextStyle(fontSize: 18, color: isDark ? Colors.white : Colors.black, fontWeight: FontWeight.bold, letterSpacing: 2),
|
?.fullName() ??
|
||||||
|
"",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
color:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: 2,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 10),
|
||||||
child: RatingBar.builder(
|
child: RatingBar.builder(
|
||||||
initialRating: controller.ratings.value,
|
initialRating:
|
||||||
|
controller.ratings.value,
|
||||||
minRating: 1,
|
minRating: 1,
|
||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
allowHalfRating: true,
|
allowHalfRating: true,
|
||||||
itemCount: 5,
|
itemCount: 5,
|
||||||
itemBuilder: (context, _) => const Icon(Icons.star, color: Colors.amber),
|
itemBuilder:
|
||||||
unratedColor: isDark ? AppThemeData.greyDark400 : AppThemeData.grey400,
|
(context, _) => const Icon(
|
||||||
onRatingUpdate: (rating) => controller.ratings.value = rating,
|
Icons.star,
|
||||||
|
color: Colors.amber,
|
||||||
|
),
|
||||||
|
unratedColor:
|
||||||
|
isDark
|
||||||
|
? AppThemeData.greyDark400
|
||||||
|
: AppThemeData.grey400,
|
||||||
|
onRatingUpdate:
|
||||||
|
(rating) =>
|
||||||
|
controller.ratings.value =
|
||||||
|
rating,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Comment
|
// Comment
|
||||||
Padding(padding: const EdgeInsets.all(20.0), child: TextFieldWidget(hintText: "Type comment....".tr, controller: controller.comment.value, maxLine: 5)),
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(20.0),
|
||||||
|
child: TextFieldWidget(
|
||||||
|
hintText: ConstTexts.typeComment.tr(),
|
||||||
|
controller: controller.comment.value,
|
||||||
|
maxLine: 5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Submit Button
|
// Submit Button
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
child: RoundedButtonFill(
|
child: RoundedButtonFill(
|
||||||
borderRadius: 10.r,
|
borderRadius: 10.r,
|
||||||
title: controller.ratingModel.value != null ? "Update Review".tr : "Add Review".tr,
|
title:
|
||||||
|
controller.ratingModel.value !=
|
||||||
|
null
|
||||||
|
? ConstTexts.updateReview.tr()
|
||||||
|
: ConstTexts.addReview.tr(),
|
||||||
color: AppThemeData.primary300,
|
color: AppThemeData.primary300,
|
||||||
textColor: isDark ? Colors.white : Colors.black,
|
textColor:
|
||||||
|
isDark
|
||||||
|
? Colors.white
|
||||||
|
: Colors.black,
|
||||||
onPress: controller.submitReview,
|
onPress: controller.submitReview,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -140,11 +266,28 @@ class CabReviewScreen extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(60),
|
borderRadius: BorderRadius.circular(60),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
boxShadow: [BoxShadow(color: Colors.grey.withOpacity(0.15), blurRadius: 8, spreadRadius: 6)],
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.grey.withValues(alpha: 0.15),
|
||||||
|
blurRadius: 8,
|
||||||
|
spreadRadius: 6,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(60),
|
borderRadius: BorderRadius.circular(60),
|
||||||
child: NetworkImageWidget(imageUrl: controller.order.value?.driver?.profilePictureURL ?? '', fit: BoxFit.cover, height: 110, width: 110),
|
child: NetworkImageWidget(
|
||||||
|
imageUrl:
|
||||||
|
controller
|
||||||
|
.order
|
||||||
|
.value
|
||||||
|
?.driver
|
||||||
|
?.profilePictureURL ??
|
||||||
|
'',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 110,
|
||||||
|
width: 110,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user