Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fred
ginkgo
Commits
1f5047cf
Commit
1f5047cf
authored
1 year ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Allow to Fav contacts in payments
parent
89506558
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ui/widgets/first_screen/pay_contact_search_page.dart
+3
-18
3 additions, 18 deletions
lib/ui/widgets/first_screen/pay_contact_search_page.dart
lib/ui/widgets/first_screen/recipient_widget.dart
+5
-0
5 additions, 0 deletions
lib/ui/widgets/first_screen/recipient_widget.dart
with
8 additions
and
18 deletions
lib/ui/widgets/first_screen/pay_contact_search_page.dart
+
3
−
18
View file @
1f5047cf
...
...
@@ -19,6 +19,7 @@ import '../../ui_helpers.dart';
import
'../custom_error_widget.dart'
;
import
'../loading_box.dart'
;
import
'../third_screen/contacts_page.dart'
;
import
'contact_fav_icon.dart'
;
class
PayContactSearchPage
extends
StatefulWidget
{
const
PayContactSearchPage
({
super
.
key
});
...
...
@@ -237,24 +238,8 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> {
},
trailing:
BlocBuilder
<
ContactsCubit
,
ContactsState
>(
builder:
(
BuildContext
context
,
ContactsState
state
)
{
final
ContactsCubit
contactsCubit
=
context
.
read
<
ContactsCubit
>();
final
bool
isFavorite
=
contactsCubit
.
isContact
(
contact
.
pubKey
);
return
IconButton
(
icon:
Icon
(
isFavorite
?
Icons
.
favorite
:
Icons
.
favorite_border
,
color:
isFavorite
?
Colors
.
red
.
shade400
:
null
,
),
onPressed:
()
{
// setState(() {
if
(
!
isFavorite
)
{
contactsCubit
.
addContact
(
contact
);
}
else
{
contactsCubit
.
removeContact
(
Contact
(
pubKey:
contact
.
pubKey
,
));
}
});
// });
return
ContactFavIcon
(
contact:
contact
,
contactsCubit:
context
.
read
<
ContactsCubit
>());
}),
);
}
...
...
This diff is collapsed.
Click to expand it.
lib/ui/widgets/first_screen/recipient_widget.dart
+
5
−
0
View file @
1f5047cf
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'../../../data/models/contact_cubit.dart'
;
import
'../../../data/models/payment_cubit.dart'
;
import
'../../../data/models/payment_state.dart'
;
import
'../../ui_helpers.dart'
;
import
'contact_fav_icon.dart'
;
class
RecipientWidget
extends
StatelessWidget
{
const
RecipientWidget
({
super
.
key
});
...
...
@@ -43,6 +45,9 @@ class RecipientWidget extends StatelessWidget {
],
),
),
ContactFavIcon
(
contact:
state
.
contact
!
,
contactsCubit:
context
.
watch
<
ContactsCubit
>()),
IconButton
(
icon:
const
Icon
(
Icons
.
cancel
),
onPressed:
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment