family screen & widgets

pull/76/head
aamir-csol 1 month ago
parent e48e98d61b
commit 192d617350

@ -727,7 +727,7 @@ const FAMILY_FILES= 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatu
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -9,6 +9,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/registration_payload_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/request_models/registration_payload_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/request_models/send_activation_request_model.dart';
import 'package:hmg_patient_app_new/features/common/models/commong_authanticated_req_model.dart'; import 'package:hmg_patient_app_new/features/common/models/commong_authanticated_req_model.dart';
import 'package:hmg_patient_app_new/features/common/models/family_file_request.dart';
class RequestUtils { class RequestUtils {
static dynamic getPatientAuthenticationRequest({ static dynamic getPatientAuthenticationRequest({
@ -126,6 +127,7 @@ class RequestUtils {
required bool isFileNo, required bool isFileNo,
dynamic payload, dynamic payload,
required bool isExcludedUser, required bool isExcludedUser,
required bool isFormFamilyFile,
int? responseID, int? responseID,
}) { }) {
AppState _appState = getIt.get<AppState>(); AppState _appState = getIt.get<AppState>();
@ -159,7 +161,7 @@ class RequestUtils {
} }
request.deviceTypeID = request.searchType; request.deviceTypeID = request.searchType;
if (isExcludedUser) { if (isFormFamilyFile) {
//INFO: Only for Excluded User Family Member Addition //INFO: Only for Excluded User Family Member Addition
request.isPatientExcluded = isExcludedUser; request.isPatientExcluded = isExcludedUser;
request.responseID = responseID; request.responseID = responseID;
@ -258,8 +260,8 @@ class RequestUtils {
}; };
} }
static dynamic getAddFamilyRequest({required String nationalIDorFile, required String mobileNo, required String countryCode}) { static Future<FamilyFileRequest> getAddFamilyRequest({required String nationalIDorFile, required String mobileNo, required String countryCode}) async {
var request = <String, dynamic>{}; FamilyFileRequest request = FamilyFileRequest();
int? loginType = 0; // Default to National ID int? loginType = 0; // Default to National ID
if (countryCode == CountryEnum.saudiArabia.countryCode || countryCode == '+966') { if (countryCode == CountryEnum.saudiArabia.countryCode || countryCode == '+966') {
@ -269,18 +271,18 @@ class RequestUtils {
} }
if (loginType == 1) { if (loginType == 1) {
request["sharedPatientID"] = 0; request.sharedPatientId = 0;
request["sharedPatientIdentificationID"] = nationalIDorFile; request.sharedPatientIdentificationId = nationalIDorFile;
} else if (loginType == 2) { } else if (loginType == 2) {
request["sharedPatientID"] = int.parse(nationalIDorFile); request.sharedPatientId = int.parse(nationalIDorFile);
request["sharedPatientIdentificationID"] = ''; request.sharedPatientIdentificationId = '';
} }
request["searchType"] = loginType; request.searchType = loginType;
request["sharedPatientMobileNumber"] = mobileNo; request.sharedPatientMobileNumber = mobileNo;
request["zipCode"] = countryCode; request.zipCode = countryCode;
request["isRegister"] = false; request.isRegister = false;
request["patientStatus"] = 2; request.patientStatus = 2;
request["isDentalAllowedBackend"] = false; request.isDentalAllowedBackend = false;
return request; return request;
} }
} }

@ -17,7 +17,7 @@ abstract class AuthenticationRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> checkPatientAuthentication({required dynamic checkPatientAuthenticationReq}); Future<Either<Failure, GenericApiModel<dynamic>>> checkPatientAuthentication({required dynamic checkPatientAuthenticationReq});
Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRepo({required dynamic sendActivationCodeReq, String? languageID, bool isRegister = false, bool isExcludedUser = false}); Future<Either<Failure, GenericApiModel<dynamic>>> sendActivationCodeRepo({required dynamic sendActivationCodeReq, String? languageID, bool isRegister = false, bool isFormFamilyFile = false});
Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo({required dynamic newRequest, required String? activationCode, required bool isRegister, bool isExcludedUser = false}); Future<Either<Failure, GenericApiModel<dynamic>>> checkActivationCodeRepo({required dynamic newRequest, required String? activationCode, required bool isRegister, bool isExcludedUser = false});
@ -131,7 +131,7 @@ class AuthenticationRepoImp implements AuthenticationRepo {
required dynamic sendActivationCodeReq, required dynamic sendActivationCodeReq,
String? languageID, String? languageID,
bool isRegister = false, bool isRegister = false,
bool isExcludedUser = false, bool isFormFamilyFile = false,
}) async { }) async {
int isOutKsa = (sendActivationCodeReq.zipCode == '966' || sendActivationCodeReq.zipCode == '+966') ? 0 : 1; int isOutKsa = (sendActivationCodeReq.zipCode == '966' || sendActivationCodeReq.zipCode == '+966') ? 0 : 1;
sendActivationCodeReq.patientOutSA = isOutKsa; sendActivationCodeReq.patientOutSA = isOutKsa;
@ -142,7 +142,7 @@ class AuthenticationRepoImp implements AuthenticationRepo {
Failure? failure; Failure? failure;
await apiClient.post( await apiClient.post(
isExcludedUser isFormFamilyFile
? ApiConsts.sendFamilyFileActivation ? ApiConsts.sendFamilyFileActivation
: isRegister : isRegister
? ApiConsts.sendActivationCodeRegister ? ApiConsts.sendActivationCodeRegister

@ -354,25 +354,26 @@ class AuthenticationViewModel extends ChangeNotifier {
dynamic payload, dynamic payload,
bool isComingFromResendOTP = false, bool isComingFromResendOTP = false,
bool isExcludedUser = false, bool isExcludedUser = false,
bool isFormFamilyFile = false,
int? responseID}) async { int? responseID}) async {
var request = RequestUtils.getCommonRequestSendActivationCode( var request = RequestUtils.getCommonRequestSendActivationCode(
otpTypeEnum: otpTypeEnum, otpTypeEnum: otpTypeEnum,
mobileNumber: phoneNumber, mobileNumber: phoneNumber,
selectedLoginType: otpTypeEnum.toInt(), selectedLoginType: otpTypeEnum.toInt(),
zipCode: selectedCountrySignup.countryCode, zipCode: selectedCountrySignup.countryCode,
nationalId: int.parse(nationalIdOrFileNumber), nationalId: int.parse(nationalIdOrFileNumber),
isFileNo: isForRegister ? isPatientHasFile(request: payload) : false, isFileNo: isForRegister ? isPatientHasFile(request: payload) : false,
patientId: 0, patientId: 0,
isForRegister: isForRegister, isForRegister: isForRegister,
patientOutSA: isForRegister patientOutSA: isForRegister
? isPatientOutsideSA(request: payload) ? isPatientOutsideSA(request: payload)
: selectedCountrySignup.countryCode == CountryEnum.saudiArabia : selectedCountrySignup.countryCode == CountryEnum.saudiArabia
? false ? false
: true, : true,
payload: payload, payload: payload,
isExcludedUser: isExcludedUser, isExcludedUser: isExcludedUser,
responseID: responseID, isFormFamilyFile: isFormFamilyFile,
); responseID: responseID);
// TODO: GET APP SMS SIGNATURE HERE // TODO: GET APP SMS SIGNATURE HERE
request.sMSSignature = await getSignature(); request.sMSSignature = await getSignature();
@ -382,7 +383,7 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
final resultEither = final resultEither =
await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isExcludedUser: isExcludedUser); await _authenticationRepo.sendActivationCodeRepo(sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile);
resultEither.fold( resultEither.fold(
(failure) async => await _errorHandlerService.handleError(failure: failure), (failure) async => await _errorHandlerService.handleError(failure: failure),
@ -397,9 +398,10 @@ class AuthenticationViewModel extends ChangeNotifier {
} else { } else {
if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) { if (apiResponse.data != null && apiResponse.data['isSMSSent'] == true) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
if (!isComingFromResendOTP) if (!isComingFromResendOTP) {
navigateToOTPScreen( navigateToOTPScreen(
otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload, isExcludedUser: isExcludedUser); otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber, isComingFromRegister: checkIsUserComingForRegister(request: payload), payload: payload, isExcludedUser: isExcludedUser);
}
} else { } else {
// TODO: Handle isSMSSent false // TODO: Handle isSMSSent false
// navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber); // navigateToOTPScreen(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumber);

@ -0,0 +1,57 @@
import 'dart:convert';
class FamilyFileRequest {
int? sharedPatientId;
String? sharedPatientIdentificationId;
int? searchType;
String? sharedPatientMobileNumber;
String? zipCode;
bool? isRegister;
int? patientStatus;
bool? isDentalAllowedBackend;
bool? isPatientExcluded;
int? responseID;
FamilyFileRequest({
this.sharedPatientId,
this.sharedPatientIdentificationId,
this.searchType,
this.sharedPatientMobileNumber,
this.zipCode,
this.isRegister,
this.patientStatus,
this.isDentalAllowedBackend,
this.isPatientExcluded,
this.responseID,
});
factory FamilyFileRequest.fromRawJson(String str) => FamilyFileRequest.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory FamilyFileRequest.fromJson(Map<String, dynamic> json) => FamilyFileRequest(
sharedPatientId: json["sharedPatientID"],
sharedPatientIdentificationId: json["sharedPatientIdentificationID"],
searchType: json["searchType"],
sharedPatientMobileNumber: json["sharedPatientMobileNumber"],
zipCode: json["zipCode"],
isRegister: json["isRegister"],
patientStatus: json["patientStatus"],
isDentalAllowedBackend: json["isDentalAllowedBackend"],
isPatientExcluded: json["IsPatientExcluded"],
responseID: json["ReponseID"],
);
Map<String, dynamic> toJson() => {
"SharedPatientID": sharedPatientId,
"SharedPatientIdentificationID": sharedPatientIdentificationId,
"SearchType": searchType,
"SharedPatientMobileNumber": sharedPatientMobileNumber,
"zipCode": zipCode,
"isRegister": isRegister,
"PatientStatus": patientStatus,
"isDentalAllowedBackend": isDentalAllowedBackend,
"IsPatientExcluded": isPatientExcluded,
"ReponseID": responseID,
};
}

@ -26,7 +26,7 @@ abstract class MedicalFileRepo {
Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles(); Future<Either<Failure, GenericApiModel<List<FamilyFileResponseModelLists>>>> getPatientFamilyFiles();
Future<Either<Failure, GenericApiModel<List<dynamic>>>> addFamilyFile({required dynamic request}); Future<Either<Failure, GenericApiModel<dynamic>>> addFamilyFile({required dynamic request});
} }
class MedicalFileRepoImp implements MedicalFileRepo { class MedicalFileRepoImp implements MedicalFileRepo {
@ -313,9 +313,9 @@ class MedicalFileRepoImp implements MedicalFileRepo {
} }
@override @override
Future<Either<Failure, GenericApiModel<List<dynamic>>>> addFamilyFile({dynamic request}) async { Future<Either<Failure, GenericApiModel<dynamic>>> addFamilyFile({dynamic request}) async {
try { try {
GenericApiModel<List<dynamic>>? apiResponse; GenericApiModel<dynamic>? apiResponse;
Failure? failure; Failure? failure;
await apiClient.post( await apiClient.post(
ApiConsts.addFamilyFile, ApiConsts.addFamilyFile,
@ -325,17 +325,12 @@ class MedicalFileRepoImp implements MedicalFileRepo {
}, },
onSuccess: (response, statusCode, {messageStatus, errorMessage}) { onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try { try {
print(response); apiResponse = GenericApiModel<dynamic>(
// final list = response['GetAllSharedRecordsByStatusList']; messageStatus: messageStatus,
// statusCode: statusCode,
// final familyLists = list.map((item) => FamilyFileResponseModelLists.fromJson(item as Map<String, dynamic>)).toList().cast<FamilyFileResponseModelLists>(); errorMessage: errorMessage,
// data: response["ShareFamilyFileObj"] ?? null,
// apiResponse = GenericApiModel<List<FamilyFileResponseModelLists>>( );
// messageStatus: messageStatus,
// statusCode: statusCode,
// errorMessage: null,
// data: familyLists,
// );
} catch (e) { } catch (e) {
failure = DataParsingFailure(e.toString()); failure = DataParsingFailure(e.toString());
} }

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart';
@ -6,6 +8,7 @@ import 'package:hmg_patient_app_new/core/utils/request_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart'; import 'package:hmg_patient_app_new/features/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart'; import 'package:hmg_patient_app_new/features/authentication/models/resp_models/authenticated_user_resp_model.dart';
import 'package:hmg_patient_app_new/features/common/models/family_file_request.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_repo.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/models/family_file_response_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart';
@ -13,6 +16,7 @@ import 'package:hmg_patient_app_new/features/medical_file/models/patient_sicklea
import 'package:hmg_patient_app_new/features/medical_file/models/patient_vaccine_response_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/models/patient_vaccine_response_model.dart';
import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
class MedicalFileViewModel extends ChangeNotifier { class MedicalFileViewModel extends ChangeNotifier {
int selectedTabIndex = 0; int selectedTabIndex = 0;
@ -298,12 +302,34 @@ class MedicalFileViewModel extends ChangeNotifier {
Future<void> addFamilyFile({required OTPTypeEnum otpTypeEnum, required bool isExcludedUser}) async { Future<void> addFamilyFile({required OTPTypeEnum otpTypeEnum, required bool isExcludedUser}) async {
AuthenticationViewModel authVM = getIt.get<AuthenticationViewModel>(); AuthenticationViewModel authVM = getIt.get<AuthenticationViewModel>();
final request = NavigationService navigationService = getIt.get<NavigationService>();
FamilyFileRequest request =
await RequestUtils.getAddFamilyRequest(nationalIDorFile: authVM.nationalIdController.text, mobileNo: authVM.phoneNumberController.text, countryCode: authVM.selectedCountrySignup.countryCode); await RequestUtils.getAddFamilyRequest(nationalIDorFile: authVM.nationalIdController.text, mobileNo: authVM.phoneNumberController.text, countryCode: authVM.selectedCountrySignup.countryCode);
final resultEither = await medicalFileRepo.addFamilyFile(request: request); final resultEither = await medicalFileRepo.addFamilyFile(request: request.toJson());
resultEither.fold((failure) async => await errorHandlerService.handleError(failure: failure), (apiResponse) async { resultEither.fold((failure) async => await errorHandlerService.handleError(failure: failure), (apiResponse) async {
print(apiResponse); if (apiResponse != null && apiResponse.data != null) {
request.isPatientExcluded = apiResponse.data["IsPatientExcluded"];
request.responseID = apiResponse.data["ReponseID"];
_dialogService.showExceptionBottomSheet(
message: apiResponse.data['Message'],
onOkPressed: () {
print("=================== On Press Ok ==================");
authVM.sendActivationCode(
otpTypeEnum: otpTypeEnum,
nationalIdOrFileNumber: request.sharedPatientIdentificationId!,
phoneNumber: request.sharedPatientMobileNumber!,
isForRegister: false,
isExcludedUser: apiResponse.data['IsPatientExcluded'],
responseID: apiResponse.data["ReponseID"],
isFormFamilyFile: true);
// insertFamilyData(payload: apiResponse.data![0]['ShareFamilyFileObj'], isExcludedPatient: apiResponse.data![0]['ShareFamilyFileObj']['IsPatientExcluded']);
},
onCancelPressed: () {
navigationService.pop();
});
}
}); });
} }
} }

@ -143,6 +143,13 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.file_icon, icon: AppAssets.file_icon,
labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}", labelText: "${LocaleKeys.fileNo.tr(context: context)}: ${appState.getAuthenticatedUser()!.patientId}",
onChipTap: () {
navigationService.pushPage(
page: FamilyMedicalScreen(
profiles: medicalFileViewModel.patientFamilyFiles,
onSelect: (FamilyFileResponseModelLists p1) {},
));
},
), ),
AppCustomChipWidget( AppCustomChipWidget(
icon: AppAssets.checkmark_icon, icon: AppAssets.checkmark_icon,

@ -28,10 +28,10 @@ class FamilyMedicalScreen extends StatefulWidget {
final Function(FamilyFileResponseModelLists) onSelect; final Function(FamilyFileResponseModelLists) onSelect;
const FamilyMedicalScreen({ const FamilyMedicalScreen({
Key? key, super.key,
required this.profiles, required this.profiles,
required this.onSelect, required this.onSelect,
}) : super(key: key); });
@override @override
State<FamilyMedicalScreen> createState() => _FamilyMedicalScreenState(); State<FamilyMedicalScreen> createState() => _FamilyMedicalScreenState();

@ -24,6 +24,7 @@ class AppCustomChipWidget extends StatelessWidget {
this.deleteIconColor = AppColors.textColor, this.deleteIconColor = AppColors.textColor,
this.deleteIconHasColor = false, this.deleteIconHasColor = false,
this.padding = EdgeInsets.zero, this.padding = EdgeInsets.zero,
this.onChipTap
}); });
final String? labelText; final String? labelText;
@ -40,74 +41,78 @@ class AppCustomChipWidget extends StatelessWidget {
final bool deleteIconHasColor; final bool deleteIconHasColor;
final OutlinedBorder? shape; final OutlinedBorder? shape;
final EdgeInsets? padding; final EdgeInsets? padding;
final void Function()? onChipTap;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ChipTheme( return GestureDetector(
data: ChipThemeData( onTap: onChipTap,
padding: EdgeInsets.all(0.0), child: ChipTheme(
shape: SmoothRectangleBorder( data: ChipThemeData(
side: BorderSide( padding: EdgeInsets.all(0.0),
width: 0.0, shape: SmoothRectangleBorder(
color: Colors.transparent, // Crucially, set color to transparent side: BorderSide(
style: BorderStyle.none, width: 0.0,
color: Colors.transparent, // Crucially, set color to transparent
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(10.0), // Apply a border radius of 16.0
), ),
borderRadius: BorderRadius.circular(10.0), // Apply a border radius of 16.0
), ),
child: icon.isNotEmpty
? Chip(
avatar: icon.isNotEmpty
? Utils.buildSvgWithAssets(
icon: icon,
width: iconSize.h,
height: iconSize.h,
iconColor: iconHasColor ? iconColor : null)
: SizedBox.shrink(),
label: richText ??
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
// padding: EdgeInsets.all(0.0),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: EdgeInsets.only(
left: -4.h,
right: deleteIcon?.isNotEmpty == true ? 2.h : 8.h),
backgroundColor: backgroundColor,
shape: shape,
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(
icon: deleteIcon!,
width: deleteIconSize!.width!.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
)
: Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ??
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
padding: EdgeInsets.all(0.0),
backgroundColor: backgroundColor,
shape: shape,
labelPadding: EdgeInsets.only(
left: 8.h,
right: deleteIcon?.isNotEmpty == true ? -2.h : 8.h),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(
icon: deleteIcon!,
width: deleteIconSize!.width.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
),
), ),
child: icon.isNotEmpty
? Chip(
avatar: icon.isNotEmpty
? Utils.buildSvgWithAssets(
icon: icon,
width: iconSize.h,
height: iconSize.h,
iconColor: iconHasColor ? iconColor : null)
: SizedBox.shrink(),
label: richText ??
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
// padding: EdgeInsets.all(0.0),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: EdgeInsets.only(
left: -4.h,
right: deleteIcon?.isNotEmpty == true ? 2.h : 8.h),
backgroundColor: backgroundColor,
shape: shape,
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(
icon: deleteIcon!,
width: deleteIconSize!.width!.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
)
: Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ??
labelText!.toText10(
weight: FontWeight.w500,
letterSpacing: -0.64,
color: textColor),
padding: EdgeInsets.all(0.0),
backgroundColor: backgroundColor,
shape: shape,
labelPadding: EdgeInsets.only(
left: 8.h,
right: deleteIcon?.isNotEmpty == true ? -2.h : 8.h),
deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(
icon: deleteIcon!,
width: deleteIconSize!.width.h,
height: deleteIconSize!.height.h,
iconColor: deleteIconHasColor ? deleteIconColor : null)
: null,
onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null,
),
); );
} }
} }

Loading…
Cancel
Save