Skip to content
Snippets Groups Projects
Select Git revision
  • c4bdceaf4f9d2f044e09c4fa91e5120683b55715
  • master default protected
  • polkadart-stuff
  • provider-to-riverpod
  • implementLightnode
  • hugo_RML16
  • refactorOnboardingSlideshow
  • duniterV1Latest
  • scanNetwork
  • dubp_rs
  • v0.2.15+137
  • v0.2.14+134
  • v0.2.13+133
  • v0.2.13+132
  • v0.2.12+131
  • v0.2.11+130
  • v0.2.10+129
  • v0.2.9+128
  • v0.2.8+127
  • v0.2.7+125
  • v0.2.6+124
  • v0.2.5+123
  • v0.2.4+122
  • v0.2.3+119
  • v0.2.2+118
  • v0.2.1+113
  • polkawallet-sdk-latest
  • v0.1.29+111
  • v0.1.28+109
  • v0.1.27+108
30 results

balance_display.dart

Blame
  • certifications.dart 1.60 KiB
    import 'package:flutter/material.dart';
    import 'package:gecko/models/scale_functions.dart';
    import 'package:gecko/providers/substrate_sdk.dart';
    import 'package:provider/provider.dart';
    
    class Certifications extends StatelessWidget {
      const Certifications(
          {Key? key,
          required this.address,
          required this.size,
          this.color = Colors.black})
          : super(key: key);
      final String address;
      final double size;
      final Color color;
    
      @override
      Widget build(BuildContext context) {
        final sub = Provider.of<SubstrateSdk>(context);
    
        return Column(children: <Widget>[
          FutureBuilder(
              future: sub.getCertsCounter(address),
              builder: (BuildContext context, AsyncSnapshot<List<int>?> certs) {
                if ((certs.data == null || certs.data!.isEmpty) ||
                    sub.certsCounterCache[address] == null) {
                  return const SizedBox.shrink();
                }
    
                final receivedCount = sub.certsCounterCache[address]![0];
                final sentCount = sub.certsCounterCache[address]![1];
    
                return Row(
                  children: [
                    Image.asset('assets/medal.png',
                        color: color, height: scaleSize(18)),
                    ScaledSizedBox(width: 1),
                    Text(receivedCount.toString(),
                        style: scaledTextStyle(fontSize: size, color: color)),
                    ScaledSizedBox(width: 5),
                    Text(
                      "($sentCount)",
                      style: scaledTextStyle(fontSize: size * 0.7, color: color),
                    )
                  ],
                );
              }),
        ]);
      }
    }