commercio_ui 0.1.0 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
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, ), ], ), )