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
f65b194e
Commit
f65b194e
authored
1 year ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
refacto: remove deprecated code
parent
6f2d33b7
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/providers/wallet_options.dart
+0
-14
0 additions, 14 deletions
lib/providers/wallet_options.dart
lib/screens/myWallets/choose_wallet.dart
+0
-237
0 additions, 237 deletions
lib/screens/myWallets/choose_wallet.dart
with
0 additions
and
251 deletions
lib/providers/wallet_options.dart
+
0
−
14
View file @
f65b194e
...
...
@@ -369,18 +369,4 @@ class WalletOptionsProvider with ChangeNotifier {
await
configBox
.
put
(
'isCacheChecked'
,
!
isCacheChecked
);
notifyListeners
();
}
String
?
getAddress
(
int
chest
,
int
derivation
)
{
String
?
addressGet
;
walletBox
.
toMap
()
.
forEach
((
key
,
value
)
{
if
(
value
.
chest
==
chest
&&
value
.
derivation
==
derivation
)
{
addressGet
=
value
.
address
;
return
;
}
});
address
.
text
=
addressGet
??
''
;
return
addressGet
;
}
}
This diff is collapsed.
Click to expand it.
lib/screens/myWallets/choose_wallet.dart
deleted
100644 → 0
+
0
−
237
View file @
6f2d33b7
// ignore_for_file: use_build_context_synchronously, must_be_immutable
import
'dart:io'
;
import
'package:easy_localization/easy_localization.dart'
;
import
'package:gecko/globals.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gecko/models/wallet_data.dart'
;
import
'package:gecko/models/widgets_keys.dart'
;
import
'package:gecko/providers/my_wallets.dart'
;
import
'package:gecko/providers/substrate_sdk.dart'
;
import
'package:gecko/screens/myWallets/wallets_home.dart'
;
import
'package:gecko/widgets/balance.dart'
;
import
'package:provider/provider.dart'
;
// import 'package:gecko/models/home.dart';
// import 'package:provider/provider.dart';
class
ChooseWalletScreen
extends
StatelessWidget
{
ChooseWalletScreen
({
Key
?
key
,
required
this
.
pin
})
:
super
(
key:
key
);
final
String
pin
;
WalletData
?
selectedWallet
;
@override
Widget
build
(
BuildContext
context
)
{
final
sub
=
Provider
.
of
<
SubstrateSdk
>(
context
,
listen:
false
);
final
int
chest
=
configBox
.
get
(
'currentChest'
);
return
Scaffold
(
backgroundColor:
backgroundColor
,
appBar:
AppBar
(
toolbarHeight:
60
*
ratio
,
title:
SizedBox
(
height:
22
,
child:
Text
(
'choiceOfSourceWallet'
.
tr
()),
)),
body:
SafeArea
(
child:
Stack
(
children:
[
myWalletsTiles
(
context
,
chest
),
Positioned
.
fill
(
bottom:
60
,
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
SizedBox
(
width:
470
,
height:
70
,
child:
ElevatedButton
(
key:
keyConfirm
,
style:
ElevatedButton
.
styleFrom
(
foregroundColor:
Colors
.
white
,
elevation:
4
,
backgroundColor:
orangeC
,
// foreground
),
onPressed:
()
async
{
await
sub
.
setCurrentWallet
(
selectedWallet
!
);
sub
.
reload
();
// Navigator.pop(context);
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
child:
Text
(
'chooseThisWallet'
.
tr
(),
style:
const
TextStyle
(
fontSize:
24
,
fontWeight:
FontWeight
.
w600
),
),
),
),
),
),
]),
));
}
Widget
myWalletsTiles
(
BuildContext
context
,
int
currentChest
)
{
final
myWalletProvider
=
Provider
.
of
<
MyWalletsProvider
>(
context
);
final
bool
isWalletsExists
=
myWalletProvider
.
checkIfWalletExist
();
WalletData
?
defaultWallet
=
myWalletProvider
.
getDefaultWallet
();
selectedWallet
??=
defaultWallet
;
myWalletProvider
.
readAllWallets
(
currentChest
);
if
(
!
isWalletsExists
)
{
return
const
Text
(
''
);
}
if
(
myWalletProvider
.
listWallets
.
isEmpty
)
{
return
const
Column
(
children:
<
Widget
>[
Center
(
child:
Text
(
'Veuillez générer votre premier portefeuille'
,
style:
TextStyle
(
fontSize:
17
,
fontWeight:
FontWeight
.
w500
),
)),
]);
}
List
<
WalletData
>
listWallets
=
myWalletProvider
.
listWallets
;
listWallets
.
sort
((
p1
,
p2
)
{
return
Comparable
.
compare
(
p1
.
number
!
,
p2
.
number
!
);
});
final
screenWidth
=
MediaQuery
.
of
(
context
)
.
size
.
width
;
int
nTule
=
2
;
if
(
screenWidth
>
=
900
)
{
nTule
=
4
;
}
else
if
(
screenWidth
>
=
650
)
{
nTule
=
3
;
}
return
CustomScrollView
(
slivers:
<
Widget
>[
const
SliverToBoxAdapter
(
child:
SizedBox
(
height:
20
)),
SliverGrid
.
count
(
key:
keyListWallets
,
crossAxisCount:
nTule
,
childAspectRatio:
1
,
crossAxisSpacing:
0
,
mainAxisSpacing:
0
,
children:
<
Widget
>[
for
(
WalletData
repository
in
listWallets
)
Padding
(
padding:
const
EdgeInsets
.
all
(
16
),
child:
GestureDetector
(
key:
keySelectThisWallet
(
repository
.
address
),
onTap:
()
{
selectedWallet
=
repository
;
myWalletProvider
.
reload
();
},
child:
ClipOvalShadow
(
shadow:
const
Shadow
(
color:
Colors
.
transparent
,
offset:
Offset
(
0
,
0
),
blurRadius:
5
,
),
clipper:
CustomClipperOval
(),
child:
ClipRRect
(
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
12
)),
child:
Column
(
children:
<
Widget
>[
Expanded
(
child:
Container
(
width:
double
.
infinity
,
height:
double
.
infinity
,
decoration:
BoxDecoration
(
gradient:
RadialGradient
(
radius:
0.6
,
colors:
[
Colors
.
green
[
400
]
!
,
const
Color
(
0xFFE7E7A6
),
],
)),
child:
repository
.
imageCustomPath
==
null
?
Image
.
asset
(
'assets/avatars/
${repository.imageDefaultPath}
'
,
alignment:
Alignment
.
bottomCenter
,
scale:
0.5
,
)
:
Container
(
width:
120
,
height:
120
,
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
transparent
,
image:
DecorationImage
(
fit:
BoxFit
.
contain
,
image:
FileImage
(
File
(
repository
.
imageCustomPath
!
),
),
),
),
),
)),
balanceBuilder
(
context
,
repository
.
address
,
selectedWallet
!.
address
==
repository
.
address
),
ListTile
(
shape:
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
12
),
),
),
tileColor:
repository
.
address
==
selectedWallet
!.
address
?
orangeC
:
const
Color
(
0xffFFD58D
),
title:
Center
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
5
),
child:
Text
(
repository
.
name
!
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
17.0
,
color:
repository
.
address
==
selectedWallet
!.
address
?
const
Color
(
0xffF9F9F1
)
:
Colors
.
black
,
fontStyle:
FontStyle
.
italic
),
),
),
),
onTap:
()
async
{
selectedWallet
=
repository
;
myWalletProvider
.
reload
();
},
)
]),
),
),
)),
]),
]);
}
Widget
balanceBuilder
(
context
,
String
address
,
bool
isDefault
)
{
return
Container
(
width:
double
.
infinity
,
color:
isDefault
?
orangeC
:
yellowC
,
child:
SizedBox
(
height:
30
,
child:
Column
(
children:
[
const
Spacer
(),
// Text(
// '0.0 gd',
// textAlign: TextAlign.center,
// style: TextStyle(color: isDefault ? Colors.white : Colors.black),
// ),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Balance
(
address:
address
,
size:
16
,
color:
isDefault
?
Colors
.
white
:
Colors
.
black
),
])
]),
),
);
}
}
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