Skip to content

Conversation

@beckler
Copy link
Contributor

@beckler beckler commented Sep 25, 2018

Should fix #22226.

Code introduced in #20890 caused a regression that broke color flooding animations in a BottomNavigationBar that has BottomNavigationBarType.shifting.

The original issue (#19653) dealt with background color changes not occurring until another tab was selected. The result is that the background color instantly changes whenever the state changes and when the widget changes, instead of allowing a new widget to animate the background color change.

Here's what it currently looks like: Actual
Here's what it should look like: Expected

Note: I may need some advice on how to test this.

@dnfield dnfield requested a review from HansMuller September 26, 2018 06:40
@dnfield dnfield added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Sep 26, 2018
Copy link
Contributor

@mklim mklim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

This code LGTM but should be tested before it's merged. Unfortunately I think the only way to check the animation is to write a golden file test to verify different keyframes as the animation is playing. That's going to be involved because it will require committing the screenshots to the goldens repo halfway through. You'll need to make a second PR at that point to commit the images.

No worries if you don't think you can get around to updating this PR. Eventually a Flutter maintainer will be able to pick this up and add in the test instead.

@tvolkert
Copy link
Contributor

tvolkert commented Nov 1, 2018

@beckler, do you anticipate being able to add a test for this as @mklim describes?

@beckler
Copy link
Contributor Author

beckler commented Nov 2, 2018

@tvolkert So I spent a small amount of time looking into this, and while it actually looks quite easy to write the tests, I was unsure how to create the screenshots after looking in the goldens repo.

@tvolkert
Copy link
Contributor

tvolkert commented Nov 2, 2018

@beckler our processes need some work here (we're scoping out what it'd take to have a dedicated storage, visualization, and approvals solution for golden files). In the meantime, https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter has the details (look for the --update-goldens reference), scrappy as they are.

The Cliffs Notes version is:

  1. You write the test assuming the golden file is there
  2. You run the test with the --update-goldens flag, which will create the missing golden file.
  3. You navigate to $FLUTTER_ROOT/bin/cache/pkg/goldens and discover that it's actually a nested Git clone of the flutter/goldens GitHub repository -- with pending changes (namely, the newly created golden file).
  4. You land those changes via a separate commit to the flutter/goldens GitHub repository (send a separate PR and @ mention me).
  5. You update the bin/internal/goldens.version in this PR to reference the newly created commit you just landed in the other repo.

I apologize for the rigamarole -- like I said, we're looking into what it'd take to improve that process.

@beckler
Copy link
Contributor Author

beckler commented Nov 2, 2018

@tvolkert Ahhh, okay. I think I see how this works now. I'll spin up a Linux VM and take a shot at it tonight.

@beckler
Copy link
Contributor Author

beckler commented Nov 3, 2018

@tvolkert I added the goldens to flutter/goldens#19.

Copy link
Contributor

@tvolkert tvolkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Leaving the approval to @HansMuller

@tvolkert
Copy link
Contributor

tvolkert commented Nov 5, 2018

FYI, I merged the PR on the goldens repo, so your commit hash is ffe7e5ceaeccaa7c9419ec44eff96c31f4fc2601

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement to the shifting BottomNavigationBar animation. Well done!

LGTM

@tvolkert
Copy link
Contributor

tvolkert commented Nov 6, 2018

You'll need to update https://github.com/flutter/flutter/blob/master/bin/internal/goldens.version in this PR as well to point to ffe7e5ceaeccaa7c9419ec44eff96c31f4fc2601 in order for the tests to pass

@beckler
Copy link
Contributor Author

beckler commented Nov 6, 2018

Hey @tvolkert, it looks like the images I initially uploaded were actually generated from macOS, so I created another PR with images generated from linux. flutter/goldens#21

I also updated the test to skip on non-linux platforms.

@tvolkert
Copy link
Contributor

tvolkert commented Nov 6, 2018

Thanks! I merged it in the goldens repo -- commit hash 8c478bbaf27447f3d612959705b305e7d1293526

@tvolkert tvolkert merged commit 9abce96 into flutter:master Nov 7, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: bottom navigation bar color flooding animation is broken

6 participants