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

[flutter_adaptive_scaffold] : 🐛 [FIX] : Issue: 121135. #3253

Merged
merged 39 commits into from
Mar 17, 2023

Conversation

aliasgar4558
Copy link
Contributor

@aliasgar4558 aliasgar4558 commented Feb 22, 2023

Changes included in PR are listed as follows

List which issues are fixed by this PR. You must list at least one issue.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

- CHANGELOG.md updated.
- Version updated to 0.1.1.
- ✅ : Test case updated as per changes in /example.
@aliasgar4558
Copy link
Contributor Author

@gspencergoog PR updated.

@@ -1,3 +1,7 @@
## 0.1.1

* 🐛 : FIX - [**121135**](https://github.com/flutter/flutter/issues/121135) : `selectedIcon` parameter not displayed even if it is provided from example.
Copy link
Contributor

@gspencergoog gspencergoog Feb 27, 2023

Choose a reason for hiding this comment

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

Let's stick with a more standard bug fix notice without the emoji.

Suggested change
* 🐛 : FIX - [**121135**](https://github.com/flutter/flutter/issues/121135) : `selectedIcon` parameter not displayed even if it is provided from example.
* Fixes flutter/flutter#121135) `selectedIcon` parameter not displayed even if it is provided

Also, see the style guilde for this: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for sending the guide for change log updation. I will do the needful in my future commits.

@@ -35,46 +42,64 @@ class MyHomePage extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: const Color.fromARGB(255, 255, 201, 197),
color: const Color.fromARGB(255, 255, 29, 197),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this color change?

Copy link
Contributor Author

@aliasgar4558 aliasgar4558 Mar 1, 2023

Choose a reason for hiding this comment

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

It was an unintentional change. I can revert that.

@aliasgar4558
Copy link
Contributor Author

@gspencergoog I have updated PR with changes made upon your comments.

Copy link
Contributor

@gspencergoog gspencergoog 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 looking better!

We still need some more testing, though. Can you write some more tests that make sure that your changes won't get accidentally reverted in the future, and that your changes continue to work as intended? Typically we would update tests for the demos and the adaptive_scaffold itself.

@@ -142,6 +153,10 @@ class MyHomePage extends StatelessWidget {
inAnimation: AdaptiveScaffold.leftOutIn,
key: const Key('Primary Navigation Medium'),
builder: (_) => AdaptiveScaffold.standardNavigationRail(
selectedIndex: selectedNavigation,
onDestinationSelected: (int newIndex) {
setState(() => selectedNavigation = newIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't usually use inline functions for setState arguments. The convention is to put them in braces. (here, and elsewhere in the PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

return Builder(
builder: (_) {
return BottomNavigationBar(
currentIndex: currentIndex ?? 0,
iconSize: iconSize,
type: BottomNavigationBarType.fixed,
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be wrong about this, but doesn't this disable the animation on the bottom navigation bar? Was there a reason you added this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@aliasgar4558
Copy link
Contributor Author

Regarding to the widget testing of the component and demos, I have made some changes in my past commit addressing the widget related issue. Apart from that, I couldn't see any test that is missing. As we cant actually test the things with selectedIcon (the change we made) as it is an optional parameter so its upto the consumer, how he/she wants to utilise it.

@aliasgar4558
Copy link
Contributor Author

@gspencergoog, let me know your further concerns about it.

return NavigationRailDestination(
label: Text(destination.label),
icon: destination.icon,
selectedIcon: destination.selectedIcon,
Copy link
Contributor

Choose a reason for hiding this comment

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

In the test/adaptive_scaffold_test.dart file, you can create a new test to find this icon to make sure that it is being displayed. You might have to have the test tap on the button to select it. To find the icon's widget, you can use find.byIcon(), giving it the selected icon you designated in the test.

Copy link
Contributor Author

@aliasgar4558 aliasgar4558 Mar 11, 2023

Choose a reason for hiding this comment

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

Test cases added for determining selected Icon availability in UI if any tap gesture happens to navigation rail. Used find.byKey() for finding specific icons in UI.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

Thanks for the PR!

destinations.length,
);

for (final NavigationRailDestination element
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: "destination" might be a better name, since element is an overloaded term here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I Will make change in some time and update the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gspencergoog : Test case updated.

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.

LGTM

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 17, 2023
@auto-submit auto-submit bot merged commit d2f1d2d into flutter:main Mar 17, 2023
@aliasgar4558 aliasgar4558 deleted the fix_121135_adaptive_scaffold branch March 18, 2023 03:39
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2023
tarrinneal pushed a commit to flutter/flutter that referenced this pull request Mar 20, 2023
* 7636eb7 [go_router_builder] Support default value for `Set`, `List` and `Iterable` route parameters (flutter/packages#3391)

* 26c95da [image_picker] Move HashSet construction within if-statement (flutter/packages#3448)

* f5687b2 [image_picker] fix typos in comments (flutter/packages#3413)

* 84afba7 [image_picker] Migrate Android to Pigeon (flutter/packages#3476)

* 42927fc [image_picker]: Bump androidx.exifinterface:exifinterface from 1.3.3 to 1.3.6 in /packages/image_picker/image_picker_android/android (flutter/packages#3238)

* 9a44bdf Require Dart SDK 2.14, because of using APIs. (flutter/packages#3468)

* 12609a2 [ci] Clean up iOS simulators (flutter/packages#3458)

* 9b136a9 [ci/tool] Add external dependency validation (flutter/packages#3466)

* 11aab47 Manual roll Flutter from fb7e828 to 67e5f66 (8 revisions) (flutter/packages#3482)

* 784291b Update goldens (flutter/packages#3442)

* 43a42d1 [webview_flutter_android] Updates Dart and Java InstanceManagers (flutter/packages#3282)

* d0de136 [camera] Reland android flip/change camera while recording (flutter/packages#3460)

* 74fd094 [image_picker_android] Adjust file extension in FileUtils when it does not match its mime type (flutter/packages#3409)

* d2f1d2d [flutter_adaptive_scaffold] : 🐛 [FIX] : Issue: 121135. (flutter/packages#3253)

* 3d078b5 Roll Flutter from 67e5f66 to 53dfd23 (39 revisions) (flutter/packages#3484)

* 3b3a09d [url_launcher] Convert iOS to Pigeon (flutter/packages#3481)

* 80cd50a Roll Flutter from 53dfd23 to 6bd2b3c (17 revisions) (flutter/packages#3486)

* 998bb29 [webview_flutter] Updates the README with the migration of `WebView.initialCookies` and Hybrid Composition on (flutter/packages#3470)

* bbf86a7 Roll Flutter from 6bd2b3c to 3e4e092 (7 revisions) (flutter/packages#3490)
nploi pushed a commit to nploi/packages that referenced this pull request Jul 16, 2023
[flutter_adaptive_scaffold] : � [FIX] : Issue: 121135.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: flutter_adaptive_scaffold
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants