Don't use 'BuildContext's across async gaps – where does the mounted property come from?

Advertisements How to rewrite this to awoid Don’t use ‘BuildContext’s across async gaps. warning. onPressed: () async { if (snapshot.hasData) { final isRapportExist = await bloc.isRapportExist(); if (isRapportExist) { return; } bloc.submitRapport(); Navigator.pop(context, true); //Don’t use ‘BuildContext’s across async gaps. } }, In such cases usully mounted property used, but where it comes from? if(!mounted)… Read More Don't use 'BuildContext's across async gaps – where does the mounted property come from?

I want to display a textfield below if the checkbox is checked in flutter

Advertisements If user clicks on any of the checkbox then a textformfield should be displayed below the checkbox to enter the unit configuration. For example when user clicks on a checkbox 1BHK then a textformfield should be visible under it and if he clicks on 2 BHK then a textformfield should be visible under it… Read More I want to display a textfield below if the checkbox is checked in flutter

Why is row expanded?

Advertisements I am trying to design a simple chat bubble with sender’s name and message. Why my row is expanded? HEre is my code: > Container( > padding: const EdgeInsets.symmetric( > horizontal: 10, vertical: 0), > child: Align( > alignment: widget.senderid == > chatState.messages[index].senderid > ? Alignment.topLeft: Alignment.topRight, > child: Container( > decoration: BoxDecoration( >… Read More Why is row expanded?

Is there any way to change Flutter icons "secondary" color?

Advertisements I am using Icons.verified in flutter and I can change the background color fine, but cannot change the inner tick color. Any way to do that ? const verifiedBadge = Icon( Icons.verified, color: Color(0xFF27aae1), size: 28, ); I looked into the available properties but do not see any secondary, highlightColor or something that might… Read More Is there any way to change Flutter icons "secondary" color?

focused border not taking the whole container flutter

Advertisements Here as shown the focused border is not taking the whole space. Can anybody explain why and fix it. Here is the code of the TextField : child: Padding( padding: const EdgeInsets.only(left: 20.0), child: TextField( controller: _emailController, decoration: InputDecoration( hintText: ‘Enter your email’, border: InputBorder.none, focusedBorder: OutlineInputBorder( borderSide: const BorderSide(color: Colors.deepPurple), borderRadius: BorderRadius.circular(12), ),… Read More focused border not taking the whole container flutter