Skip to content
New issue

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

Error calculating dimensions in SimpleDialog #24

Closed
warriorCoder opened this issue Jun 29, 2019 · 9 comments
Closed

Error calculating dimensions in SimpleDialog #24

warriorCoder opened this issue Jun 29, 2019 · 9 comments
Labels
bug Something isn't working wip This issue is currently being implemented

Comments

@warriorCoder
Copy link

warriorCoder commented Jun 29, 2019

Steps to Reproduce

  • Create a SimpleDialog being shown in the showDialog call.
  • In the title add a row with an expanded widget which holds the AutoSizeText widget

Code sample

Container(
            color: Colors.black12,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Expanded(
                  child: Padding(
                    padding:
                        const EdgeInsets.only(left: 10, top: 10, bottom: 5),
                    child: AutoSizeText(
                       "Big long huge title here to shrink",
                      style: Theme.of(context).textTheme.title,
                      minFontSize: 14,
                      maxLines: 1,         
                    ),
                  ),
                ),
                IconButton(
                  alignment: Alignment.topRight,
                  icon: Icon(Icons.close),
                  onPressed: () => Navigator.of(context).pop(),
                )
              ],
            ),
          ),

Screenshots
If applicable, add screenshots to help explain your problem.

Version

  • Flutter version: [1.5.4]
  • auto_size_text version: [2.0.1]
@warriorCoder warriorCoder added the bug Something isn't working label Jun 29, 2019
@simc
Copy link
Owner

simc commented Jul 1, 2019

I will look into this as soon as possible...

@simc simc added the wip This issue is currently being implemented label Jul 1, 2019
@VoidElle
Copy link

Same error here, I cannot use AutoSizeText widget inside dialogs

@simc
Copy link
Owner

simc commented Jul 19, 2019

@lucadelc I still haven't had time to look into this :/

@VoidElle
Copy link

Nothing yet?

@simc
Copy link
Owner

simc commented Jul 29, 2019

Sorry, I have exams currently. After that I'll start working on the project again.

If you are in a hurry, maybe you can look into the problem yourself. If you find a solution, please create a pull request 👍

@VoidElle
Copy link

No problem mate, take your time, btw I'm a flutter developer but i don't know how to create a plugin at all 😂

@Ahmadre
Copy link

Ahmadre commented Aug 11, 2019

@lucadelc : you don't need to know how to create a plugin. For a quick test: change you local copy of AutoSizeText components and if you succeeded, you can point out your fix here 😊

Sent from my Pixel 2 XL using FastHub

@simc
Copy link
Owner

simc commented Aug 13, 2019

@warriorCoder Your code works fine for me. But you have to wrap it in a SizedBox because the dialog itself does not restrict its children.

@davidlawson
Copy link

From the AlertDialog docs:

(However, be aware that since [AlertDialog] tries to size itself using the intrinsic dimensions of its children, widgets such as [ListView], [GridView], and [CustomScrollView], which use lazy viewports, will not work. If this is a problem, consider using [Dialog] directly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wip This issue is currently being implemented
Projects
None yet
Development

No branches or pull requests

5 participants