Skip to content

Mobx duvida com funcao async #126

Discussion options

You must be logged in to vote

Ola @LucasMendestr, tu pode utilizar o widget FutureBuilder para atualizar a tela quando for finalizado a função getCategoryName.
Ficaria assim:

`@override
Widget build(BuildContext context) {
final widthMax = MediaQuery.of(context).size.width;

return FutureBuilder(
  future: GetIt.I
      .get<LedgerTileController>()
      .getCategoryName(categoryId: widget.ledger.categoryId),
  builder: (context, snapshot) {
    if (ledgerTileController.isLoading == true) {
      return const Center(child: CircularProgressIndicator());
    } else {
      return Card(
        shape:
            RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
        color: const Color(0xFF46406C),
     …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by LucasMendestr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants