commercio_ui 0.1.0 copy "commercio_ui: ^0.1.0" to clipboard
commercio_ui: ^0.1.0 copied to clipboard

CommercioUI pre-build clean Core+UI widgets intended to reduce significantly the overall blockchain app development time

example/README.md

Examples #

The library is built on 4 layers so the examples are stored in their subfolder:

To give a brief idea of the differences, for example in generating a new wallet:

  • Stateless

    final networkInfo = NetworkInfo(
      bech32Hrp: 'did:com:',
      lcdUrl: 'http://localhost:1317',
    );
    
    final wallet = await StatelessCommercioAccount.generateNewWallet(
      networkInfo: networkInfo);
    
  • Stateful

    final commercioAccount = StatefulCommercioAccount();
    
    await commercioAccount.generateNewWallet();
    
  • BLoC

    BlocProvider<CommercioAccountBloc>(
      create: (_) =>
        CommercioAccountBloc(commercioAccount: StatefulCommercioAccount()),
          child: BlocBuilder<CommercioAccountBloc, CommercioAccountState>(
            builder: (_, state) {
              if (state is CommercioAccountInitial) {
                // ...
              }
    
              if (state is CommercioAccountLoadingGenerateWallet) {
                // ...
              }
    
              if (state is CommercioAccountGeneratedWithWallet) {
                // ...
              }
            },
          ),
    )
    
  • Widgets

    BlocProvider<CommercioAccountBloc>(
      create: (_) =>
        CommercioAccountBloc(commercioAccount: StatefulCommercioAccount()),
      child: Column(
        children: [
          GenerateWalletFlatButton(
              child: () => const Text('Generate new wallet'),
              loadingChild: () => const Text('Generating...'),
            ),
            GenerateWalletCommercioAccountTextField(
              loadingTextCallback: () => 'Generating...',
              textCallback: (state) => state.commercioAccount.walletAddress,
            ),
        ],
      ),
    )
    
1
likes
40
pub points
0%
popularity

Publisher

unverified uploader

CommercioUI pre-build clean Core+UI widgets intended to reduce significantly the overall blockchain app development time

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

basic_utils, bip39, bloc, commerciosdk, equatable, flutter, flutter_bloc, flutter_secure_storage, freezed_annotation, http, sacco, shared_preferences, shared_preferences_linux, shared_preferences_macos, shared_preferences_web, uuid

More

Packages that depend on commercio_ui