Improve UI

This commit is contained in:
poka 2021-03-21 01:22:52 +01:00
parent 00a27768e6
commit 30b5d1d91a
1 changed files with 192 additions and 178 deletions

View File

@ -83,15 +83,31 @@ 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,
color: Color(0xffFFD68E),
),
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xffFFD68E),
Color(0xFFFFFCF7),
],
)),
child: Row(children: <Widget>[
SizedBox(width: 25), SizedBox(width: 25),
Image.asset( Image.asset(
'assets/chopp-gecko2.png', 'assets/chopp-gecko2.png',
), ),
Column(children: <Widget>[
Image.asset( Image.asset(
'assets/walletOptions/camera.png', 'assets/walletOptions/camera.png',
), ),
SizedBox(height: 100)
]),
// SizedBox(width: 20), // SizedBox(width: 20),
Column(children: <Widget>[ Column(children: <Widget>[
Row(children: <Widget>[ Row(children: <Widget>[
@ -118,25 +134,9 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
fontWeight: FontWeight.w400)), fontWeight: FontWeight.w400)),
), ),
SizedBox(height: 5), SizedBox(height: 5),
// 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( Query(
options: QueryOptions( options: QueryOptions(
document: gql( document: gql(getBalance),
getBalance), // this is the query string you just created
variables: { variables: {
'pubkey': _walletOptions.pubkey.text, 'pubkey': _walletOptions.pubkey.text,
}, },
@ -156,7 +156,8 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
if (result.data['balance'] == null) { if (result.data['balance'] == null) {
wBalanceUD = '0.0'; wBalanceUD = '0.0';
} else { } else {
int wBalanceG1 = result.data['balance']['amount']; int wBalanceG1 =
result.data['balance']['amount'];
int currentUD = int currentUD =
result.data['currentUd']['amount']; result.data['currentUd']['amount'];
double wBalanceUDBrut = double wBalanceUDBrut =
@ -168,10 +169,12 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
return Row(children: <Widget>[ return Row(children: <Widget>[
ImageFiltered( ImageFiltered(
imageFilter: ImageFilter.blur( imageFilter: ImageFilter.blur(
sigmaX: sigmaX: _walletOptions.isBalanceBlur
_walletOptions.isBalanceBlur ? 6 : 0, ? 6
sigmaY: : 0,
_walletOptions.isBalanceBlur ? 5 : 0), sigmaY: _walletOptions.isBalanceBlur
? 5
: 0),
child: Text('$wBalanceUD', child: Text('$wBalanceUD',
style: TextStyle( style: TextStyle(
fontSize: 20, color: Colors.black)), fontSize: 20, color: Colors.black)),
@ -249,7 +252,7 @@ class WalletOptions extends StatelessWidget with ChangeNotifier {
]) ])
]), ]),
]), ]),
]), ])),
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(
height: 40,
child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8), borderRadius:
new BorderRadius.circular(8),
), ),
elevation: 1, elevation: 1,
primary: Color(0xffD28928), // background primary: Color(0xffD28928), // background
onPrimary: Colors.black, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () { onPressed: () {
ClipboardData(text: _walletOptions.pubkey.text); ClipboardData(
text: _walletOptions.pubkey.text);
_walletOptions.snackCopyKey(ctx); _walletOptions.snackCopyKey(ctx);
}, },
child: Text('Copier', child: Row(children: <Widget>[
Image.asset(
'assets/walletOptions/copy-white.png',
),
SizedBox(width: 7),
Text('Copier',
style: TextStyle( style: TextStyle(
fontSize: 15, color: Colors.grey[50]))), fontSize: 15,
color: Colors.grey[50]))
]))),
]))), ]))),
SizedBox(height: 10), SizedBox(height: 10),
InkWell( InkWell(