Collapse other open sections when tap on setting #401
Conversation
@@ -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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__ ___ ____ __ __
( ) / __)(_ _)( \/ )
)(__( (_-. )( ) (
(____)\___/ (__) (_/\/\_)
gallery/lib/pages/settings.dart
Outdated
@@ -95,6 +114,8 @@ class SettingsPage extends StatelessWidget { | |||
context, | |||
options.copyWith(customTextDirection: newTextDirection), | |||
), | |||
onTapSetting: () => onTapSetting(1), |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop the bool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
██╗ ██████╗ ████████╗███╗ ███╗
██║ ██╔════╝ ╚══██╔══╝████╗ ████║
██║ ██║ ███╗ ██║ ██╔████╔██║
██║ ██║ ██║ ██║ ██║╚██╔╝██║
███████╗╚██████╔╝ ██║ ██║ ╚═╝ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
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