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
vjrj
ginkgo
Commits
306a8a86
Commit
306a8a86
authored
2 years ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Added missing widget
parent
c561e9aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ui/widgets/fifth_screen/node_info.dart
+51
-0
51 additions, 0 deletions
lib/ui/widgets/fifth_screen/node_info.dart
with
51 additions
and
0 deletions
lib/ui/widgets/fifth_screen/node_info.dart
0 → 100644
+
51
−
0
View file @
306a8a86
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'../../../data/models/node.dart'
;
import
'../../../data/models/node_list_cubit.dart'
;
import
'../../../data/models/node_list_state.dart'
;
import
'../../../data/models/node_manager.dart'
;
import
'../../../g1/api.dart'
;
import
'../../../main.dart'
;
import
'../fifth_screen/info_card.dart'
;
class
NodeInfoCard
extends
StatelessWidget
{
const
NodeInfoCard
({
super
.
key
,
required
this
.
type
});
final
NodeType
type
;
@override
Widget
build
(
BuildContext
context
)
{
return
BlocBuilder
<
NodeListCubit
,
NodeListState
>(
builder:
(
BuildContext
nodeContext
,
NodeListState
state
)
{
final
List
<
Node
>
nodes
=
type
==
NodeType
.
duniter
?
state
.
duniterNodes
:
state
.
cesiumPlusNodes
;
return
GestureDetector
(
onTap:
()
=
>
ScaffoldMessenger
.
of
(
context
)
.
showSnackBar
(
SnackBar
(
content:
Text
(
tr
(
'long_press_to_refresh'
)),
),
),
onLongPress:
()
{
logger
(
'On long press'
);
if
(
type
==
NodeType
.
duniter
)
{
fetchDuniterNodes
(
force:
true
);
}
else
{
fetchCesiumPlusNodes
(
force:
true
);
}
},
child:
InfoCard
(
title:
tr
(
'using_nodes'
,
namedArgs:
<
String
,
String
>{
'type'
:
type
.
name
,
'nodes'
:
nodes
.
length
.
toString
()
}),
translate:
false
,
subtitle:
nodes
.
isNotEmpty
?
tr
(
'using_nodes_first'
,
namedArgs:
<
String
,
String
>{
'node'
:
nodes
.
first
.
url
})
:
''
,
icon:
Icons
.
hub
));
});
}
}
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