Improve UI
This commit is contained in:
parent
00a27768e6
commit
30b5d1d91a
|
@ -83,173 +83,176 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
|
||||||
body: Builder(
|
body: Builder(
|
||||||
builder: (ctx) => SafeArea(
|
builder: (ctx) => SafeArea(
|
||||||
child: Column(children: <Widget>[
|
child: Column(children: <Widget>[
|
||||||
SizedBox(height: 25),
|
Container(
|
||||||
Row(children: <Widget>[
|
height: 15,
|
||||||
SizedBox(width: 25),
|
color: Color(0xffFFD68E),
|
||||||
Image.asset(
|
),
|
||||||
'assets/chopp-gecko2.png',
|
Container(
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
Image.asset(
|
gradient: LinearGradient(
|
||||||
'assets/walletOptions/camera.png',
|
begin: Alignment.topCenter,
|
||||||
),
|
end: Alignment.bottomCenter,
|
||||||
// SizedBox(width: 20),
|
colors: [
|
||||||
Column(children: <Widget>[
|
Color(0xffFFD68E),
|
||||||
Row(children: <Widget>[
|
Color(0xFFFFFCF7),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
SizedBox(width: 25),
|
||||||
|
Image.asset(
|
||||||
|
'assets/chopp-gecko2.png',
|
||||||
|
),
|
||||||
Column(children: <Widget>[
|
Column(children: <Widget>[
|
||||||
SizedBox(
|
Image.asset(
|
||||||
width: 250,
|
'assets/walletOptions/camera.png',
|
||||||
child: TextField(
|
|
||||||
// autofocus: true,
|
|
||||||
focusNode: _walletOptions.walletNameFocus,
|
|
||||||
enabled: _walletOptions.isEditing,
|
|
||||||
controller: _walletOptions.nameController,
|
|
||||||
maxLines: _nbrLinesName,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.all(15.0),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 27,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w400)),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 100)
|
||||||
// Query(
|
|
||||||
// options: QueryOptions(
|
|
||||||
// document: gql(getBalance),
|
|
||||||
// variables: <String, dynamic>{
|
|
||||||
// 'pubkey': _walletOptions.pubkey.text,
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// builder: (QueryResult result,
|
|
||||||
// {fetchMore, refetch}) {
|
|
||||||
// return Text(
|
|
||||||
// '$result DU',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 20, color: Colors.black),
|
|
||||||
// );
|
|
||||||
// }),
|
|
||||||
Query(
|
|
||||||
options: QueryOptions(
|
|
||||||
document: gql(
|
|
||||||
getBalance), // this is the query string you just created
|
|
||||||
variables: {
|
|
||||||
'pubkey': _walletOptions.pubkey.text,
|
|
||||||
},
|
|
||||||
pollInterval: Duration(seconds: 1),
|
|
||||||
),
|
|
||||||
builder: (QueryResult result,
|
|
||||||
{VoidCallback refetch, FetchMore fetchMore}) {
|
|
||||||
if (result.hasException) {
|
|
||||||
return Text(result.exception.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.isLoading) {
|
|
||||||
return Text('Loading');
|
|
||||||
}
|
|
||||||
// List repositories = result.data['viewer']['repositories']['nodes'];
|
|
||||||
String wBalanceUD;
|
|
||||||
if (result.data['balance'] == null) {
|
|
||||||
wBalanceUD = '0.0';
|
|
||||||
} else {
|
|
||||||
int wBalanceG1 = result.data['balance']['amount'];
|
|
||||||
int currentUD =
|
|
||||||
result.data['currentUd']['amount'];
|
|
||||||
double wBalanceUDBrut =
|
|
||||||
wBalanceG1 / currentUD; // .toString();
|
|
||||||
wBalanceUD = double.parse(
|
|
||||||
(wBalanceUDBrut).toStringAsFixed(2))
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
return Row(children: <Widget>[
|
|
||||||
ImageFiltered(
|
|
||||||
imageFilter: ImageFilter.blur(
|
|
||||||
sigmaX:
|
|
||||||
_walletOptions.isBalanceBlur ? 6 : 0,
|
|
||||||
sigmaY:
|
|
||||||
_walletOptions.isBalanceBlur ? 5 : 0),
|
|
||||||
child: Text('$wBalanceUD',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20, color: Colors.black)),
|
|
||||||
),
|
|
||||||
Text(' DU',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20, color: Colors.black))
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Text(
|
|
||||||
// '$wBalanceUD DU',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 20, color: Colors.black),
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(height: 5),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
_walletOptions.bluringBalance();
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/walletOptions/icon_oeuil.png',
|
|
||||||
)),
|
|
||||||
]),
|
]),
|
||||||
SizedBox(width: 0),
|
// SizedBox(width: 20),
|
||||||
Column(children: <Widget>[
|
Column(children: <Widget>[
|
||||||
InkWell(
|
Row(children: <Widget>[
|
||||||
onTap: () async {
|
Column(children: <Widget>[
|
||||||
// _walletOptions.isEditing = true;
|
SizedBox(
|
||||||
// _walletOptions.reloadBuild();
|
width: 250,
|
||||||
// _walletOptions.walletNameFocus
|
child: TextField(
|
||||||
// .requestFocus();
|
// autofocus: true,
|
||||||
_isNewNameValid = await _walletOptions
|
focusNode: _walletOptions.walletNameFocus,
|
||||||
.editWalletName(_walletOptions.walletID);
|
enabled: _walletOptions.isEditing,
|
||||||
// .then((_) {
|
controller: _walletOptions.nameController,
|
||||||
// _walletOptions.walletNameFocus
|
maxLines: _nbrLinesName,
|
||||||
// .requestFocus();
|
textAlign: TextAlign.center,
|
||||||
// _walletOptions.reloadBuild();
|
decoration: InputDecoration(
|
||||||
// });
|
border: InputBorder.none,
|
||||||
|
focusedBorder: InputBorder.none,
|
||||||
|
enabledBorder: InputBorder.none,
|
||||||
|
disabledBorder: InputBorder.none,
|
||||||
|
contentPadding: EdgeInsets.all(15.0),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 27,
|
||||||
|
color: Colors.black,
|
||||||
|
fontWeight: FontWeight.w400)),
|
||||||
|
),
|
||||||
|
SizedBox(height: 5),
|
||||||
|
Query(
|
||||||
|
options: QueryOptions(
|
||||||
|
document: gql(getBalance),
|
||||||
|
variables: {
|
||||||
|
'pubkey': _walletOptions.pubkey.text,
|
||||||
|
},
|
||||||
|
pollInterval: Duration(seconds: 1),
|
||||||
|
),
|
||||||
|
builder: (QueryResult result,
|
||||||
|
{VoidCallback refetch, FetchMore fetchMore}) {
|
||||||
|
if (result.hasException) {
|
||||||
|
return Text(result.exception.toString());
|
||||||
|
}
|
||||||
|
|
||||||
// .then(
|
if (result.isLoading) {
|
||||||
// (_result) {
|
return Text('Loading');
|
||||||
// if (_result == true) {
|
}
|
||||||
// WidgetsBinding.instance
|
// List repositories = result.data['viewer']['repositories']['nodes'];
|
||||||
// .addPostFrameCallback((_) {
|
String wBalanceUD;
|
||||||
// _myWalletProvider.listWallets =
|
if (result.data['balance'] == null) {
|
||||||
// _myWalletProvider
|
wBalanceUD = '0.0';
|
||||||
// .getAllWalletsNames(
|
} else {
|
||||||
// _currentChest);
|
int wBalanceG1 =
|
||||||
// _myWalletProvider.rebuildWidget();
|
result.data['balance']['amount'];
|
||||||
// });
|
int currentUD =
|
||||||
// Navigator.popUntil(
|
result.data['currentUd']['amount'];
|
||||||
// context,
|
double wBalanceUDBrut =
|
||||||
// ModalRoute.withName('/mywallets'),
|
wBalanceG1 / currentUD; // .toString();
|
||||||
// );
|
wBalanceUD = double.parse(
|
||||||
// }
|
(wBalanceUDBrut).toStringAsFixed(2))
|
||||||
// },
|
.toString();
|
||||||
// );
|
}
|
||||||
},
|
return Row(children: <Widget>[
|
||||||
child: ClipRRect(
|
ImageFiltered(
|
||||||
child: Image.asset(
|
imageFilter: ImageFilter.blur(
|
||||||
_walletOptions.isEditing
|
sigmaX: _walletOptions.isBalanceBlur
|
||||||
? 'assets/walletOptions/android-checkmark.png'
|
? 6
|
||||||
: 'assets/walletOptions/edit.png',
|
: 0,
|
||||||
width: 20,
|
sigmaY: _walletOptions.isBalanceBlur
|
||||||
height: 20),
|
? 5
|
||||||
)),
|
: 0),
|
||||||
// Image.asset(
|
child: Text('$wBalanceUD',
|
||||||
// 'assets/walletOptions/edit.png',
|
style: TextStyle(
|
||||||
// ),
|
fontSize: 20, color: Colors.black)),
|
||||||
SizedBox(
|
),
|
||||||
height: 60,
|
Text(' DU',
|
||||||
)
|
style: TextStyle(
|
||||||
])
|
fontSize: 20, color: Colors.black))
|
||||||
]),
|
]);
|
||||||
]),
|
|
||||||
]),
|
// Text(
|
||||||
|
// '$wBalanceUD DU',
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 20, color: Colors.black),
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(height: 5),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
_walletOptions.bluringBalance();
|
||||||
|
},
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/walletOptions/icon_oeuil.png',
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
SizedBox(width: 0),
|
||||||
|
Column(children: <Widget>[
|
||||||
|
InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
// _walletOptions.isEditing = true;
|
||||||
|
// _walletOptions.reloadBuild();
|
||||||
|
// _walletOptions.walletNameFocus
|
||||||
|
// .requestFocus();
|
||||||
|
_isNewNameValid = await _walletOptions
|
||||||
|
.editWalletName(_walletOptions.walletID);
|
||||||
|
// .then((_) {
|
||||||
|
// _walletOptions.walletNameFocus
|
||||||
|
// .requestFocus();
|
||||||
|
// _walletOptions.reloadBuild();
|
||||||
|
// });
|
||||||
|
|
||||||
|
// .then(
|
||||||
|
// (_result) {
|
||||||
|
// if (_result == true) {
|
||||||
|
// WidgetsBinding.instance
|
||||||
|
// .addPostFrameCallback((_) {
|
||||||
|
// _myWalletProvider.listWallets =
|
||||||
|
// _myWalletProvider
|
||||||
|
// .getAllWalletsNames(
|
||||||
|
// _currentChest);
|
||||||
|
// _myWalletProvider.rebuildWidget();
|
||||||
|
// });
|
||||||
|
// Navigator.popUntil(
|
||||||
|
// context,
|
||||||
|
// ModalRoute.withName('/mywallets'),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
child: ClipRRect(
|
||||||
|
child: Image.asset(
|
||||||
|
_walletOptions.isEditing
|
||||||
|
? 'assets/walletOptions/android-checkmark.png'
|
||||||
|
: 'assets/walletOptions/edit.png',
|
||||||
|
width: 20,
|
||||||
|
height: 20),
|
||||||
|
)),
|
||||||
|
// Image.asset(
|
||||||
|
// 'assets/walletOptions/edit.png',
|
||||||
|
// ),
|
||||||
|
SizedBox(
|
||||||
|
height: 60,
|
||||||
|
)
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
])),
|
||||||
FutureBuilder(
|
FutureBuilder(
|
||||||
future: _walletOptions
|
future: _walletOptions
|
||||||
.generateQRcode(_walletOptions.pubkey.text),
|
.generateQRcode(_walletOptions.pubkey.text),
|
||||||
|
@ -285,22 +288,33 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
|
||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
fontFamily: 'Monospace')),
|
fontFamily: 'Monospace')),
|
||||||
SizedBox(width: 15),
|
SizedBox(width: 15),
|
||||||
ElevatedButton(
|
SizedBox(
|
||||||
style: ElevatedButton.styleFrom(
|
height: 40,
|
||||||
shape: RoundedRectangleBorder(
|
child: ElevatedButton(
|
||||||
borderRadius: new BorderRadius.circular(8),
|
style: ElevatedButton.styleFrom(
|
||||||
),
|
shape: RoundedRectangleBorder(
|
||||||
elevation: 1,
|
borderRadius:
|
||||||
primary: Color(0xffD28928), // background
|
new BorderRadius.circular(8),
|
||||||
onPrimary: Colors.black, // foreground
|
),
|
||||||
),
|
elevation: 1,
|
||||||
onPressed: () {
|
primary: Color(0xffD28928), // background
|
||||||
ClipboardData(text: _walletOptions.pubkey.text);
|
onPrimary: Colors.black, // foreground
|
||||||
_walletOptions.snackCopyKey(ctx);
|
),
|
||||||
},
|
onPressed: () {
|
||||||
child: Text('Copier',
|
ClipboardData(
|
||||||
style: TextStyle(
|
text: _walletOptions.pubkey.text);
|
||||||
fontSize: 15, color: Colors.grey[50]))),
|
_walletOptions.snackCopyKey(ctx);
|
||||||
|
},
|
||||||
|
child: Row(children: <Widget>[
|
||||||
|
Image.asset(
|
||||||
|
'assets/walletOptions/copy-white.png',
|
||||||
|
),
|
||||||
|
SizedBox(width: 7),
|
||||||
|
Text('Copier',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 15,
|
||||||
|
color: Colors.grey[50]))
|
||||||
|
]))),
|
||||||
]))),
|
]))),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
InkWell(
|
InkWell(
|
||||||
|
|
Loading…
Reference in New Issue