TF-1194 edit default identity: update presentation layer
This commit is contained in:
@@ -252,12 +252,20 @@ class IdentityCreatorController extends BaseController {
|
||||
.getSmallestOrderedIdentity(identities)
|
||||
?.map((identity) => identity.id!);
|
||||
|
||||
// if all identities have same sortOrder, it means it don't have default identity
|
||||
if (listDefaultIdentityIds?.length == identities?.length) {
|
||||
isDefaultIdentity.value = false;
|
||||
if (haveDefaultIdentities(identities, listDefaultIdentityIds) &&
|
||||
listDefaultIdentityIds?.contains(identity?.id) == true
|
||||
) {
|
||||
isDefaultIdentity.value = true;
|
||||
} else {
|
||||
isDefaultIdentity.value = listDefaultIdentityIds?.contains(identity?.id) ?? false;
|
||||
}
|
||||
isDefaultIdentity.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool haveDefaultIdentities(
|
||||
Iterable<Identity>? allIdentities,
|
||||
Iterable<IdentityId>? defaultIdentityIds
|
||||
) {
|
||||
return defaultIdentityIds?.length != allIdentities?.length;
|
||||
}
|
||||
|
||||
void selectSignatureType(BuildContext context, SignatureType newSignatureType) async {
|
||||
|
||||
@@ -205,10 +205,12 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
||||
Column(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 14),
|
||||
child: Text(controller.actionType.value == IdentityActionType.create
|
||||
child: Obx(() {
|
||||
return Text(controller.actionType.value == IdentityActionType.create
|
||||
? AppLocalizations.of(context).createNewIdentity.inCaps
|
||||
: AppLocalizations.of(context).edit_identity.inCaps,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black))),
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black));
|
||||
})),
|
||||
const SizedBox(height: 8),
|
||||
Expanded(
|
||||
child: KeyboardRichText(
|
||||
|
||||
Reference in New Issue
Block a user