Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Collapse other open sections when tap on setting #401

Merged
merged 4 commits into from Nov 29, 2019
Merged

Conversation

guidezpl
Copy link
Member

@guidezpl guidezpl commented Nov 29, 2019

Description

This PR makes it so at most one setting subsection is open at a time.

It also uses ListView.builder instead of Column to display options, but doesn't fix the choppiness issue

Related Issues

Closes #347
#346

@@ -181,7 +177,8 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>

@override
Widget build(BuildContext context) {
final bool closed = !_isExpanded && _controller.isDismissed;
_handleExpansion();
final bool closed = !widget.isExpanded && _controller.isDismissed;
Copy link
Contributor

Choose a reason for hiding this comment

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

closed variable made but never used in PR

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still used in line 207

Copy link
Contributor

@rami-a rami-a left a comment

Choose a reason for hiding this comment

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

 __    ___  ____  __  __ 
(  )  / __)(_  _)(  \/  )
 )(__( (_-.  )(   )    ( 
(____)\___/ (__) (_/\/\_)

@@ -95,6 +114,8 @@ class SettingsPage extends StatelessWidget {
context,
options.copyWith(customTextDirection: newTextDirection),
),
onTapSetting: () => onTapSetting(1),
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you repeat each id twice, probably best to make consts to avoid errors

@@ -181,7 +177,8 @@ class _SettingsListItemState<T> extends State<SettingsListItem<T>>

@override
Widget build(BuildContext context) {
final bool closed = !_isExpanded && _controller.isDismissed;
_handleExpansion();
final bool closed = !widget.isExpanded && _controller.isDismissed;
Copy link
Contributor

Choose a reason for hiding this comment

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

drop the bool

Copy link
Contributor

@JoseAlba JoseAlba left a comment

Choose a reason for hiding this comment

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

██╗      ██████╗ ████████╗███╗   ███╗
██║     ██╔════╝ ╚══██╔══╝████╗ ████║
██║     ██║  ███╗   ██║   ██╔████╔██║
██║     ██║   ██║   ██║   ██║╚██╔╝██║
███████╗╚██████╔╝   ██║   ██║ ╚═╝ ██║
╚══════╝ ╚═════╝    ╚═╝   ╚═╝     ╚═╝

@guidezpl guidezpl merged commit 04e5f93 into master Nov 29, 2019
@guidezpl guidezpl deleted the settings-expanding branch November 29, 2019 13:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Settings - Expanding one section should collapse any open section
3 participants