Finally Fixed search field in payment page and cleaned up payment flow
This commit is contained in:
@@ -45,25 +45,44 @@ class RecipientSection extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SectionTitle(loc.recipient),
|
||||
SizedBox(height: dimensions.paddingSmall),
|
||||
RecipientSearchField(
|
||||
controller: searchController,
|
||||
onChanged: onSearchChanged,
|
||||
focusNode: searchFocusNode,
|
||||
),
|
||||
if (recipientProvider.query.isNotEmpty) ...[
|
||||
SizedBox(height: dimensions.paddingMedium),
|
||||
RecipientSearchResults(
|
||||
dimensions: dimensions,
|
||||
recipientProvider: recipientProvider,
|
||||
onRecipientSelected: onRecipientSelected,
|
||||
),
|
||||
],
|
||||
],
|
||||
return AnimatedBuilder(
|
||||
animation: recipientProvider,
|
||||
builder: (context, _) {
|
||||
final previousRecipient = recipientProvider.previousRecipient;
|
||||
final hasQuery = recipientProvider.query.isNotEmpty;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SectionTitle(loc.recipient),
|
||||
SizedBox(height: dimensions.paddingSmall),
|
||||
RecipientSearchField(
|
||||
controller: searchController,
|
||||
onChanged: onSearchChanged,
|
||||
focusNode: searchFocusNode,
|
||||
),
|
||||
if (previousRecipient != null) ...[
|
||||
SizedBox(height: dimensions.paddingSmall),
|
||||
ListTile(
|
||||
dense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(Icons.undo),
|
||||
title: Text(loc.back),
|
||||
subtitle: Text(previousRecipient.name),
|
||||
onTap: () => onRecipientSelected(previousRecipient),
|
||||
),
|
||||
],
|
||||
if (hasQuery) ...[
|
||||
SizedBox(height: dimensions.paddingMedium),
|
||||
RecipientSearchResults(
|
||||
dimensions: dimensions,
|
||||
recipientProvider: recipientProvider,
|
||||
onRecipientSelected: onRecipientSelected,
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user