Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
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
clients
Ğecko
Commits
6ec550e7
Commit
6ec550e7
authored
1 year ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
refacto: contact screen
parent
00b81d53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#18996
waiting for manual action
Stage: format
Stage: build_and_test
Stage: package
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/screens/my_contacts.dart
+2
-9
2 additions, 9 deletions
lib/screens/my_contacts.dart
lib/widgets/contacts_list.dart
+6
-5
6 additions, 5 deletions
lib/widgets/contacts_list.dart
with
8 additions
and
14 deletions
lib/screens/my_contacts.dart
+
2
−
9
View file @
6ec550e7
...
...
@@ -2,24 +2,19 @@ import 'package:easy_localization/easy_localization.dart';
import
'package:gecko/globals.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gecko/providers/duniter_indexer.dart'
;
import
'package:gecko/providers/wallets_profiles.dart'
;
import
'package:gecko/widgets/bottom_app_bar.dart'
;
import
'package:gecko/widgets/commons/offline_info.dart'
;
import
'package:gecko/widgets/contacts_list.dart'
;
import
'package:provider/provider.dart'
;
class
ContactsScreen
extends
StatelessWidget
{
const
ContactsScreen
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
WalletsProfilesProvider
walletsProfilesClass
=
Provider
.
of
<
WalletsProfilesProvider
>(
context
,
listen:
true
);
final
duniterIndexer
=
Provider
.
of
<
DuniterIndexer
>(
context
,
listen:
false
);
double
avatarSize
=
55
;
final
myContacts
=
contactsBox
.
toMap
()
.
values
.
toList
();
// Order contacts by username
myContacts
.
sort
((
p1
,
p2
)
{
return
Comparable
.
compare
(
p1
.
username
?.
toLowerCase
()
??
'zz'
,
p2
.
username
?.
toLowerCase
()
??
'zz'
);
...
...
@@ -41,9 +36,7 @@ class ContactsScreen extends StatelessWidget {
child:
Stack
(
children:
[
ContactsList
(
myContacts:
myContacts
,
avatarSize:
avatarSize
,
walletsProfilesClass:
walletsProfilesClass
,
duniterIndexer:
duniterIndexer
),
avatarSize:
avatarSize
),
const
OfflineInfo
(),
]),
),
...
...
This diff is collapsed.
Click to expand it.
lib/widgets/contacts_list.dart
+
6
−
5
View file @
6ec550e7
...
...
@@ -11,29 +11,30 @@ import 'package:gecko/providers/wallets_profiles.dart';
import
'package:gecko/screens/wallet_view.dart'
;
import
'package:gecko/widgets/balance.dart'
;
import
'package:gecko/widgets/name_by_address.dart'
;
import
'package:provider/provider.dart'
;
class
ContactsList
extends
StatelessWidget
{
const
ContactsList
({
Key
?
key
,
required
this
.
myContacts
,
required
this
.
avatarSize
,
required
this
.
walletsProfilesClass
,
required
this
.
duniterIndexer
,
})
:
super
(
key:
key
);
final
List
<
G1WalletsList
>
myContacts
;
final
double
avatarSize
;
final
WalletsProfilesProvider
walletsProfilesClass
;
final
DuniterIndexer
duniterIndexer
;
@override
Widget
build
(
BuildContext
context
)
{
final
walletsProfilesClass
=
Provider
.
of
<
WalletsProfilesProvider
>(
context
,
listen:
true
);
final
duniterIndexer
=
Provider
.
of
<
DuniterIndexer
>(
context
,
listen:
false
);
return
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
const
SizedBox
(
height:
20
),
const
SizedBox
(
height:
20
,
width:
double
.
infinity
),
if
(
myContacts
.
isEmpty
)
Text
(
'noContacts'
.
tr
())
else
...
...
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