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

Use more const Widgets #71

Closed
jonahwilliams opened this issue Apr 12, 2018 · 1 comment
Closed

Use more const Widgets #71

jonahwilliams opened this issue Apr 12, 2018 · 1 comment
Labels
Priority: Low Status: In progress The work has been started and is actively worked on by someone. Type: Code quality

Comments

@jonahwilliams
Copy link
Contributor

I've noticed there are a lot of places where new can be replaced by const with just some small changes.
Every place you can use a const widget instead of new, you save flutter a little bit of work.

For example, in event_backdrop_photo.dart

  Widget _buildShadowInset(BuildContext context) {
    return new Positioned(
      bottom: -8.0,
      child: new DecoratedBox(
        decoration: *const* BoxDecoration(
          boxShadow: *const* <BoxShadow>[
            *const* BoxShadow(
              color: Colors.black38,
              blurRadius: 5.0,
              spreadRadius: 3.0,
            ),
          ],
        ),
        child: new SizedBox(
          width: MediaQuery.of(context).size.width,
          height: 10.0,
        ),
      ),
    );
  }

They aren't huge changes, but if you're interested I can open a PR

@roughike
Copy link
Owner

Sure! Sometimes it's hard to notice those places where a const can be used for me. Would love to have a PR!

@roughike roughike added Priority: Low Type: Code quality Status: In progress The work has been started and is actively worked on by someone. labels Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Status: In progress The work has been started and is actively worked on by someone. Type: Code quality
Projects
None yet
Development

No branches or pull requests

2 participants