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
4d973073
Commit
4d973073
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Add debug for history Query state
parent
d80b1190
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/models/history.dart
+5
-2
5 additions, 2 deletions
lib/models/history.dart
lib/screens/history.dart
+58
-51
58 additions, 51 deletions
lib/screens/history.dart
lib/screens/myWallets/generateWallets.dart
+110
-97
110 additions, 97 deletions
lib/screens/myWallets/generateWallets.dart
with
173 additions
and
150 deletions
lib/models/history.dart
+
5
−
2
View file @
4d973073
...
...
@@ -11,10 +11,11 @@ import 'package:intl/intl.dart';
class
HistoryProvider
with
ChangeNotifier
{
String
pubkey
=
''
;
HistoryProvider
(
this
.
pubkey
);
final
TextEditingController
outputPubkey
=
new
TextEditingController
();
final
TextEditingController
outputPubkey
=
TextEditingController
();
bool
isTheEnd
=
false
;
List
transBC
;
bool
isFirstBuild
=
true
;
String
fetchMoreCursor
;
Future
scan
()
async
{
await
Permission
.
camera
.
request
();
...
...
@@ -131,7 +132,9 @@ class HistoryProvider with ChangeNotifier {
final
Map
pageInfo
=
result
.
data
[
'txsHistoryBc'
][
'both'
][
'pageInfo'
];
final
String
fetchMoreCursor
=
pageInfo
[
'endCursor'
];
fetchMoreCursor
=
pageInfo
[
'endCursor'
];
print
(
pageInfo
[
'hasPreviousPage'
]);
print
(
pageInfo
[
'hasNextPage'
]);
if
(
fetchMoreCursor
!=
null
)
{
opts
=
FetchMoreOptions
(
...
...
This diff is collapsed.
Click to expand it.
lib/screens/history.dart
+
58
−
51
View file @
4d973073
...
...
@@ -90,6 +90,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
CesiumPlusProvider
_cesiumPlusProvider
=
Provider
.
of
<
CesiumPlusProvider
>(
context
);
print
(
"I'M HERE 1"
);
bool
_isFirstExec
=
true
;
return
Expanded
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
...
...
@@ -105,8 +106,8 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
},
),
builder:
(
QueryResult
result
,
{
fetchMore
,
refetch
})
{
print
(
"I'M HERE 2 !"
);
print
(
result
.
source
.
isEager
);
print
(
"I'M HERE 2 !
$_isFirstExec
"
);
//
print(result.source.isEager);
if
(
result
.
isLoading
&&
result
.
data
==
null
)
{
print
(
"I'M HERE 3 !"
);
...
...
@@ -136,6 +137,8 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
opts
=
_historyProvider
.
checkQueryResult
(
result
,
opts
,
_outputPubkey
.
text
);
// _historyProvider.transBC = null;
// Build history list
return
NotificationListener
(
child:
Expanded
(
...
...
@@ -149,45 +152,48 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
padding:
const
EdgeInsets
.
only
(
left:
30
),
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getAvatar
(
_historyProvider
.
pubkey
),
initialData:
[
File
(
appPath
.
path
+
'/default_avatar.png'
)
],
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
>
_avatar
)
{
cesiumData
=
_avatar
.
data
;
// _cesiumPlusProvider.isComplete = true;
if
(
_avatar
.
connectionState
!=
ConnectionState
.
done
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
65
);
}
if
(
_avatar
.
hasError
)
{
if
(
_isFirstExec
)
Container
(
padding:
const
EdgeInsets
.
only
(
left:
30
),
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getAvatar
(
_historyProvider
.
pubkey
),
initialData:
[
File
(
appPath
.
path
+
'/default_avatar.png'
)
],
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
>
_avatar
)
{
cesiumData
=
_avatar
.
data
;
// _cesiumPlusProvider.isComplete = true;
if
(
_avatar
.
connectionState
!=
ConnectionState
.
done
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
65
);
}
if
(
_avatar
.
hasError
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
65
);
}
if
(
_avatar
.
hasData
)
{
return
SingleChildScrollView
(
padding:
EdgeInsets
.
all
(
0.0
),
child:
Image
.
file
(
_avatar
.
data
[
0
],
height:
65
));
}
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
65
);
}
if
(
_avatar
.
hasData
)
{
return
SingleChildScrollView
(
padding:
EdgeInsets
.
all
(
0.0
),
child:
Image
.
file
(
_avatar
.
data
[
0
],
height:
65
));
}
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
65
);
})),
Text
(
balance
.
toString
()
+
' Ğ1'
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
30.0
)),
})),
if
(
_isFirstExec
)
Text
(
balance
.
toString
()
+
' Ğ1'
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
30.0
)),
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
0
,
15
,
0
),
// .only(right: 15),
...
...
@@ -204,20 +210,21 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
color:
Color
(
0xFFB16E16
)))
]),
SizedBox
(
height:
10
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
// padding: const EdgeInsets.,
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getName
(
_historyProvider
.
pubkey
),
initialData:
''
,
builder:
(
context
,
snapshot
)
{
return
Text
(
snapshot
.
data
);
}))
]),
if
(
_isFirstExec
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
// padding: const EdgeInsets.,
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getName
(
_historyProvider
.
pubkey
),
initialData:
''
,
builder:
(
context
,
snapshot
)
{
return
Text
(
snapshot
.
data
);
}))
]),
SizedBox
(
height:
20
),
const
Divider
(
color:
Colors
.
grey
,
...
...
This diff is collapsed.
Click to expand it.
lib/screens/myWallets/generateWallets.dart
+
110
−
97
View file @
4d973073
import
'package:flutter/services.dart'
;
import
'package:gecko/models/generateWallets.dart'
;
import
'package:gecko/models/walletOptions.dart'
;
import
'package:gecko/screens/myWallets/confirmWalletStorage.dart'
;
import
'package:flutter/material.dart'
;
import
'package:printing/printing.dart'
;
...
...
@@ -21,6 +23,8 @@ class GenerateWalletsScreen extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
GenerateWalletsProvider
_generateWalletProvider
=
Provider
.
of
<
GenerateWalletsProvider
>(
context
);
WalletOptionsProvider
_walletOptions
=
Provider
.
of
<
WalletOptionsProvider
>(
context
);
_generateWalletProvider
.
generateMnemonic
();
print
(
'IS GENERATED ? : '
+
_generateWalletProvider
.
walletIsGenerated
.
toString
());
...
...
@@ -45,103 +49,112 @@ class GenerateWalletsScreen extends StatelessWidget {
backgroundColor:
Color
(
0xffEFEFBF
),
//Color(0xffFFD68E), //Color.fromARGB(500, 204, 255, 255),
))),
body:
SafeArea
(
child:
Column
(
children:
<
Widget
>[
SizedBox
(
height:
20
),
toolTips
(
_toolTipPubkey
,
'Clé publique:'
,
"C'est votre RIB en Ğ1, les gens l'utiliseront pour vous payer"
),
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
pubkey
,
maxLines:
1
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(),
style:
TextStyle
(
fontSize:
14.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
,
fontFamily:
'Monospace'
)),
SizedBox
(
height:
8
),
toolTips
(
_toolTipSentence
,
'Phrase de restauration:'
,
"Notez et gardez cette phrase précieusement sur un papier, elle vous servira à restaurer votre portefeuille sur un autre appareil"
),
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
mnemonicController
,
maxLines:
3
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
15.0
),
),
style:
TextStyle
(
fontSize:
22.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w400
)),
SizedBox
(
height:
8
),
toolTips
(
_toolTipSecret
,
'Code secret:'
,
"Retenez bien votre code secret, il vous sera demandé à chaque paiement, ainsi que pour configurer votre portefeuille"
),
Container
(
child:
Stack
(
alignment:
Alignment
.
centerRight
,
children:
<
Widget
>[
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
pin
,
maxLines:
1
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(),
style:
TextStyle
(
fontSize:
30.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
)),
IconButton
(
icon:
Icon
(
Icons
.
replay
),
color:
Color
(
0xffD28928
),
onPressed:
()
{
_generateWalletProvider
.
changePinCode
();
},
),
],
),
),
SizedBox
(
height:
20
),
new
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Color
(
0xffFFD68E
),
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
_generateWalletProvider
.
walletIsGenerated
?
()
{
_generateWalletProvider
.
nbrWord
=
_generateWalletProvider
.
getRandomInt
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
ConfirmStoreWallet
(
generatedMnemonic:
_generateWalletProvider
.
generatedMnemonic
,
generatedWallet:
_generateWalletProvider
.
actualWallet
);
}),
);
}
:
null
,
child:
Text
(
'Enregistrer ce portefeuille'
,
style:
TextStyle
(
fontSize:
20
))),
SizedBox
(
height:
20
),
GestureDetector
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
PrintWallet
(
_generateWalletProvider
.
generatedMnemonic
,
_generateWalletProvider
.
actualWallet
.
publicKey
);
}),
);
},
child:
Icon
(
Icons
.
print
))
]),
));
body:
Builder
(
builder:
(
ctx
)
=
>
SafeArea
(
child:
Column
(
children:
<
Widget
>[
SizedBox
(
height:
20
),
toolTips
(
_toolTipPubkey
,
'Clé publique:'
,
"C'est votre RIB en Ğ1, les gens l'utiliseront pour vous payer"
),
GestureDetector
(
onTap:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
_generateWalletProvider
.
pubkey
.
text
));
_walletOptions
.
snackCopyKey
(
ctx
);
},
child:
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
pubkey
,
maxLines:
1
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(),
style:
TextStyle
(
fontSize:
14.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
,
fontFamily:
'Monospace'
))),
SizedBox
(
height:
8
),
toolTips
(
_toolTipSentence
,
'Phrase de restauration:'
,
"Notez et gardez cette phrase précieusement sur un papier, elle vous servira à restaurer votre portefeuille sur un autre appareil"
),
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
mnemonicController
,
maxLines:
3
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(
contentPadding:
EdgeInsets
.
all
(
15.0
),
),
style:
TextStyle
(
fontSize:
22.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
w400
)),
SizedBox
(
height:
8
),
toolTips
(
_toolTipSecret
,
'Code secret:'
,
"Retenez bien votre code secret, il vous sera demandé à chaque paiement, ainsi que pour configurer votre portefeuille"
),
Container
(
child:
Stack
(
alignment:
Alignment
.
centerRight
,
children:
<
Widget
>[
TextField
(
enabled:
false
,
controller:
_generateWalletProvider
.
pin
,
maxLines:
1
,
textAlign:
TextAlign
.
center
,
decoration:
InputDecoration
(),
style:
TextStyle
(
fontSize:
30.0
,
color:
Colors
.
black
,
fontWeight:
FontWeight
.
bold
)),
IconButton
(
icon:
Icon
(
Icons
.
replay
),
color:
Color
(
0xffD28928
),
onPressed:
()
{
_generateWalletProvider
.
changePinCode
();
},
),
],
),
),
SizedBox
(
height:
20
),
new
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
primary:
Color
(
0xffFFD68E
),
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
_generateWalletProvider
.
walletIsGenerated
?
()
{
_generateWalletProvider
.
nbrWord
=
_generateWalletProvider
.
getRandomInt
();
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
ConfirmStoreWallet
(
generatedMnemonic:
_generateWalletProvider
.
generatedMnemonic
,
generatedWallet:
_generateWalletProvider
.
actualWallet
);
}),
);
}
:
null
,
child:
Text
(
'Enregistrer ce portefeuille'
,
style:
TextStyle
(
fontSize:
20
))),
SizedBox
(
height:
20
),
GestureDetector
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
PrintWallet
(
_generateWalletProvider
.
generatedMnemonic
,
_generateWalletProvider
.
actualWallet
.
publicKey
);
}),
);
},
child:
Icon
(
Icons
.
print
))
]),
)));
}
Widget
toolTips
(
_key
,
_text
,
_message
)
{
...
...
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