editing card details
This commit is contained in:
parent
5a2f57f714
commit
dc864eb2f7
5368
assets/icons/App Screen-1.svg
Normal file
5368
assets/icons/App Screen-1.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 404 KiB |
4086
assets/icons/App Screen-2.svg
Normal file
4086
assets/icons/App Screen-2.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 307 KiB |
4551
assets/icons/App Screen-3.svg
Normal file
4551
assets/icons/App Screen-3.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 342 KiB |
|
|
@ -23,4 +23,5 @@ class EndPoint {
|
||||||
static String favorite = 'favorite';
|
static String favorite = 'favorite';
|
||||||
static String editCard(int id) => 'card/$id';
|
static String editCard(int id) => 'card/$id';
|
||||||
static String search = 'card';
|
static String search = 'card';
|
||||||
|
static String rate = 'rate';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,11 +161,11 @@ class RoutingManager {
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: RouteName.feedback,
|
name: RouteName.feedback,
|
||||||
page: () => const FeedbackScreen(),
|
page: () => FeedbackScreen(),
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: RouteName.reviewForm,
|
name: RouteName.reviewForm,
|
||||||
page: () => const ReviewFormScreen(),
|
page: () => ReviewFormScreen(),
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: RouteName.imageView,
|
name: RouteName.imageView,
|
||||||
|
|
|
||||||
|
|
@ -163,30 +163,30 @@ class AccountScreen extends StatelessWidget {
|
||||||
// ).paddingOnly(bottom: 0),
|
// ).paddingOnly(bottom: 0),
|
||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
AccountWidget(
|
// AccountWidget(
|
||||||
icon: "my cards.svg",
|
// icon: "my cards.svg",
|
||||||
title: "my_cards".tr,
|
// title: "my_cards".tr,
|
||||||
).onTap(() async {
|
// ).onTap(() async {
|
||||||
if (authController.isGuest.value) {
|
// if (authController.isGuest.value) {
|
||||||
Get.defaultDialog(
|
// Get.defaultDialog(
|
||||||
title: '',
|
// title: '',
|
||||||
content: Column(
|
// content: Column(
|
||||||
children: [
|
// children: [
|
||||||
BoldTextWidget('you_have_to_sign_in'.tr),
|
// BoldTextWidget('you_have_to_sign_in'.tr),
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 20,
|
// height: 20,
|
||||||
),
|
// ),
|
||||||
ButtonWidget(
|
// ButtonWidget(
|
||||||
onTap: () {
|
// onTap: () {
|
||||||
RoutingManager.off(RouteName.login);
|
// RoutingManager.off(RouteName.login);
|
||||||
},
|
// },
|
||||||
title: 'sign_in'.tr)
|
// title: 'sign_in'.tr)
|
||||||
],
|
// ],
|
||||||
));
|
// ));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
RoutingManager.to(RouteName.myCards);
|
// RoutingManager.to(RouteName.myCards);
|
||||||
}),
|
// }),
|
||||||
AccountWidget(
|
AccountWidget(
|
||||||
icon: "about us.svg",
|
icon: "about us.svg",
|
||||||
title: "about_us".tr,
|
title: "about_us".tr,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import 'package:taafee_mobile/features/card/data_layer/model/add_card.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/card_images.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/card_images.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/edit_card.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/edit_card.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/feedback.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/rate.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
import 'package:taafee_mobile/features/card/data_layer/source/card_service.dart';
|
||||||
import 'package:rx_future/rx_future.dart';
|
import 'package:rx_future/rx_future.dart';
|
||||||
|
|
||||||
|
|
@ -244,4 +246,19 @@ class CardController extends GetxController {
|
||||||
void changeCurrentIndex(int index) {
|
void changeCurrentIndex(int index) {
|
||||||
currentIndex.value = index;
|
currentIndex.value = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RateModel rateModel = RateModel.zero();
|
||||||
|
RxFuture<void> sendRatingState = RxFuture(null);
|
||||||
|
Future<void> sendRating() async {
|
||||||
|
await sendRatingState.observe((p0) async {
|
||||||
|
await cardService.sendRating(rateModel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
RxFuture<List<FeedbackModel>> feedbackState = RxFuture(<FeedbackModel>[]);
|
||||||
|
Future<void> getFeedback(int cardId) async {
|
||||||
|
await feedbackState.observe((p0) async {
|
||||||
|
return await cardService.getFeedback(cardId);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/work_schedules.dart';
|
||||||
import 'package:taafee_mobile/features/home/data_layer/model/city.dart';
|
import 'package:taafee_mobile/features/home/data_layer/model/city.dart';
|
||||||
|
|
||||||
import 'card_images.dart';
|
import 'card_images.dart';
|
||||||
|
|
@ -17,6 +18,11 @@ class CardModel {
|
||||||
String additionalData;
|
String additionalData;
|
||||||
List<CardImages> cardImages;
|
List<CardImages> cardImages;
|
||||||
bool isFav;
|
bool isFav;
|
||||||
|
int price;
|
||||||
|
String lat;
|
||||||
|
String lan;
|
||||||
|
WorkScheduleModel? workScheduleModel;
|
||||||
|
int avgRating;
|
||||||
|
|
||||||
CardModel(
|
CardModel(
|
||||||
{required this.id,
|
{required this.id,
|
||||||
|
|
@ -31,22 +37,33 @@ class CardModel {
|
||||||
required this.website,
|
required this.website,
|
||||||
required this.additionalData,
|
required this.additionalData,
|
||||||
required this.cardImages,
|
required this.cardImages,
|
||||||
required this.isFav});
|
required this.isFav,
|
||||||
|
required this.price,
|
||||||
|
required this.lat,
|
||||||
|
required this.lan,
|
||||||
|
this.workScheduleModel,
|
||||||
|
required this.avgRating});
|
||||||
|
|
||||||
factory CardModel.fromJson(Map<String, dynamic> json) => CardModel(
|
factory CardModel.fromJson(Map<String, dynamic> json) => CardModel(
|
||||||
id: json["id"],
|
id: json["id"],
|
||||||
name: json["name"],
|
name: json["name"],
|
||||||
cityModel: CityModel.fromJson(json["city"]),
|
cityModel: CityModel.fromJson(json["city"]),
|
||||||
address: json["address"],
|
address: json["address"],
|
||||||
postalCode: json["postal_code"],
|
postalCode: json["postal_code"],
|
||||||
phoneNumber: json["phone_number1"],
|
phoneNumber: json["phone_number1"],
|
||||||
services: json["services"],
|
services: json["services"],
|
||||||
categoryId: json["category_id"] ?? json['category']['id'],
|
categoryId: json["category_id"] ?? json['category']['id'],
|
||||||
user: User.fromJson(json["user"]),
|
user: User.fromJson(json["user"]),
|
||||||
website: json["website"],
|
website: json["website"],
|
||||||
additionalData: json["additional_data"],
|
additionalData: json["additional_data"],
|
||||||
cardImages: CardImages.fromJsonList(json),
|
cardImages: CardImages.fromJsonList(json),
|
||||||
isFav: json["isFav"] == 1 ? true : false);
|
isFav: json["isFav"] == 1 ? true : false,
|
||||||
|
price: json["price"],
|
||||||
|
lan: json["lan"],
|
||||||
|
lat: json["lat"],
|
||||||
|
workScheduleModel: json["work_schedules"] == null ? null : WorkScheduleModel.fromJson(json),
|
||||||
|
avgRating: json["avg_rating"],
|
||||||
|
);
|
||||||
|
|
||||||
static List<CardModel> fromJsonList(Map<String, dynamic> json) {
|
static List<CardModel> fromJsonList(Map<String, dynamic> json) {
|
||||||
List<CardModel> cards = [];
|
List<CardModel> cards = [];
|
||||||
|
|
|
||||||
35
lib/features/card/data_layer/model/feedback.dart
Normal file
35
lib/features/card/data_layer/model/feedback.dart
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import 'package:taafee_mobile/features/auth/data_layer/model/user.dart';
|
||||||
|
|
||||||
|
class FeedbackModel {
|
||||||
|
int id;
|
||||||
|
int stars;
|
||||||
|
String feedback;
|
||||||
|
User user;
|
||||||
|
int cardId;
|
||||||
|
|
||||||
|
FeedbackModel({
|
||||||
|
required this.id,
|
||||||
|
required this.stars,
|
||||||
|
required this.feedback,
|
||||||
|
required this.user,
|
||||||
|
required this.cardId,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory FeedbackModel.fromJson(Map<String, dynamic> json) => FeedbackModel(
|
||||||
|
id: json["id"],
|
||||||
|
stars: json["stars"],
|
||||||
|
feedback: json["feedback"].toString(),
|
||||||
|
user: User.fromJson(json["user"]),
|
||||||
|
cardId: json["card_id"],
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<FeedbackModel> fromJsonList(Map<String, dynamic> json) {
|
||||||
|
List<FeedbackModel> feedback = [];
|
||||||
|
json["data"].forEach(
|
||||||
|
(element) => feedback.add(
|
||||||
|
FeedbackModel.fromJson(element),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return feedback;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
lib/features/card/data_layer/model/rate.dart
Normal file
15
lib/features/card/data_layer/model/rate.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
class RateModel {
|
||||||
|
int cardId;
|
||||||
|
double stars;
|
||||||
|
String? feedback;
|
||||||
|
|
||||||
|
RateModel({required this.cardId, required this.stars, this.feedback});
|
||||||
|
|
||||||
|
factory RateModel.zero() => RateModel(cardId: 0, stars: 0);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
'card_id': cardId,
|
||||||
|
'stars': stars * 2,
|
||||||
|
if (feedback != null) 'feedback': feedback,
|
||||||
|
};
|
||||||
|
}
|
||||||
65
lib/features/card/data_layer/model/work_schedules.dart
Normal file
65
lib/features/card/data_layer/model/work_schedules.dart
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
class WorkScheduleModel {
|
||||||
|
List<Day> days;
|
||||||
|
WorkScheduleModel({
|
||||||
|
required this.days,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory WorkScheduleModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
List<Day> days = [];
|
||||||
|
json["work_schedules"].forEach((key, value) {
|
||||||
|
days.add(
|
||||||
|
Day(
|
||||||
|
day: key,
|
||||||
|
workTime: workTimeModel.fromJsonList(value),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return WorkScheduleModel(days: days);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Day {
|
||||||
|
String day;
|
||||||
|
List<workTimeModel> workTime;
|
||||||
|
Day({
|
||||||
|
required this.day,
|
||||||
|
required this.workTime,
|
||||||
|
});
|
||||||
|
factory Day.zero() => Day(
|
||||||
|
day: "",
|
||||||
|
workTime: [],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class workTimeModel {
|
||||||
|
String name;
|
||||||
|
String startTime;
|
||||||
|
String endTime;
|
||||||
|
workTimeModel({
|
||||||
|
required this.name,
|
||||||
|
required this.startTime,
|
||||||
|
required this.endTime,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory workTimeModel.fromJson(Map<String, dynamic> json) => workTimeModel(
|
||||||
|
name: json["name"],
|
||||||
|
startTime: json["start"],
|
||||||
|
endTime: json["end"],
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<workTimeModel> fromJsonList(List<dynamic> json) {
|
||||||
|
List<workTimeModel> days = [];
|
||||||
|
for (var day in json) {
|
||||||
|
days.add(
|
||||||
|
workTimeModel.fromJson(day),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// json[key].forEach(
|
||||||
|
// (element) => days.add(
|
||||||
|
// workTimeModel.fromJson(element),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
return days;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
class WorkingTimeModel {
|
// class WorkingTimeModel {
|
||||||
String type;
|
// String type;
|
||||||
String startTime;
|
// String startTime;
|
||||||
String endTime;
|
// String endTime;
|
||||||
|
|
||||||
WorkingTimeModel({
|
// WorkingTimeModel({
|
||||||
required this.type,
|
// required this.type,
|
||||||
required this.startTime,
|
// required this.startTime,
|
||||||
required this.endTime,
|
// required this.endTime,
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ import 'package:taafee_mobile/core/local_storage/local_storage.dart';
|
||||||
import 'package:taafee_mobile/core/network/http.dart';
|
import 'package:taafee_mobile/core/network/http.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/add_card.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/add_card.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/card_images.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/card_images.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/feedback.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/rate.dart';
|
||||||
|
|
||||||
import '../model/card_model.dart';
|
import '../model/card_model.dart';
|
||||||
import '../model/edit_card.dart';
|
import '../model/edit_card.dart';
|
||||||
|
|
@ -15,33 +17,25 @@ import '../model/edit_card.dart';
|
||||||
class CardService {
|
class CardService {
|
||||||
LocalStorage localStorage = LocalStorage();
|
LocalStorage localStorage = LocalStorage();
|
||||||
Future<void> addCard(AddCardModel addCardModel) async {
|
Future<void> addCard(AddCardModel addCardModel) async {
|
||||||
Request request = Request(EndPoint.card, RequestMethod.post,
|
Request request =
|
||||||
body: addCardModel.toJson(), isFormData: true, authorized: true);
|
Request(EndPoint.card, RequestMethod.post, body: addCardModel.toJson(), isFormData: true, authorized: true);
|
||||||
//no need to use variable
|
//no need to use variable
|
||||||
await request.sendRequest();
|
await request.sendRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<CardModel>> getCards(
|
Future<List<CardModel>> getCards({int? page, int? categoryId, void Function(Object)? onConnectionError}) async {
|
||||||
{int? page,
|
|
||||||
int? categoryId,
|
|
||||||
void Function(Object)? onConnectionError}) async {
|
|
||||||
Request request = Request(EndPoint.card, RequestMethod.get,
|
Request request = Request(EndPoint.card, RequestMethod.get,
|
||||||
authorized: true,
|
authorized: true,
|
||||||
cacheable: true,
|
cacheable: true,
|
||||||
queryParams: {
|
queryParams: {"page": page, if (categoryId != null) 'category_id': categoryId});
|
||||||
"page": page,
|
|
||||||
if (categoryId != null) 'category_id': categoryId
|
|
||||||
});
|
|
||||||
|
|
||||||
Map<String, dynamic> response =
|
Map<String, dynamic> response = await request.sendRequest(onConnectionError: onConnectionError);
|
||||||
await request.sendRequest(onConnectionError: onConnectionError);
|
|
||||||
|
|
||||||
return CardModel.fromJsonList(response);
|
return CardModel.fromJsonList(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<CardModel> showCard({required int cardId}) async {
|
Future<CardModel> showCard({required int cardId}) async {
|
||||||
Request request = Request('${EndPoint.card}/$cardId', RequestMethod.get,
|
Request request = Request('${EndPoint.card}/$cardId', RequestMethod.get, authorized: true);
|
||||||
authorized: true);
|
|
||||||
Map<String, dynamic> response = await request.sendRequest();
|
Map<String, dynamic> response = await request.sendRequest();
|
||||||
return CardModel.fromJson(response['data']);
|
return CardModel.fromJson(response['data']);
|
||||||
}
|
}
|
||||||
|
|
@ -71,15 +65,11 @@ class CardService {
|
||||||
await request.sendRequest();
|
await request.sendRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<CardModel>> getMyCards(int userId,
|
Future<List<CardModel>> getMyCards(int userId, {int? page, void Function(Object)? onConnectionError}) async {
|
||||||
{int? page, void Function(Object)? onConnectionError}) async {
|
|
||||||
Request request = Request(EndPoint.card, RequestMethod.get,
|
Request request = Request(EndPoint.card, RequestMethod.get,
|
||||||
cacheable: true,
|
cacheable: true, authorized: true, queryParams: {"user_id": userId, 'page': page});
|
||||||
authorized: true,
|
|
||||||
queryParams: {"user_id": userId, 'page': page});
|
|
||||||
|
|
||||||
Map<String, dynamic> response =
|
Map<String, dynamic> response = await request.sendRequest(onConnectionError: onConnectionError);
|
||||||
await request.sendRequest(onConnectionError: onConnectionError);
|
|
||||||
|
|
||||||
return CardModel.fromJsonList(response);
|
return CardModel.fromJsonList(response);
|
||||||
}
|
}
|
||||||
|
|
@ -148,4 +138,23 @@ class CardService {
|
||||||
));
|
));
|
||||||
return Uint8List.fromList(response.data);
|
return Uint8List.fromList(response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> sendRating(RateModel rateModel) async {
|
||||||
|
Request request = Request(EndPoint.rate, RequestMethod.post, authorized: true, body: rateModel.toJson());
|
||||||
|
|
||||||
|
Map<String, dynamic> response = await request.sendRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<FeedbackModel>> getFeedback(int cardId) async {
|
||||||
|
Request request = Request(
|
||||||
|
EndPoint.rate,
|
||||||
|
RequestMethod.get,
|
||||||
|
authorized: true,
|
||||||
|
queryParams: {
|
||||||
|
"card_id": cardId,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
Map<String, dynamic> response = await request.sendRequest();
|
||||||
|
return FeedbackModel.fromJsonList(response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,15 @@ class CardDetailsScreen extends StatelessWidget {
|
||||||
radius: 60,
|
radius: 60,
|
||||||
backgroundColor: AppColors.secondaryColor,
|
backgroundColor: AppColors.secondaryColor,
|
||||||
),
|
),
|
||||||
const Positioned(
|
Positioned(
|
||||||
top: 15,
|
top: 15,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
radius: 50,
|
radius: 50,
|
||||||
backgroundImage: AssetImage(
|
backgroundImage: cardModel.user.avatarImage == null
|
||||||
"assets/images/Ellipse 8.png",
|
? const AssetImage(
|
||||||
),
|
"assets/images/default_user_avatar.png",
|
||||||
|
)
|
||||||
|
: NetworkImage(cardModel.user.avatarImage!) as ImageProvider,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -162,16 +164,20 @@ class CardDetailsScreen extends StatelessWidget {
|
||||||
child: ListViewWidget(
|
child: ListViewWidget(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
itemCount: 4,
|
itemCount: cardModel.cardImages.length,
|
||||||
childBuilder: (index) {
|
childBuilder: (index) {
|
||||||
if (index == 3) {
|
if (index == 3) {
|
||||||
return const ImageWidget(
|
return ImageWidget(
|
||||||
numberOfImages: 5,
|
numberOfImages: 5,
|
||||||
|
cardImages: cardModel.cardImages[index],
|
||||||
).onTap(() {
|
).onTap(() {
|
||||||
RoutingManager.to(RouteName.imageView);
|
RoutingManager.to(RouteName.imageView);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return const ImageWidget(numberOfImages: 1);
|
return ImageWidget(
|
||||||
|
numberOfImages: 1,
|
||||||
|
cardImages: cardModel.cardImages[index],
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -184,11 +190,15 @@ class CardDetailsScreen extends StatelessWidget {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
WorkingTimeWidget(),
|
WorkingTimeWidget(
|
||||||
|
workScheduleModel: cardModel.workScheduleModel,
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
RateWidget(),
|
RateWidget(
|
||||||
|
cardModel: cardModel,
|
||||||
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
|
|
@ -200,21 +210,13 @@ class CardDetailsScreen extends StatelessWidget {
|
||||||
// ),
|
// ),
|
||||||
child: FlutterMap(
|
child: FlutterMap(
|
||||||
options: MapOptions(
|
options: MapOptions(
|
||||||
center: const location.LatLng(51.509364, -0.128928),
|
center: location.LatLng(double.parse(cardModel.lat), double.parse(cardModel.lan)),
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||||
userAgentPackageName: 'com.example.app',
|
userAgentPackageName: 'com.example.app',
|
||||||
),
|
),
|
||||||
// RichAttributionWidget(
|
|
||||||
// attributions: [
|
|
||||||
// TextSourceAttribution(
|
|
||||||
// 'OpenStreetMap contributors',
|
|
||||||
// onTap: () => launchUrl(Uri.parse('https://openstreetmap.org/copyright')),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -243,161 +245,28 @@ class CardDetailsScreen extends StatelessWidget {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 20,
|
height: 20,
|
||||||
),
|
),
|
||||||
// Row(
|
Container(
|
||||||
// children: [
|
width: Get.width * .89,
|
||||||
// ButtonWidget(
|
height: 200,
|
||||||
// color: AppColors.callColor,
|
decoration: BoxDecoration(
|
||||||
// haveIcon: true,
|
color: Colors.white,
|
||||||
// onTap: () async {
|
borderRadius: BorderRadius.circular(10),
|
||||||
// await UrlLauncherService.makePhoneCall(cardModel.phoneNumber);
|
),
|
||||||
// },
|
child: Column(
|
||||||
// title: "call_owner".tr,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// textColor: Colors.white,
|
children: [
|
||||||
// child: SvgPicture.asset(
|
const RegularTextWidget(
|
||||||
// "assets/icons/phone.svg",
|
"Insurance companies",
|
||||||
// colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
color: Colors.grey,
|
||||||
// ),
|
fontSize: 14,
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5),
|
).paddingSymmetric(horizontal: 30),
|
||||||
// ButtonWidget(
|
RegularTextWidget(cardModel.additionalData).paddingSymmetric(horizontal: 10, vertical: 5)
|
||||||
// color: AppColors.emailColor,
|
],
|
||||||
// haveIcon: true,
|
),
|
||||||
// onTap: () async {
|
),
|
||||||
// await UrlLauncherService.sendEmail(cardModel.user.email);
|
const SizedBox(
|
||||||
// },
|
height: 20,
|
||||||
// title: "email".tr,
|
),
|
||||||
// textColor: Colors.white,
|
|
||||||
// child: SvgPicture.asset("assets/icons/Email.svg"),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5),
|
|
||||||
// if (Responsive.isTablet())
|
|
||||||
// Visibility(
|
|
||||||
// visible: chatController.chatUser.id != cardModel.user.chatUserId,
|
|
||||||
// child: Obx(() {
|
|
||||||
// return ButtonWidget(
|
|
||||||
// isLoading: chatController.createRoomState.loading,
|
|
||||||
// textColor: Colors.white,
|
|
||||||
// color: AppColors.messageColor,
|
|
||||||
// haveIcon: true,
|
|
||||||
// onTap: () {
|
|
||||||
// if (chatController.connectionState.value == SocketConnectionState.connected) {
|
|
||||||
// chatController.createRoom(
|
|
||||||
// chatUserId: cardModel.user.chatUserId,
|
|
||||||
// onSuccess: (room) {
|
|
||||||
// RoutingManager.to(RouteName.chatDetails, arguments: {
|
|
||||||
// "room": room,
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// Toast.showToast('you_have_no_internet_connection.'.tr);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// title: "start_conversation".tr,
|
|
||||||
// fontSize: 13,
|
|
||||||
// child: SvgPicture.asset("assets/icons/message.svg"),
|
|
||||||
// ).expanded(Responsive.isTablet() ? 1 : 5);
|
|
||||||
// }),
|
|
||||||
// ),
|
|
||||||
// if (Responsive.isTablet())
|
|
||||||
// Obx(() {
|
|
||||||
// return Visibility(
|
|
||||||
// visible: homeController.user.value!.id != cardModel.user.id,
|
|
||||||
// child: (homeController.currentCardAppointment.value != null)
|
|
||||||
// ? ButtonWidget(
|
|
||||||
// haveIcon: true,
|
|
||||||
// onTap: () {
|
|
||||||
// appointmentDialog(context);
|
|
||||||
// },
|
|
||||||
// fontSize: 13,
|
|
||||||
// color: AppColors.secondaryColor,
|
|
||||||
// title: 'you_have_an_appointment'.tr,
|
|
||||||
// child: const Icon(
|
|
||||||
// Icons.schedule,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5)
|
|
||||||
// : ButtonWidget(
|
|
||||||
// onTap: () {
|
|
||||||
// cardController.getAvailableAppointments();
|
|
||||||
// appointmentSchedulingDialog(context);
|
|
||||||
// },
|
|
||||||
// haveIcon: true,
|
|
||||||
// fontSize: 12,
|
|
||||||
// title: 'schedule_an_appointment'.tr,
|
|
||||||
// color: AppColors.secondaryColor,
|
|
||||||
// child: const Icon(
|
|
||||||
// Icons.schedule,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
// ],
|
|
||||||
// ).paddingSymmetric(vertical: Responsive.isTablet() ? 20 : 4, horizontal: Responsive.isTablet() ? 40 : 10),
|
|
||||||
// if (!Responsive.isTablet())
|
|
||||||
// Obx(() {
|
|
||||||
// return Row(
|
|
||||||
// children: [
|
|
||||||
// Obx(() {
|
|
||||||
// return Visibility(
|
|
||||||
// visible: homeController.user.value!.id != cardModel.user.id,
|
|
||||||
// child: (homeController.currentCardAppointment.value != null)
|
|
||||||
// ? ButtonWidget(
|
|
||||||
// haveIcon: true,
|
|
||||||
// onTap: () {
|
|
||||||
// appointmentDialog(context);
|
|
||||||
// },
|
|
||||||
// fontSize: 12,
|
|
||||||
// color: AppColors.secondaryColor,
|
|
||||||
// title: 'you_have_an_appointment'.tr,
|
|
||||||
// child: const Icon(
|
|
||||||
// Icons.schedule,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5)
|
|
||||||
// : ButtonWidget(
|
|
||||||
// onTap: () {
|
|
||||||
// cardController.getAvailableAppointments();
|
|
||||||
// appointmentSchedulingDialog(context);
|
|
||||||
// },
|
|
||||||
// haveIcon: true,
|
|
||||||
// fontSize: 12,
|
|
||||||
// title: 'schedule_an_appointment'.tr,
|
|
||||||
// color: AppColors.secondaryColor,
|
|
||||||
// child: const Icon(
|
|
||||||
// Icons.schedule,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
// Visibility(
|
|
||||||
// visible: chatController.chatUser.id != cardModel.user.chatUserId,
|
|
||||||
// child: ButtonWidget(
|
|
||||||
// isLoading: chatController.createRoomState.loading,
|
|
||||||
// textColor: Colors.white,
|
|
||||||
// color: AppColors.messageColor,
|
|
||||||
// haveIcon: true,
|
|
||||||
// onTap: () {
|
|
||||||
// if (chatController.connectionState.value == SocketConnectionState.connected) {
|
|
||||||
// chatController.createRoom(
|
|
||||||
// chatUserId: cardModel.user.chatUserId,
|
|
||||||
// onSuccess: (room) {
|
|
||||||
// RoutingManager.to(RouteName.chatDetails, arguments: {"room": room});
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// Toast.showToast('you_have_no_internet_connection'.tr);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// title: "start_conversation".tr,
|
|
||||||
// fontSize: 12,
|
|
||||||
// child: SvgPicture.asset("assets/icons/message.svg"),
|
|
||||||
// ).paddingSymmetric(horizontal: 4).expanded(Responsive.isTablet() ? 1 : 5),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ).paddingSymmetric(vertical: Responsive.isTablet() ? 20 : 4, horizontal: Responsive.isTablet() ? 40 : 10);
|
|
||||||
// }),
|
|
||||||
// const SizedBox(
|
|
||||||
// height: 60,
|
|
||||||
// ),
|
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: Responsive.isTablet() ? 20 : 0)),
|
).paddingSymmetric(horizontal: Responsive.isTablet() ? 20 : 0)),
|
||||||
).makeSafeArea();
|
).makeSafeArea();
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,13 @@ import 'package:get/get.dart';
|
||||||
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
|
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/header_screen.dart';
|
import 'package:taafee_mobile/common/widgets/header_screen.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/listview.dart';
|
import 'package:taafee_mobile/common/widgets/listview.dart';
|
||||||
|
import 'package:taafee_mobile/common/widgets/rx_viewer.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
||||||
import 'package:taafee_mobile/features/card/presentation_layer/widgets/feedback_widget.dart';
|
import 'package:taafee_mobile/features/card/presentation_layer/widgets/feedback_widget.dart';
|
||||||
|
|
||||||
class FeedbackScreen extends StatelessWidget {
|
class FeedbackScreen extends StatelessWidget {
|
||||||
const FeedbackScreen({super.key});
|
final CardController cardController = Get.find<CardController>();
|
||||||
|
FeedbackScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -16,13 +19,18 @@ class FeedbackScreen extends StatelessWidget {
|
||||||
HeaderScreen(
|
HeaderScreen(
|
||||||
"Feedback",
|
"Feedback",
|
||||||
).paddingOnly(top: 20),
|
).paddingOnly(top: 20),
|
||||||
SizedBox(
|
RxViewer(
|
||||||
width: Get.width,
|
rxFuture: cardController.feedbackState,
|
||||||
child: ListViewWidget(
|
child: () => SizedBox(
|
||||||
itemCount: 10,
|
width: Get.width,
|
||||||
childBuilder: (index) {
|
child: ListViewWidget(
|
||||||
return const FeedbackWidget();
|
itemCount: cardController.feedbackState.result.length,
|
||||||
}),
|
childBuilder: (index) {
|
||||||
|
return FeedbackWidget(
|
||||||
|
feedbackModel: cardController.feedbackState.result[index],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@ import 'package:taafee_mobile/common/widgets/button.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/header_screen.dart';
|
import 'package:taafee_mobile/common/widgets/header_screen.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/text.dart';
|
import 'package:taafee_mobile/common/widgets/text.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/textfiled.dart';
|
import 'package:taafee_mobile/common/widgets/textfiled.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
||||||
|
|
||||||
import '../../../../core/routing/routing_manager.dart';
|
import '../../../../core/routing/routing_manager.dart';
|
||||||
|
|
||||||
class ReviewFormScreen extends StatelessWidget {
|
class ReviewFormScreen extends StatelessWidget {
|
||||||
const ReviewFormScreen({super.key});
|
final CardController cardController = Get.find<CardController>();
|
||||||
|
ReviewFormScreen({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -45,7 +47,7 @@ class ReviewFormScreen extends StatelessWidget {
|
||||||
minRating: 1,
|
minRating: 1,
|
||||||
itemSize: 40,
|
itemSize: 40,
|
||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
allowHalfRating: false,
|
allowHalfRating: true,
|
||||||
glow: false,
|
glow: false,
|
||||||
itemCount: 5,
|
itemCount: 5,
|
||||||
// glowColor: ,
|
// glowColor: ,
|
||||||
|
|
@ -54,13 +56,17 @@ class ReviewFormScreen extends StatelessWidget {
|
||||||
Icons.star_rounded,
|
Icons.star_rounded,
|
||||||
color: Colors.amber,
|
color: Colors.amber,
|
||||||
),
|
),
|
||||||
onRatingUpdate: (rating) {},
|
onRatingUpdate: (rating) {
|
||||||
|
cardController.rateModel.stars = rating;
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextFieldWidget(
|
TextFieldWidget(
|
||||||
maxLines: 7,
|
maxLines: 7,
|
||||||
textInputAction: TextInputAction.newline,
|
textInputAction: TextInputAction.newline,
|
||||||
onChange: (value) {},
|
onChange: (value) {
|
||||||
|
cardController.rateModel.feedback = value;
|
||||||
|
},
|
||||||
keyboardType: TextInputType.multiline,
|
keyboardType: TextInputType.multiline,
|
||||||
label: "",
|
label: "",
|
||||||
validate: (value) {
|
validate: (value) {
|
||||||
|
|
@ -68,13 +74,17 @@ class ReviewFormScreen extends StatelessWidget {
|
||||||
},
|
},
|
||||||
height: Get.height * .3,
|
height: Get.height * .3,
|
||||||
).paddingOnly(top: 30),
|
).paddingOnly(top: 30),
|
||||||
ButtonWidget(
|
Obx(() {
|
||||||
onTap: () {
|
return ButtonWidget(
|
||||||
RoutingManager.back();
|
isLoading: cardController.sendRatingState.loading,
|
||||||
},
|
onTap: () async {
|
||||||
title: "Done",
|
await cardController.sendRating();
|
||||||
width: Get.width * .3,
|
RoutingManager.back();
|
||||||
).center()
|
},
|
||||||
|
title: "Done",
|
||||||
|
width: Get.width * .3,
|
||||||
|
).center();
|
||||||
|
})
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 30, vertical: 20),
|
).paddingSymmetric(horizontal: 30, vertical: 20),
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class CardWidget extends StatelessWidget {
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
height: 175,
|
height: 175,
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
margin: const EdgeInsets.symmetric(horizontal: 0, vertical: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class ConsultationPriceWidget extends StatelessWidget {
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
BoldTextWidget(
|
BoldTextWidget(
|
||||||
"400 SP".tr,
|
"${cardModel.price} SP".tr,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,28 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/text.dart';
|
import 'package:taafee_mobile/common/widgets/text.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/feedback.dart';
|
||||||
|
|
||||||
class FeedbackWidget extends StatelessWidget {
|
class FeedbackWidget extends StatelessWidget {
|
||||||
const FeedbackWidget({super.key});
|
final FeedbackModel feedbackModel;
|
||||||
|
const FeedbackWidget({super.key, required this.feedbackModel});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const Row(
|
return feedbackModel.feedback != "null"
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
? Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
RegularTextWidget(
|
children: [
|
||||||
"Zakoor",
|
RegularTextWidget(
|
||||||
fontSize: 16,
|
"${feedbackModel.user.firstName} ${feedbackModel.user.lastName}",
|
||||||
),
|
fontSize: 16,
|
||||||
RegularTextWidget(
|
),
|
||||||
"ggggggggggggggggggg",
|
RegularTextWidget(
|
||||||
fontSize: 14,
|
feedbackModel.feedback,
|
||||||
),
|
fontSize: 14,
|
||||||
],
|
),
|
||||||
).paddingSymmetric(horizontal: 20, vertical: 8);
|
],
|
||||||
|
).paddingSymmetric(horizontal: 20, vertical: 8)
|
||||||
|
: Container();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:taafee_mobile/common/const/const.dart';
|
||||||
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
|
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/text.dart';
|
import 'package:taafee_mobile/common/widgets/text.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/card_images.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
||||||
|
|
||||||
class ImageWidget extends StatelessWidget {
|
class ImageWidget extends StatelessWidget {
|
||||||
final int numberOfImages;
|
final int numberOfImages;
|
||||||
const ImageWidget({
|
final CardImages cardImages;
|
||||||
super.key,
|
const ImageWidget({super.key, required this.numberOfImages, required this.cardImages});
|
||||||
required this.numberOfImages,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -18,8 +20,9 @@ class ImageWidget extends StatelessWidget {
|
||||||
height: Get.width * .2,
|
height: Get.width * .2,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
image: const DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/download.jpg"),
|
image: CachedNetworkImageProvider(Domain.domain + cardImages.url.substring(6)),
|
||||||
|
// image: AssetImage("assets/images/download.jpg"),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import 'package:taafee_mobile/common/widgets/button.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/text.dart';
|
import 'package:taafee_mobile/common/widgets/text.dart';
|
||||||
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
import 'package:taafee_mobile/core/routing/routing_manager.dart';
|
||||||
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
import 'package:taafee_mobile/features/card/business_logic_layer/card_controller.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
||||||
import 'package:taafee_mobile/features/card/presentation_layer/widgets/star.dart';
|
import 'package:taafee_mobile/features/card/presentation_layer/widgets/star.dart';
|
||||||
import 'package:taafee_mobile/features/card/presentation_layer/widgets/view_ratings.dart';
|
import 'package:taafee_mobile/features/card/presentation_layer/widgets/view_ratings.dart';
|
||||||
|
|
||||||
|
|
@ -15,14 +16,15 @@ import '../../../../common/const/const.dart';
|
||||||
import '../../../../common/widgets/textfiled.dart';
|
import '../../../../common/widgets/textfiled.dart';
|
||||||
|
|
||||||
class RateWidget extends StatelessWidget {
|
class RateWidget extends StatelessWidget {
|
||||||
|
final CardModel cardModel;
|
||||||
final CardController cardController = Get.find<CardController>();
|
final CardController cardController = Get.find<CardController>();
|
||||||
RateWidget({super.key});
|
RateWidget({super.key, required this.cardModel});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: Get.width * .89,
|
width: Get.width * .89,
|
||||||
height: 150,
|
height: 200,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
|
@ -34,6 +36,7 @@ class RateWidget extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
const RegularTextWidget("Rates"),
|
const RegularTextWidget("Rates"),
|
||||||
Container(
|
Container(
|
||||||
|
margin: const EdgeInsets.only(top: 5),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 25,
|
height: 25,
|
||||||
|
|
@ -46,199 +49,20 @@ class RateWidget extends StatelessWidget {
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
).onTap(() {
|
).onTap(() {
|
||||||
|
cardController.rateModel.cardId = cardModel.id;
|
||||||
RoutingManager.to(RouteName.reviewForm);
|
RoutingManager.to(RouteName.reviewForm);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
).paddingSymmetric(horizontal: 20, vertical: 5),
|
).paddingSymmetric(horizontal: 20, vertical: 5),
|
||||||
const ViewRatingsWidget(),
|
ViewRatingsWidget(
|
||||||
|
cardModel: cardModel,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
).onTap(() async {
|
||||||
// child: Column(
|
cardController.getFeedback(cardModel.id);
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// RegularTextWidget("Number of users who rate this : ".tr),
|
|
||||||
// RegularTextWidget("10".tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Container(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// width: 100,
|
|
||||||
// height: 25,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: AppColors.primeColor,
|
|
||||||
// borderRadius: BorderRadius.circular(25),
|
|
||||||
// ),
|
|
||||||
// child: RegularTextWidget(
|
|
||||||
// "Rate Now".tr,
|
|
||||||
// color: Colors.white,
|
|
||||||
// ),
|
|
||||||
// ).onTap(() {
|
|
||||||
// dialog();
|
|
||||||
// cardController.currentIndex(0);
|
|
||||||
// })
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
// children: [
|
|
||||||
// Column(
|
|
||||||
// children: [
|
|
||||||
// const Stack(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// StarWidget(maxRating: 1, starSize: 60, readOnly: true),
|
|
||||||
// RegularTextWidget(
|
|
||||||
// "2.5",
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// RegularTextWidget("Waiting".tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Column(
|
|
||||||
// children: [
|
|
||||||
// const Stack(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// StarWidget(maxRating: 1, starSize: 60, readOnly: true),
|
|
||||||
// RegularTextWidget(
|
|
||||||
// "2.5",
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// RegularTextWidget("Performance".tr),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Column(
|
|
||||||
// children: [
|
|
||||||
// const Stack(
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// children: [
|
|
||||||
// StarWidget(maxRating: 1, starSize: 60, readOnly: true),
|
|
||||||
// RegularTextWidget(
|
|
||||||
// "2.5",
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// RegularTextWidget("Price".tr),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// ).paddingOnly(top: 10).paddingSymmetric(horizontal: 20),
|
|
||||||
// ],
|
|
||||||
// ).paddingSymmetric(horizontal: 10, vertical: 10),
|
|
||||||
).onTap(() {
|
|
||||||
RoutingManager.to(RouteName.feedback);
|
RoutingManager.to(RouteName.feedback);
|
||||||
log("message");
|
log("message");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
final PageController pageController = PageController();
|
|
||||||
final List<String> rate = [
|
|
||||||
"waiting?",
|
|
||||||
"Performance?",
|
|
||||||
"Price?",
|
|
||||||
"Feedback",
|
|
||||||
];
|
|
||||||
final List<Widget> stars = [
|
|
||||||
const StarWidget(maxRating: 5, starSize: 30, readOnly: false),
|
|
||||||
const StarWidget(maxRating: 5, starSize: 30, readOnly: false),
|
|
||||||
const StarWidget(maxRating: 5, starSize: 30, readOnly: false),
|
|
||||||
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.topCenter,
|
|
||||||
width: Get.width * .5,
|
|
||||||
height: 55,
|
|
||||||
child: TextFormField(
|
|
||||||
onChanged: (value) {},
|
|
||||||
maxLines: 4,
|
|
||||||
textInputAction: TextInputAction.newline,
|
|
||||||
keyboardType: TextInputType.multiline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// TextFieldWidget(
|
|
||||||
// keyboardType: TextInputType.multiline,
|
|
||||||
// label: "",
|
|
||||||
// onChange: (value) {},
|
|
||||||
// maxLines: 5,
|
|
||||||
// textInputAction: TextInputAction.newline,
|
|
||||||
// validate: (p0) {
|
|
||||||
// return null;
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
];
|
|
||||||
void dialog() {
|
|
||||||
Get.defaultDialog(
|
|
||||||
onWillPop: () async {
|
|
||||||
cardController.currentIndex(0);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
confirm: Obx(() {
|
|
||||||
return Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
RegularTextWidget(
|
|
||||||
"back".tr,
|
|
||||||
color: Colors.black,
|
|
||||||
).onTap(() {
|
|
||||||
if (cardController.currentIndex.value == 0) {
|
|
||||||
RoutingManager.back();
|
|
||||||
}
|
|
||||||
pageController.animateToPage(cardController.currentIndex.value - 1,
|
|
||||||
duration: const Duration(milliseconds: 250), curve: Curves.easeIn);
|
|
||||||
}),
|
|
||||||
ButtonWidget(
|
|
||||||
width: 80,
|
|
||||||
onTap: () {
|
|
||||||
if (cardController.currentIndex.value == 3) {
|
|
||||||
RoutingManager.back();
|
|
||||||
}
|
|
||||||
pageController.animateToPage(cardController.currentIndex.value + 1,
|
|
||||||
duration: const Duration(milliseconds: 250), curve: Curves.easeIn);
|
|
||||||
},
|
|
||||||
title: cardController.currentIndex.value == 3 ? "OK".tr : "Next".tr),
|
|
||||||
],
|
|
||||||
).paddingSymmetric(horizontal: 20);
|
|
||||||
}),
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
title: "",
|
|
||||||
middleText: "",
|
|
||||||
content: SizedBox(
|
|
||||||
width: Get.width * .5,
|
|
||||||
height: Get.height * .15,
|
|
||||||
child: PageView.builder(
|
|
||||||
physics: const BouncingScrollPhysics(),
|
|
||||||
controller: pageController,
|
|
||||||
onPageChanged: (value) {
|
|
||||||
cardController.changeCurrentIndex(value);
|
|
||||||
},
|
|
||||||
itemCount: 4,
|
|
||||||
itemBuilder: (BuildContext context, index) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
BoldTextWidget(rate[index].tr).paddingOnly(bottom: 30),
|
|
||||||
|
|
||||||
stars[index],
|
|
||||||
// SizedBox(
|
|
||||||
// width: Get.width * .8,
|
|
||||||
// child: RegularTextWidget(
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// text[index].tr,
|
|
||||||
// color: Colors.black,
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,41 @@
|
||||||
import 'package:animated_rating_stars/animated_rating_stars.dart';
|
// import 'package:animated_rating_stars/animated_rating_stars.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class StarWidget extends StatelessWidget {
|
// class StarWidget extends StatelessWidget {
|
||||||
final double maxRating;
|
// final double maxRating;
|
||||||
final double starSize;
|
// final double starSize;
|
||||||
final bool readOnly;
|
// final bool readOnly;
|
||||||
const StarWidget({
|
// const StarWidget({
|
||||||
super.key,
|
// super.key,
|
||||||
required this.maxRating,
|
// required this.maxRating,
|
||||||
required this.starSize,
|
// required this.starSize,
|
||||||
required this.readOnly,
|
// required this.readOnly,
|
||||||
});
|
// });
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return AnimatedRatingStars(
|
// return AnimatedRatingStars(
|
||||||
initialRating: 1,
|
// initialRating: 1,
|
||||||
minRating: 0,
|
// minRating: 0,
|
||||||
maxRating: maxRating,
|
// maxRating: maxRating,
|
||||||
filledColor: Colors.amber,
|
// filledColor: Colors.amber,
|
||||||
emptyColor: Colors.grey,
|
// emptyColor: Colors.grey,
|
||||||
filledIcon: Icons.star_border_rounded,
|
// filledIcon: Icons.star_border_rounded,
|
||||||
halfFilledIcon: Icons.star_half_rounded,
|
// halfFilledIcon: Icons.star_half_rounded,
|
||||||
emptyIcon: Icons.star_border_rounded,
|
// emptyIcon: Icons.star_border_rounded,
|
||||||
onChanged: (double rating) {
|
// onChanged: (double rating) {
|
||||||
// Handle the rating change here
|
// // Handle the rating change here
|
||||||
print('Rating: $rating');
|
// print('Rating: $rating');
|
||||||
},
|
// },
|
||||||
displayRatingValue: true,
|
// displayRatingValue: true,
|
||||||
interactiveTooltips: true,
|
// interactiveTooltips: true,
|
||||||
customFilledIcon: Icons.star_border_rounded,
|
// customFilledIcon: Icons.star_border_rounded,
|
||||||
customHalfFilledIcon: Icons.star_half_rounded,
|
// customHalfFilledIcon: Icons.star_half_rounded,
|
||||||
customEmptyIcon: Icons.star_border_rounded,
|
// customEmptyIcon: Icons.star_border_rounded,
|
||||||
starSize: starSize,
|
// starSize: starSize,
|
||||||
animationDuration: const Duration(milliseconds: 300),
|
// animationDuration: const Duration(milliseconds: 300),
|
||||||
animationCurve: Curves.easeInOut,
|
// animationCurve: Curves.easeInOut,
|
||||||
readOnly: readOnly,
|
// readOnly: readOnly,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,11 @@ import 'package:percent_indicator/linear_percent_indicator.dart';
|
||||||
import 'package:taafee_mobile/common/const/const.dart';
|
import 'package:taafee_mobile/common/const/const.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/listview.dart';
|
import 'package:taafee_mobile/common/widgets/listview.dart';
|
||||||
import 'package:taafee_mobile/common/widgets/text.dart';
|
import 'package:taafee_mobile/common/widgets/text.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/card_model.dart';
|
||||||
|
|
||||||
class ViewRatingsWidget extends StatelessWidget {
|
class ViewRatingsWidget extends StatelessWidget {
|
||||||
const ViewRatingsWidget({super.key});
|
final CardModel cardModel;
|
||||||
|
const ViewRatingsWidget({super.key, required this.cardModel});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -23,15 +25,15 @@ class ViewRatingsWidget extends StatelessWidget {
|
||||||
color: AppColors.primeColor,
|
color: AppColors.primeColor,
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: const BoldTextWidget(
|
child: BoldTextWidget(
|
||||||
"5.0",
|
(cardModel.avgRating / 2).toString(),
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RatingBar.builder(
|
RatingBar.builder(
|
||||||
itemSize: 15,
|
itemSize: 15,
|
||||||
initialRating: 3.5,
|
initialRating: cardModel.avgRating / 2,
|
||||||
minRating: 1,
|
minRating: 1,
|
||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
allowHalfRating: true,
|
allowHalfRating: true,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:taafee_mobile/features/card/data_layer/model/work_schedules.dart';
|
||||||
import 'package:taafee_mobile/features/card/data_layer/model/working_time.dart';
|
import 'package:taafee_mobile/features/card/data_layer/model/working_time.dart';
|
||||||
|
|
||||||
import '../../../../common/const/const.dart';
|
import '../../../../common/const/const.dart';
|
||||||
|
|
@ -7,77 +8,66 @@ import '../../../../common/widgets/listview.dart';
|
||||||
import '../../../../common/widgets/text.dart';
|
import '../../../../common/widgets/text.dart';
|
||||||
|
|
||||||
class WorkingTimeWidget extends StatelessWidget {
|
class WorkingTimeWidget extends StatelessWidget {
|
||||||
final List<WorkingTimeModel> list = [
|
WorkScheduleModel? workScheduleModel;
|
||||||
WorkingTimeModel(type: "Sunday", startTime: "8:00", endTime: "10:00"),
|
WorkingTimeWidget({super.key, this.workScheduleModel});
|
||||||
WorkingTimeModel(type: "Monday", startTime: "8:00", endTime: "10:00"),
|
|
||||||
WorkingTimeModel(type: "Sunday", startTime: "8:00", endTime: "10:00"),
|
|
||||||
];
|
|
||||||
WorkingTimeWidget({super.key});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return workScheduleModel != null
|
||||||
width: Get.width * .89,
|
? Container(
|
||||||
height: 270,
|
width: Get.width * .89,
|
||||||
decoration: BoxDecoration(
|
// height: 270,
|
||||||
color: Colors.white,
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
color: Colors.white,
|
||||||
),
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: Stack(
|
),
|
||||||
children: [
|
child: SizedBox(
|
||||||
const BoldTextWidget(
|
|
||||||
"working time",
|
|
||||||
color: Colors.grey,
|
|
||||||
).paddingSymmetric(horizontal: 20),
|
|
||||||
ListViewWidget(
|
|
||||||
physics: const BouncingScrollPhysics(),
|
|
||||||
itemCount: 8,
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
childBuilder: (index) {
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
const RegularTextWidget("8:00"),
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
width: 1,
|
|
||||||
color: AppColors.dividerColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
).paddingSymmetric(horizontal: 10);
|
|
||||||
}).paddingOnly(top: 25),
|
|
||||||
SizedBox(
|
|
||||||
width: Get.width * .89,
|
width: Get.width * .89,
|
||||||
child: ListViewWidget(
|
child: ListViewWidget(
|
||||||
itemCount: list.length,
|
itemCount: workScheduleModel!.days.length,
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
childBuilder: (index) {
|
childBuilder: (index) {
|
||||||
return SizedBox(
|
return Row(
|
||||||
width: Get.width * .89,
|
children: [
|
||||||
height: 42,
|
SizedBox(
|
||||||
child: ListViewWidget(
|
width: 90,
|
||||||
padding: const EdgeInsets.only(top: 20),
|
child: BoldTextWidget(workScheduleModel!.days[index].day),
|
||||||
scrollDirection: Axis.horizontal,
|
).paddingSymmetric(horizontal: 12),
|
||||||
itemCount: list.length,
|
Expanded(
|
||||||
childBuilder: (index) {
|
child: SizedBox(
|
||||||
return Container(
|
height: 50,
|
||||||
alignment: Alignment.center,
|
child: ListViewWidget(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
physics: const BouncingScrollPhysics(),
|
||||||
width: 100,
|
scrollDirection: Axis.horizontal,
|
||||||
decoration: BoxDecoration(
|
itemCount: workScheduleModel!.days[index].workTime.length,
|
||||||
color: AppColors.secondaryColor,
|
childBuilder: (i) {
|
||||||
borderRadius: BorderRadius.circular(25),
|
return Container(
|
||||||
),
|
alignment: Alignment.center,
|
||||||
child: RegularTextWidget(
|
width: 125,
|
||||||
list[index].type,
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: workScheduleModel!.days[index].workTime[i].name == "عطلة"
|
||||||
),
|
? Colors.grey
|
||||||
);
|
: AppColors.secondaryColor,
|
||||||
}),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 0, vertical: 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
RegularTextWidget(workScheduleModel!.days[index].workTime[i].startTime),
|
||||||
|
RegularTextWidget(workScheduleModel!.days[index].workTime[i].name),
|
||||||
|
RegularTextWidget(workScheduleModel!.days[index].workTime[i].endTime),
|
||||||
|
],
|
||||||
|
).paddingSymmetric(horizontal: 10),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
).paddingOnly(top: 30)
|
),
|
||||||
],
|
)
|
||||||
));
|
: Container();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user