Skip to content
Snippets Groups Projects
Commit 9f014480 authored by poka's avatar poka
Browse files

feat: show certifications on membre wallet tule

parent bad65f55
No related branches found
No related tags found
No related merge requests found
...@@ -20,66 +20,62 @@ class CertTile extends StatelessWidget { ...@@ -20,66 +20,62 @@ class CertTile extends StatelessWidget {
return Column( return Column(
children: listCerts.map((repository) { children: listCerts.map((repository) {
// log.d('bbbbbbbbbbbbbbbbbbbbbb: ' + repository.toString());
return Column(children: <Widget>[ return Column(children: <Widget>[
Padding( Padding(
padding: const EdgeInsets.only(right: 0), padding: const EdgeInsets.only(right: 0),
child: child: ListTile(
// Row(children: [Column(children: [],)],) key: keyTransaction(keyID++),
ListTile( contentPadding: const EdgeInsets.only(
key: keyTransaction(keyID++), left: 20, right: 30, top: 15, bottom: 15),
contentPadding: const EdgeInsets.only( leading: ClipOval(
left: 20, right: 30, top: 15, bottom: 15), child: defaultAvatar(avatarSize),
leading: ClipOval( ),
child: defaultAvatar(avatarSize), title: Padding(
), padding: const EdgeInsets.only(bottom: 5),
title: Padding( child: Text(repository['name'],
padding: const EdgeInsets.only(bottom: 5), style: const TextStyle(fontSize: 22)),
child: Text(repository['name'], ),
style: const TextStyle(fontSize: 22)), subtitle: RichText(
text: TextSpan(
style: TextStyle(
fontSize: 18,
color: Colors.grey[700],
), ),
subtitle: RichText( children: <TextSpan>[
text: TextSpan( TextSpan(
style: TextStyle( text: repository['date'],
fontSize: 18, ),
color: Colors.grey[700], if (repository[2] != '')
), TextSpan(
children: <TextSpan>[ text: ' · ',
TextSpan( style: TextStyle(
text: repository['date'], fontSize: 20,
), color: Colors.grey[550],
if (repository[2] != '')
TextSpan(
text: ' · ',
style: TextStyle(
fontSize: 20,
color: Colors.grey[550],
),
),
TextSpan(
text: getShortPubkey(repository['address']),
style: TextStyle(
fontStyle: FontStyle.italic,
color: Colors.grey[600],
fontSize: 18),
), ),
], ),
TextSpan(
text: getShortPubkey(repository['address']),
style: TextStyle(
fontStyle: FontStyle.italic,
color: Colors.grey[600],
fontSize: 18),
), ),
), ],
dense: false, ),
isThreeLine: false, ),
onTap: () { dense: false,
Navigator.push( isThreeLine: false,
homeContext, onTap: () {
MaterialPageRoute(builder: (context) { Navigator.push(
return WalletViewScreen( homeContext,
address: repository['address'], MaterialPageRoute(builder: (context) {
username: repository['name'], return WalletViewScreen(
); address: repository['address'],
}), username: repository['name'],
); );
}), }),
);
}),
), ),
]); ]);
}).toList()); }).toList());
......
...@@ -23,14 +23,15 @@ class Certifications extends StatelessWidget { ...@@ -23,14 +23,15 @@ class Certifications extends StatelessWidget {
return certs.data != null return certs.data != null
? Row( ? Row(
children: [ children: [
Image.asset('assets/medal.png', height: 20), Image.asset('assets/medal.png',
color: color, height: 20),
const SizedBox(width: 1), const SizedBox(width: 1),
Text(certs.data?[0].toString() ?? '0', Text(certs.data?[0].toString() ?? '0',
style: const TextStyle(fontSize: 20)), style: TextStyle(fontSize: 20, color: color)),
const SizedBox(width: 5), const SizedBox(width: 5),
Text( Text(
"(${certs.data?[1].toString() ?? '0'})", "(${certs.data?[1].toString() ?? '0'})",
style: const TextStyle(fontSize: 14), style: TextStyle(fontSize: 14, color: color),
) )
], ],
) )
......
...@@ -6,6 +6,7 @@ import 'package:gecko/models/widgets_keys.dart'; ...@@ -6,6 +6,7 @@ import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/my_wallets.dart'; import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/screens/myWallets/wallet_options.dart'; import 'package:gecko/screens/myWallets/wallet_options.dart';
import 'package:gecko/widgets/balance.dart'; import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/certifications.dart';
import 'package:gecko/widgets/commons/smooth_transition.dart'; import 'package:gecko/widgets/commons/smooth_transition.dart';
import 'package:gecko/widgets/name_by_address.dart'; import 'package:gecko/widgets/name_by_address.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
...@@ -48,63 +49,84 @@ class WalletTileMembre extends StatelessWidget { ...@@ -48,63 +49,84 @@ class WalletTileMembre extends StatelessWidget {
borderRadius: const BorderRadius.all(Radius.circular(12)), borderRadius: const BorderRadius.all(Radius.circular(12)),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Stack(
width: double.infinity, children: [
height: double.infinity, Container(
decoration: const BoxDecoration( width: double.infinity,
gradient: RadialGradient( height: double.infinity,
radius: 0.8, decoration: const BoxDecoration(
colors: [ gradient: RadialGradient(
Color.fromARGB(255, 255, 255, 211), radius: 0.8,
yellowC, colors: [
], Color.fromARGB(255, 255, 255, 211),
), yellowC,
), ],
child: repository.imageCustomPath == null ||
repository.imageCustomPath == ''
? Image.asset(
'assets/avatars/${repository.imageDefaultPath}',
alignment: Alignment.bottomCenter,
scale: 0.5,
)
: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
image: DecorationImage(
fit: BoxFit.fitHeight,
image: FileImage(
File(repository.imageCustomPath!),
),
),
), ),
), ),
)), child: repository.imageCustomPath == null ||
repository.imageCustomPath == ''
? Image.asset(
'assets/avatars/${repository.imageDefaultPath}',
alignment: Alignment.bottomCenter,
scale: 0.5,
)
: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.transparent,
image: DecorationImage(
fit: BoxFit.fitHeight,
image: FileImage(
File(repository.imageCustomPath!),
),
),
),
),
),
Positioned(
left: 25,
top: 25,
child: Opacity(
opacity: 0.6,
child: Image.asset('assets/medal.png',
color: Colors.black, height: 40),
),
),
],
),
),
Stack(children: <Widget>[ Stack(children: <Widget>[
BalanceBuilder( BalanceBuilder(
address: repository.address, address: repository.address,
isDefault: repository.address == defaultWallet.address), isDefault: repository.address == defaultWallet.address),
Row( Row(mainAxisAlignment: MainAxisAlignment.center, children: [
mainAxisAlignment: MainAxisAlignment.center, Column(children: [
children: [ const SizedBox(height: 10),
Column( Opacity(
children: [ opacity: 0.7,
const SizedBox(height: 7), child: NameByAddress(
Opacity( wallet: repository,
opacity: 0.7, size: 20,
child: NameByAddress( color: defaultWallet.address == repository.address
wallet: repository, ? Colors.white
size: 20, : Colors.black,
color: fontWeight: FontWeight.w600,
defaultWallet.address == repository.address fontStyle: FontStyle.normal,
? Colors.white ))
: Colors.black, ]),
fontWeight: FontWeight.w600, ]),
fontStyle: FontStyle.normal, Positioned(
)) right: 25,
], top: 25,
), child: Opacity(
], opacity: 0.7,
child: Certifications(
address: repository.address,
color: defaultWallet.address == repository.address
? Colors.white
: Colors.black,
size: 15),
),
), ),
]), ]),
]), ]),
...@@ -133,7 +155,7 @@ class BalanceBuilder extends StatelessWidget { ...@@ -133,7 +155,7 @@ class BalanceBuilder extends StatelessWidget {
color: isDefault ? orangeC : yellowC, color: isDefault ? orangeC : yellowC,
child: Padding( child: Padding(
padding: padding:
const EdgeInsets.only(left: 5, right: 5, top: 45, bottom: 10), const EdgeInsets.only(left: 5, right: 5, top: 45, bottom: 15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment