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
e4558bf8
Commit
e4558bf8
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Add tests, try to understand the problem ...
parent
654281b3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/api.dart
+1
-1
1 addition, 1 deletion
lib/api.dart
lib/home.dart
+30
-40
30 additions, 40 deletions
lib/home.dart
lib/main.dart
+2
-1
2 additions, 1 deletion
lib/main.dart
lib/query.dart
+9
-1
9 additions, 1 deletion
lib/query.dart
with
42 additions
and
43 deletions
lib/api.dart
+
1
−
1
View file @
e4558bf8
...
@@ -296,7 +296,7 @@ List parseHistory(txs) {
...
@@ -296,7 +296,7 @@ List parseHistory(txs) {
i
++
;
i
++
;
}
}
transBC
.
sort
((
b
,
a
)
=
>
Comparable
.
compare
(
a
[
0
],
b
[
0
]));
//
transBC.sort((b, a) => Comparable.compare(a[0], b[0]));
return
transBC
;
return
transBC
;
}
}
This diff is collapsed.
Click to expand it.
lib/home.dart
+
30
−
40
View file @
e4558bf8
...
@@ -9,35 +9,19 @@ import "package:dio/dio.dart";
...
@@ -9,35 +9,19 @@ import "package:dio/dio.dart";
import
'package:graphql_flutter/graphql_flutter.dart'
;
import
'package:graphql_flutter/graphql_flutter.dart'
;
import
'query.dart'
;
import
'query.dart'
;
//
/ Integrates a list of articles with [ListPreferencesScreen].
//
ignore: must_be_immutable
class
HistoryListScreen
extends
StatefulWidget
{
class
HistoryListScreen
extends
StatefulWidget
{
@override
@override
_HistoryListScreenState
createState
()
=
>
_HistoryListScreenState
();
_HistoryListScreenState
createState
()
=
>
_HistoryListScreenState
();
}
}
// class HistoryListScreen extends StatefulWidget {
// // GeckoHome({Key key, this.title}) : super(key: key);
// // final String title;
// const HistoryListScreen({
// @required this.repository,
// final String title,
// Key key,
// }) : assert(repository != null),
// super(key: key);
// final Repository repository;
// @override
// _GeckoHomeState createState() => _GeckoHomeState();
// }
class
_HistoryListScreenState
extends
State
<
HistoryListScreen
>
{
class
_HistoryListScreenState
extends
State
<
HistoryListScreen
>
{
Uint8List
bytes
=
Uint8List
(
0
);
Uint8List
bytes
=
Uint8List
(
0
);
TextEditingController
_outputPubkey
;
TextEditingController
_outputPubkey
;
TextEditingController
_outputBalance
;
TextEditingController
_outputBalance
;
final
nRepositories
=
20
;
final
nRepositories
=
3
;
var
pubkey
=
''
;
var
pubkey
=
''
;
var
titi
=
'totooooooop'
;
ScrollController
_scrollController
=
new
ScrollController
();
ScrollController
_scrollController
=
new
ScrollController
();
@override
@override
...
@@ -54,10 +38,11 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -54,10 +38,11 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
// final
pubkey = 'D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU';
pubkey
=
'D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU'
;
// var pubkey = '';
// var pubkey = '';
print
(
'Build state : '
+
pubkey
);
print
(
'Build state : '
+
pubkey
);
print
(
titi
);
return
MaterialApp
(
return
MaterialApp
(
home:
Scaffold
(
home:
Scaffold
(
backgroundColor:
Colors
.
grey
[
300
],
backgroundColor:
Colors
.
grey
[
300
],
...
@@ -68,9 +53,10 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -68,9 +53,10 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
TextField
(
TextField
(
// enabled: false,
// enabled: false,
onChanged:
(
text
)
{
onChanged:
(
text
)
{
print
(
"Clé tappé:
$text
"
);
print
(
"Clé tappxé:
$text
"
);
// pubkey = text;
pubkey
=
text
;
pubkey
=
isPubkey
(
text
);
// pubkey =
isPubkey
(
text
);
},
},
controller:
this
.
_outputPubkey
,
controller:
this
.
_outputPubkey
,
maxLines:
1
,
maxLines:
1
,
...
@@ -114,10 +100,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -114,10 +100,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
children:
<
Widget
>[
children:
<
Widget
>[
Query
(
Query
(
options:
QueryOptions
(
options:
QueryOptions
(
documentNode:
gql
(
get
MyRepositories
),
documentNode:
gql
(
get
History
),
variables:
<
String
,
dynamic
>{
variables:
<
String
,
dynamic
>{
'pubkey'
:
'pubkey'
:
pubkey
,
// pubkey,
'D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU'
,
// pubkey,
'number'
:
nRepositories
,
'number'
:
nRepositories
,
// set cursor to null so as to start at the beginning
// set cursor to null so as to start at the beginning
// 'cursor': 0
// 'cursor': 0
...
@@ -138,8 +123,7 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -138,8 +123,7 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
if
(
result
.
data
==
null
&&
if
(
result
.
data
==
null
&&
result
.
exception
.
toString
()
==
null
)
{
result
.
exception
.
toString
()
==
null
)
{
return
const
Text
(
return
const
Text
(
'Both data and errors are null'
);
'Both data and errors are null, this is a known bug after refactoring, you might forget to set Github token'
);
}
}
final
List
<
dynamic
>
blockchainTX
=
final
List
<
dynamic
>
blockchainTX
=
...
@@ -152,7 +136,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -152,7 +136,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
final
Map
pageInfo
=
final
Map
pageInfo
=
result
.
data
[
'txsHistoryBc'
][
'both'
][
'pageInfo'
];
result
.
data
[
'txsHistoryBc'
][
'both'
][
'pageInfo'
];
final
String
fetchMoreCursor
=
pageInfo
[
'endCursor'
];
final
String
fetchMoreCursor
=
pageInfo
[
'endCursor'
]
??
'cest null...'
;
FetchMoreOptions
opts
=
FetchMoreOptions
(
FetchMoreOptions
opts
=
FetchMoreOptions
(
variables:
{
'cursor'
:
fetchMoreCursor
},
variables:
{
'cursor'
:
fetchMoreCursor
},
...
@@ -170,7 +156,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -170,7 +156,9 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
fetchMoreResultData
[
'txsHistoryBc'
][
'both'
]
fetchMoreResultData
[
'txsHistoryBc'
][
'both'
]
[
'edges'
]
=
repos
;
[
'edges'
]
=
repos
;
print
(
'A: '
+
fetchMoreCursor
+
' B'
);
print
(
'DEBUG NULL OPTION: '
);
print
(
fetchMoreResultData
);
print
(
fetchMoreCursor
);
return
fetchMoreResultData
;
return
fetchMoreResultData
;
},
},
);
);
...
@@ -180,13 +168,15 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -180,13 +168,15 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
if
(
_scrollController
.
position
.
pixels
==
if
(
_scrollController
.
position
.
pixels
==
_scrollController
.
position
.
maxScrollExtent
)
{
_scrollController
.
position
.
maxScrollExtent
)
{
if
(
!
result
.
loading
)
{
if
(
!
result
.
loading
)
{
print
(
'
B'
);
print
(
'
DEBUG NULL scrollController: '
+
print
(
opts
);
fetchMoreCursor
);
fetchMore
(
opts
);
fetchMore
(
opts
);
}
}
}
}
});
});
print
(
'DEBUG blockchainTX: '
+
blockchainTX
.
toString
());
List
transBC
=
parseHistory
(
blockchainTX
);
List
transBC
=
parseHistory
(
blockchainTX
);
// parseHistory(mempoolTX);
// parseHistory(mempoolTX);
...
@@ -204,7 +194,7 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -204,7 +194,7 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
BorderRadius
.
circular
(
3.0
)),
BorderRadius
.
circular
(
3.0
)),
// 3
// 3
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
.0
),
padding:
const
EdgeInsets
.
all
(
100
.0
),
// 4
// 4
child:
Column
(
child:
Column
(
children:
<
Widget
>[
children:
<
Widget
>[
...
@@ -278,7 +268,6 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -278,7 +268,6 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
child:
FittedBox
(
child:
FittedBox
(
child:
FloatingActionButton
(
child:
FloatingActionButton
(
onPressed:
()
=
>
_scan
(),
onPressed:
()
=
>
_scan
(),
// label: Text('Scanner'),
child:
Container
(
child:
Container
(
height:
40.0
,
height:
40.0
,
width:
40.0
,
width:
40.0
,
...
@@ -319,15 +308,16 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
...
@@ -319,15 +308,16 @@ class _HistoryListScreenState extends State<HistoryListScreen> {
print
(
"C'est une pubkey !!!"
);
print
(
"C'est une pubkey !!!"
);
showHistory
(
pubkey
);
showHistory
(
pubkey
);
//
setState(() {})
;
//
var tata = _scrollController
;
return
pubkey
;
// setState(() {
// print('setPubkey: ' + pubkey);
// print(pubkey);
// setState(({pubkey = 'D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU'}) {
// pubkey = pubkey;
// pubkey = pubkey;
// print('setState : ' + pubkey);
// // fetchMoreCursor = fetchMoreCursor;
// titi = 'lourd';
// });
// });
return
pubkey
;
}
else
{
}
else
{
return
''
;
return
''
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/main.dart
+
2
−
1
View file @
e4558bf8
...
@@ -24,7 +24,8 @@ class Gecko extends StatelessWidget {
...
@@ -24,7 +24,8 @@ class Gecko extends StatelessWidget {
);
);
return
MaterialApp
(
return
MaterialApp
(
title:
'Ğecko'
,
title:
'Ğecko'
,
theme:
ThemeData
(
primaryColor:
Colors
.
white
,
accentColor:
Colors
.
black
),
theme:
ThemeData
(
primaryColor:
Colors
.
blue
[
50
],
accentColor:
Colors
.
black
),
home:
GraphQLProvider
(
home:
GraphQLProvider
(
client:
_client
,
client:
_client
,
child:
HistoryListScreen
(),
child:
HistoryListScreen
(),
...
...
This diff is collapsed.
Click to expand it.
lib/query.dart
+
9
−
1
View file @
e4558bf8
const
String
get
MyRepositories
=
r''
'
const
String
get
History
=
r''
'
query (
$pubkey
: String!,
$number
: Int!,
$cursor
: String) {
query (
$pubkey
: String!,
$number
: Int!,
$cursor
: String) {
txsHistoryBc(
txsHistoryBc(
pubkeyOrScript:
$pubkey
pubkeyOrScript:
$pubkey
...
@@ -45,3 +45,11 @@ const String getMyRepositories = r'''
...
@@ -45,3 +45,11 @@ const String getMyRepositories = r'''
}
}
}
}
'''
;
'''
;
const
String
getxBalance
=
r''
'
query (
$pubkey
: String!) {
balance(script: "
$pubkey
") {
amount
base
}
'''
;
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