BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:customer/screen_ui/on_demand_service/on_demand_home_screen.dart'
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../controllers/provider_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
import '../../models/provider_serivce_model.dart';
|
||||
@@ -26,58 +26,114 @@ class ProviderScreen extends StatelessWidget {
|
||||
controller.isLoading.value
|
||||
? Center(child: Constant.loader())
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 50),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 50,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child:
|
||||
(controller.userModel.value?.profilePictureURL ?? "").isNotEmpty
|
||||
? CircleAvatar(backgroundImage: NetworkImage(controller.userModel.value?.profilePictureURL ?? ''), radius: 50.0)
|
||||
: CircleAvatar(backgroundImage: NetworkImage(Constant.placeHolderImage), radius: 50.0),
|
||||
(controller.userModel.value?.profilePictureURL ??
|
||||
"")
|
||||
.isNotEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
controller
|
||||
.userModel
|
||||
.value
|
||||
?.profilePictureURL ??
|
||||
'',
|
||||
),
|
||||
radius: 50.0,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
Constant.placeHolderImage,
|
||||
),
|
||||
radius: 50.0,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
controller.userModel.value?.fullName() ?? '',
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black, fontFamily: AppThemeData.regular, fontSize: 20, fontWeight: FontWeight.w900),
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_mail.svg", color: isDark ? Colors.white : Colors.black),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_mail.svg",
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
controller.userModel.value?.email ?? '',
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black, fontFamily: AppThemeData.regular, fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_mobile.svg", color: isDark ? Colors.white : Colors.black),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_mobile.svg",
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
controller.userModel.value?.phoneNumber ?? '',
|
||||
style: TextStyle(color: isDark ? Colors.white : Colors.black, fontFamily: AppThemeData.regular, fontSize: 14, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color: isDark ? Colors.white : Colors.black,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: const BoxDecoration(color: AppThemeData.warning400, borderRadius: BorderRadius.all(Radius.circular(16))),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppThemeData.warning400,
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.star, size: 16, color: Colors.white),
|
||||
const Icon(
|
||||
Icons.star,
|
||||
size: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
Text(
|
||||
_getRating(controller),
|
||||
style: const TextStyle(letterSpacing: 0.5, fontSize: 12, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500, color: Colors.white),
|
||||
style: const TextStyle(
|
||||
letterSpacing: 0.5,
|
||||
fontSize: 12,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -93,8 +149,14 @@ class ProviderScreen extends StatelessWidget {
|
||||
itemCount: controller.providerList.length,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
ProviderServiceModel data = controller.providerList[index];
|
||||
return ServiceView(provider: data, isDark: isDark, controller: controller.onDemandHomeController.value);
|
||||
ProviderServiceModel data =
|
||||
controller.providerList[index];
|
||||
return ServiceView(
|
||||
provider: data,
|
||||
isDark: isDark,
|
||||
controller:
|
||||
controller.onDemandHomeController.value,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -107,8 +169,16 @@ class ProviderScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
String _getRating(ProviderController controller) {
|
||||
final reviewsCount = double.tryParse(controller.userModel.value?.reviewsCount?.toString() ?? "0") ?? 0;
|
||||
final reviewsSum = double.tryParse(controller.userModel.value?.reviewsSum?.toString() ?? "0") ?? 0;
|
||||
final reviewsCount =
|
||||
double.tryParse(
|
||||
controller.userModel.value?.reviewsCount?.toString() ?? "0",
|
||||
) ??
|
||||
0;
|
||||
final reviewsSum =
|
||||
double.tryParse(
|
||||
controller.userModel.value?.reviewsSum?.toString() ?? "0",
|
||||
) ??
|
||||
0;
|
||||
|
||||
if (reviewsCount == 0) return "0";
|
||||
final avg = reviewsSum / reviewsCount;
|
||||
|
||||
Reference in New Issue
Block a user