We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question How to avoid AutoSizeText trying to resize itself when tapping on a checkbox that is placed in the same row.
Code sample
// Create days boxes widgets List<Widget> createDaysBoxes() { AutoSizeGroup textGroup = AutoSizeGroup(); // Keep consistent font size for all days List<Widget> daysBoxes = []; data.checkedDays.forEach( (day, isChecked) { daysBoxes.add( Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( flex: 3, child: Padding( padding: const EdgeInsets.fromLTRB(10, 5, 0, 5), child: AutoSizeText( getDayString(day), group: textGroup, style: const TextStyle(fontSize: 40), ), ), ), Expanded( child:Checkbox( checkColor: Colors.white, value: data.checkedDays[day]![1], onChanged: (bool? value) { setState(() { data.checkedDays[day]![1] = value!; }); }, ), ), ], ), ), ); }, ); return daysBoxes; }
Screenshot -> in this screenshot, "Monday" and "Tuesday" are trying to automatically resize their fontsize each time I tap on a checkbox.
Version
The text was updated successfully, but these errors were encountered:
So the fix is simply to put the AutoSizeText days in a stateless widget so the text is only calculated on the page launch and not during interaction.
Sorry, something went wrong.
simc
No branches or pull requests
Question
How to avoid AutoSizeText trying to resize itself when tapping on a checkbox that is placed in the same row.
Code sample
Screenshot
-> in this screenshot, "Monday" and "Tuesday" are trying to automatically resize their fontsize each time I tap on a checkbox.
Version
The text was updated successfully, but these errors were encountered: